A model context protocol (MCP) for interacting with Bioportal
Project description
bioportal-mcp
A Model Context Protocol (MCP) server for interacting with the BioPortal API to search and retrieve ontology terms.
Features
- Search ontology terms: Search across BioPortal's extensive collection of biomedical ontologies
- Flexible filtering: Filter by specific ontologies (e.g., NCIT, GO, HP, MONDO)
- Exact matching: Option to require exact matches or allow fuzzy matching
- Rich results: Returns term IDs, preferred labels, and ontology information
Installation
You can install the package from source:
pip install -e .
Or using uv:
uv pip install -e .
Setup
Before using this MCP server, you need to obtain a BioPortal API key:
- Visit BioPortal
- Create an account or sign in
- Go to your account settings to get your API key
- Set the API key as an environment variable:
export BIOPORTAL_API_KEY="your_api_key_here"
Usage
As an MCP Server
Run the MCP server:
bioportal-mcp
Available Tools
search_ontology_terms
Search for ontology terms in BioPortal.
Parameters:
query(str): The search term (e.g., "melanoma", "breast cancer", "neuron")ontologies(str, optional): Comma-separated list of ontology acronyms (e.g., "NCIT,GO,HP")max_results(int, default=10): Maximum number of results to returnrequire_exact_match(bool, default=False): Whether to require exact matchesapi_key(str, optional): BioPortal API key (uses environment variable if not provided)
Returns: List of tuples containing:
- Term ID (e.g., "http://purl.obolibrary.org/obo/NCIT_C4872")
- Preferred label (e.g., "Breast Cancer")
- Ontology acronym (e.g., "NCIT")
Integration with AI Assistants
This MCP server can be integrated with AI assistants like Claude Desktop. Add the following to your MCP configuration:
{
"mcpServers": {
"bioportal": {
"command": "bioportal-mcp",
"env": {
"BIOPORTAL_API_KEY": "your_api_key_here"
}
}
}
}
A streamable version of this MCP is also available from the following URL:
https://bioportal.fastmcp.app/mcp
This means it may be used through any agentic framework supporting HTTP streaming of MCPs.
Examples
# Search for cancer terms
results = search_ontology_terms("cancer")
# Search for cell types in Cell Ontology
results = search_ontology_terms("neuron", ontologies="CL")
# Search for exact matches only
results = search_ontology_terms("melanoma", require_exact_match=True)
# Limit results
results = search_ontology_terms("disease", max_results=5)
Supported Ontologies
BioPortal hosts hundreds of ontologies. Some popular ones include:
- NCIT: NCI Thesaurus - comprehensive cancer terminology
- GO: Gene Ontology - gene and protein functions
- HP: Human Phenotype Ontology - phenotypes and clinical features
- MONDO: Disease ontology
- CHEBI: Chemical entities
- UBERON: Anatomy ontology
- CL: Cell Ontology
- SO: Sequence Ontology
Development
Local Setup
# Clone the repository
git clone https://github.com/ncbo/bioportal-mcp.git
cd bioportal-mcp
# Install development dependencies
uv pip install -e ".[dev]"
License
BSD-3-Clause
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bioportal_mcp-0.1.1.tar.gz.
File metadata
- Download URL: bioportal_mcp-0.1.1.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d46abd1b20ec51c395bb1c4783d854058876bc35d7fb4c2a4dcea5a30a3235c
|
|
| MD5 |
d674a31a50cf6f3c6ce686eb3949eca3
|
|
| BLAKE2b-256 |
07017246491b63b11d401a9ca3c4a8c83408eb15a55d7591e528ab6eea73ecac
|
Provenance
The following attestation bundles were made for bioportal_mcp-0.1.1.tar.gz:
Publisher:
pypi-publish.yml on ncbo/bioportal-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bioportal_mcp-0.1.1.tar.gz -
Subject digest:
0d46abd1b20ec51c395bb1c4783d854058876bc35d7fb4c2a4dcea5a30a3235c - Sigstore transparency entry: 735087840
- Sigstore integration time:
-
Permalink:
ncbo/bioportal-mcp@8894ba6a532586f4401e19caf0a449dff033760a -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/ncbo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@8894ba6a532586f4401e19caf0a449dff033760a -
Trigger Event:
release
-
Statement type:
File details
Details for the file bioportal_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: bioportal_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9312f1b416188817058eed45111ed76854d15f4e7165a6a55b5518bbddb61a2
|
|
| MD5 |
7b2eda400ce563e92d96f826871761f6
|
|
| BLAKE2b-256 |
079ab0822279f4153e4a4027699b4d2c7ebc466e36087e35446f8bc4caa869ce
|
Provenance
The following attestation bundles were made for bioportal_mcp-0.1.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on ncbo/bioportal-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bioportal_mcp-0.1.1-py3-none-any.whl -
Subject digest:
c9312f1b416188817058eed45111ed76854d15f4e7165a6a55b5518bbddb61a2 - Sigstore transparency entry: 735087883
- Sigstore integration time:
-
Permalink:
ncbo/bioportal-mcp@8894ba6a532586f4401e19caf0a449dff033760a -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/ncbo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@8894ba6a532586f4401e19caf0a449dff033760a -
Trigger Event:
release
-
Statement type: