Skip to main content

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:

  1. Visit BioPortal
  2. Create an account or sign in
  3. Go to your account settings to get your API key
  4. 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 return
  • require_exact_match (bool, default=False): Whether to require exact matches
  • api_key (str, optional): BioPortal API key (uses environment variable if not provided)

Returns: List of tuples containing:

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"
      }
    }
  }
}

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bioportal_mcp-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bioportal_mcp-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file bioportal_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: bioportal_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bioportal_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df385eface73150a8709780b59ab797718e4432454e9d162939f6215ea2db61c
MD5 e2e30eb3621ccbf323fa82b0e481e88f
BLAKE2b-256 d8a6870f0aa9d34012b40714c710e09c4df9c81bbceae38b4d567a3675727788

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioportal_mcp-0.1.0.tar.gz:

Publisher: pypi-publish.yml on ncbo/bioportal-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bioportal_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bioportal_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bioportal_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9a221fd763cd8b685e28f21ca0e19781e94d91610280a12d89b8a02d16a793a
MD5 1824fb8388c474ccfa3387c33b287fd0
BLAKE2b-256 5555e27b0c648b2fac90453840ca5493005e6b4ffc9220961754bb288ad05ecb

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioportal_mcp-0.1.0-py3-none-any.whl:

Publisher: pypi-publish.yml on ncbo/bioportal-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page