biomcp

biomcp

Open-source Model Context Protocol toolkit for biomedical data access

276
Stars
41
Forks
276
Watchers
1
Issues
BioMCP is an open source toolkit designed to connect AI assistants and agents with authoritative biomedical data sources, following the Model Context Protocol (MCP). It enables structured and natural language queries against clinical trials, biomedical literature, and genomic variant databases, and is certified by MCPHub for protocol compliance. The system provides flexible transport options, including STDIO and HTTP, and integrates with major biomedical APIs such as PubMed, ClinicalTrials.gov, MyVariant.info, and cBioPortal. With a suite of core and specialized tools, it supports both unified and domain-specific searches, as well as detailed data retrieval, for comprehensive biomedical research workflows.

Key Features

Certified Model Context Protocol implementation
Unified and domain-specific search tools for biomedical data
Structured and natural language queries
Integration with major biomedical databases (PubMed, ClinicalTrials.gov, MyVariant.info, cBioPortal)
Support for multiple transport protocols (STDIO, HTTP, SSE)
Comprehensive CLI and Python package support
Detailed retrieval for articles, trials, and variants
Session and dynamic response management
Automatic synonym expansion for disease searches
Suite of 24 specialized biomedical research tools

Use Cases

Querying and retrieving biomedical literature and preprints
Searching and analyzing clinical trial registries
Accessing detailed genomic variant information with annotations
Integrating expert biomedical knowledge into AI research assistants
Planning and tracking multi-step biomedical research workflows
Fetching comprehensive gene, disease, and drug information
Performing advanced cross-domain and field-specific research queries
Automating systematic reviews or evidence synthesis
Expanding disease definitions and matching patients to relevant trials
Deploying scalable MCP-compliant servers in local or cloud environments for biomedical applications

README

BioMCP: Biomedical Model Context Protocol

BioMCP is an open source (MIT License) toolkit that empowers AI assistants and agents with specialized biomedical knowledge. Built following the Model Context Protocol (MCP), it connects AI systems to authoritative biomedical data sources, enabling them to answer questions about clinical trials, scientific literature, and genomic variants with precision and depth.

▶️ Watch the video

MCPHub Certification

BioMCP is certified by MCPHub. This certification ensures that BioMCP follows best practices for Model Context Protocol implementation and provides reliable biomedical data access.

Why BioMCP?

While Large Language Models have broad general knowledge, they often lack specialized domain-specific information or access to up-to-date resources. BioMCP bridges this gap for biomedicine by:

  • Providing structured access to clinical trials, biomedical literature, and genomic variants
  • Enabling natural language queries to specialized databases without requiring knowledge of their specific syntax
  • Supporting biomedical research workflows through a consistent interface
  • Functioning as an MCP server for AI assistants and agents

Biomedical Data Sources

BioMCP integrates with multiple biomedical data sources:

Literature Sources

  • PubTator3/PubMed - Peer-reviewed biomedical literature with entity annotations
  • bioRxiv/medRxiv - Preprint servers for biology and health sciences
  • Europe PMC - Open science platform including preprints

Clinical & Genomic Sources

  • ClinicalTrials.gov - Clinical trial registry and results database
  • NCI Clinical Trials Search API - National Cancer Institute's curated cancer trials database
    • Advanced search filters (biomarkers, prior therapies, brain metastases)
    • Organization and intervention databases
    • Disease vocabulary with synonyms
  • BioThings Suite - Comprehensive biomedical data APIs:
    • MyVariant.info - Consolidated genetic variant annotation
    • MyGene.info - Real-time gene annotations and information
    • MyDisease.info - Disease ontology and synonym information
    • MyChem.info - Drug/chemical annotations and properties
  • TCGA/GDC - The Cancer Genome Atlas for cancer variant data
  • 1000 Genomes - Population frequency data via Ensembl
  • cBioPortal - Cancer genomics portal with mutation occurrence data

Regulatory & Safety Sources

  • OpenFDA - FDA regulatory and safety data:
    • Drug Adverse Events (FAERS) - Post-market drug safety reports
    • Drug Labels (SPL) - Official prescribing information
    • Device Events (MAUDE) - Medical device adverse events, with genomic device filtering

Available MCP Tools

BioMCP provides 24 specialized tools for biomedical research:

Core Tools (3)

1. Think Tool (ALWAYS USE FIRST!)

CRITICAL: The think tool MUST be your first step for ANY biomedical research task.

python
# Start analysis with sequential thinking
think(
    thought="Breaking down the query about BRAF mutations in melanoma...",
    thoughtNumber=1,
    totalThoughts=3,
    nextThoughtNeeded=True
)

The sequential thinking tool helps:

  • Break down complex biomedical problems systematically
  • Plan multi-step research approaches
  • Track reasoning progress
  • Ensure comprehensive analysis

2. Search Tool

The search tool supports two modes:

Unified Query Language (Recommended)

Use the query parameter with structured field syntax for powerful cross-domain searches:

python
# Simple natural language
search(query="BRAF melanoma")

# Field-specific search
search(query="gene:BRAF AND trials.condition:melanoma")

# Complex queries
search(query="gene:BRAF AND variants.significance:pathogenic AND articles.date:>2023")

# Get searchable fields schema
search(get_schema=True)

# Explain how a query is parsed
search(query="gene:BRAF", explain_query=True)

Supported Fields:

  • Cross-domain: gene:, variant:, disease:
  • Trials: trials.condition:, trials.phase:, trials.status:, trials.intervention:
  • Articles: articles.author:, articles.journal:, articles.date:
  • Variants: variants.significance:, variants.rsid:, variants.frequency:
Domain-Based Search

Use the domain parameter with specific filters:

python
# Search articles (includes automatic cBioPortal integration)
search(domain="article", genes=["BRAF"], diseases=["melanoma"])

# Search with mutation-specific cBioPortal data
search(domain="article", genes=["BRAF"], keywords=["V600E"])
search(domain="article", genes=["SRSF2"], keywords=["F57*"])  # Wildcard patterns

# Search trials
search(domain="trial", conditions=["lung cancer"], phase="3")

# Search variants
search(domain="variant", gene="TP53", significance="pathogenic")

Note: When searching articles with a gene parameter, cBioPortal data is automatically included:

  • Gene-level summaries show mutation frequency across cancer studies
  • Mutation-specific searches (e.g., "V600E") show study-level occurrence data
  • Cancer types are dynamically resolved from cBioPortal API

3. Fetch Tool

Retrieve full details for a single article, trial, or variant:

python
# Fetch article details (supports both PMID and DOI)
fetch(domain="article", id="34567890")  # PMID
fetch(domain="article", id="10.1101/2024.01.20.23288905")  # DOI

# Fetch trial with all sections
fetch(domain="trial", id="NCT04280705", detail="all")

# Fetch variant details
fetch(domain="variant", id="rs113488022")

Domain-specific options:

  • Articles: detail="full" retrieves full text if available
  • Trials: detail can be "protocol", "locations", "outcomes", "references", or "all"
  • Variants: Always returns full details

Individual Tools (21)

For users who prefer direct access to specific functionality, BioMCP also provides 21 individual tools:

Article Tools (2)

  • article_searcher: Search PubMed/PubTator3 and preprints
  • article_getter: Fetch detailed article information (supports PMID and DOI)

Trial Tools (5)

  • trial_searcher: Search ClinicalTrials.gov or NCI CTS API (via source parameter)
  • trial_getter: Fetch all trial details from either source
  • trial_protocol_getter: Fetch protocol information only (ClinicalTrials.gov)
  • trial_references_getter: Fetch trial publications (ClinicalTrials.gov)
  • trial_outcomes_getter: Fetch outcome measures and results (ClinicalTrials.gov)
  • trial_locations_getter: Fetch site locations and contacts (ClinicalTrials.gov)

Variant Tools (2)

  • variant_searcher: Search MyVariant.info database
  • variant_getter: Fetch comprehensive variant details

NCI-Specific Tools (6)

  • nci_organization_searcher: Search NCI's organization database
  • nci_organization_getter: Get organization details by ID
  • nci_intervention_searcher: Search NCI's intervention database (drugs, devices, procedures)
  • nci_intervention_getter: Get intervention details by ID
  • nci_biomarker_searcher: Search biomarkers used in trial eligibility criteria
  • nci_disease_searcher: Search NCI's controlled vocabulary of cancer conditions

Gene, Disease & Drug Tools (3)

  • gene_getter: Get real-time gene information from MyGene.info
  • disease_getter: Get disease definitions and synonyms from MyDisease.info
  • drug_getter: Get drug/chemical information from MyChem.info

Note: All individual tools that search by gene automatically include cBioPortal summaries when the include_cbioportal parameter is True (default). Trial searches can expand disease conditions with synonyms when expand_synonyms is True (default).

Quick Start

For Claude Desktop Users

  1. Install uv if you don't have it (recommended):

    bash
    # MacOS
    brew install uv
    
    # Windows/Linux
    pip install uv
    
  2. Configure Claude Desktop:

    • Open Claude Desktop settings
    • Navigate to Developer section
    • Click "Edit Config" and add:
    json
    {
      "mcpServers": {
        "biomcp": {
          "command": "uv",
          "args": ["run", "--with", "biomcp-python", "biomcp", "run"]
        }
      }
    }
    
    • Restart Claude Desktop and start chatting about biomedical topics!

Python Package Installation

bash
# Using pip
pip install biomcp-python

# Using uv (recommended for faster installation)
uv pip install biomcp-python

# Run directly without installation
uv run --with biomcp-python biomcp trial search --condition "lung cancer"

Configuration

Environment Variables

BioMCP supports optional environment variables for enhanced functionality:

bash
# cBioPortal API authentication (optional)
export CBIO_TOKEN="your-api-token"  # For authenticated access
export CBIO_BASE_URL="https://www.cbioportal.org/api"  # Custom API endpoint

# Performance tuning
export BIOMCP_USE_CONNECTION_POOL="true"  # Enable HTTP connection pooling (default: true)
export BIOMCP_METRICS_ENABLED="false"     # Enable performance metrics (default: false)

Running BioMCP Server

BioMCP supports multiple transport protocols to suit different deployment scenarios:

Local Development (STDIO)

For direct integration with Claude Desktop or local MCP clients:

bash
# Default STDIO mode for local development
biomcp run

# Or explicitly specify STDIO
biomcp run --mode stdio

HTTP Server Mode

BioMCP supports multiple HTTP transport protocols:

Legacy SSE Transport (Worker Mode)

For backward compatibility with existing SSE clients:

bash
biomcp run --mode worker
# Server available at http://localhost:8000/sse

Streamable HTTP Transport (Recommended)

The new MCP-compliant Streamable HTTP transport provides optimal performance and standards compliance:

bash
biomcp run --mode streamable_http

# Custom host and port
biomcp run --mode streamable_http --host 127.0.0.1 --port 8080

Features of Streamable HTTP transport:

  • Single /mcp endpoint for all operations
  • Dynamic response mode (JSON for quick operations, SSE for long-running)
  • Session management support (future)
  • Full MCP specification compliance (2025-03-26)
  • Better scalability for cloud deployments

Deployment Options

Docker

bash
# Build the Docker image locally
docker build -t biomcp:latest .

# Run the container
docker run -p 8000:8000 biomcp:latest biomcp run --mode streamable_http

Cloudflare Workers

The worker mode can be deployed to Cloudflare Workers for global edge deployment.

Note: All APIs work without authentication, but tokens may provide higher rate limits.

Command Line Interface

BioMCP provides a comprehensive CLI for direct database interaction:

bash
# Get help
biomcp --help

# Run the MCP server
biomcp run

# Article search examples
biomcp article search --gene BRAF --disease Melanoma  # Includes preprints by default
biomcp article search --gene BRAF --no-preprints      # Exclude preprints
biomcp article get 21717063 --full

# Clinical trial examples
biomcp trial search --condition "Lung Cancer" --phase PHASE3
biomcp trial search --condition melanoma --source nci --api-key YOUR_KEY  # Use NCI API
biomcp trial get NCT04280705 Protocol
biomcp trial get NCT04280705 --source nci --api-key YOUR_KEY  # Get from NCI

# Variant examples with external annotations
biomcp variant search --gene TP53 --significance pathogenic
biomcp variant get rs113488022  # Includes TCGA, 1000 Genomes, and cBioPortal data by default
biomcp variant get rs113488022 --no-external  # Core annotations only

# NCI-specific examples (requires NCI API key)
biomcp organization search "MD Anderson" --api-key YOUR_KEY
biomcp organization get ORG123456 --api-key YOUR_KEY
biomcp intervention search pembrolizumab --api-key YOUR_KEY
biomcp intervention search --type Device --api-key YOUR_KEY
biomcp biomarker search "PD-L1" --api-key YOUR_KEY
biomcp disease search melanoma --source nci --api-key YOUR_KEY

Testing & Verification

Test your BioMCP setup with the MCP Inspector:

bash
npx @modelcontextprotocol/inspector uv run --with biomcp-python biomcp run

This opens a web interface where you can explore and test all available tools.

Enterprise Version: OncoMCP

OncoMCP extends BioMCP with GenomOncology's enterprise-grade precision oncology platform (POP), providing:

  • HIPAA-Compliant Deployment: Secure on-premise options
  • Real-Time Trial Matching: Up-to-date status and arm-level matching
  • Healthcare Integration: Seamless EHR and data warehouse connectivity
  • Curated Knowledge Base: 15,000+ trials and FDA approvals
  • Sophisticated Patient Matching: Using integrated clinical and molecular profiles
  • Advanced NLP: Structured extraction from unstructured text
  • Comprehensive Biomarker Processing: Mutation and rule processing

Learn more: GenomOncology

MCP Registries

smithery badge

Example Use Cases

Gene Information Retrieval

python
# Get comprehensive gene information
gene_getter(gene_id_or_symbol="TP53")
# Returns: Official name, summary, aliases, links to databases

Disease Synonym Expansion

python
# Get disease information with synonyms
disease_getter(disease_id_or_name="GIST")
# Returns: "gastrointestinal stromal tumor" and other synonyms

# Search trials with automatic synonym expansion
trial_searcher(conditions=["GIST"], expand_synonyms=True)
# Searches for: GIST OR "gastrointestinal stromal tumor" OR "GI stromal tumor"

Integrated Biomedical Research

python
# 1. Always start with thinking
think(thought="Analyzing BRAF V600E in melanoma treatment", thoughtNumber=1)

# 2. Get gene context
gene_getter("BRAF")

# 3. Search for pathogenic variants
variant_searcher(gene="BRAF", hgvsp="V600E", significance="pathogenic")

# 4. Find relevant clinical trials with disease expansion
trial_searcher(conditions=["melanoma"], interventions=["BRAF inhibitor"])

Documentation

For comprehensive documentation, visit https://biomcp.org

Developer Guides

Development

Running Tests

bash
# Run all tests (including integration tests)
make test

# Run only unit tests (excluding integration tests)
uv run python -m pytest tests -m "not integration"

# Run only integration tests
uv run python -m pytest tests -m "integration"

Note: Integration tests make real API calls and may fail due to network issues or rate limiting. In CI/CD, integration tests are run separately and allowed to fail without blocking the build.

BioMCP Examples Repo

Looking to see BioMCP in action?

Check out the companion repository: 👉 biomcp-examples

It contains real prompts, AI-generated research briefs, and evaluation runs across different models. Use it to explore capabilities, compare outputs, or benchmark your own setup.

Have a cool example of your own? We’d love for you to contribute! Just fork the repo and submit a PR with your experiment.

License

This project is licensed under the MIT License.

Star History

Star History Chart

Repository Owner

genomoncology
genomoncology

Organization

Repository Details

Language Python
Default Branch main
Size 6,751 KB
Contributors 6
License MIT License
MCP Verified Sep 2, 2025

Programming Languages

Python
94.95%
JavaScript
3.38%
Gherkin
1.41%
Makefile
0.19%
Dockerfile
0.07%

Topics

ai bioinformatics clinical-trials genomics llm mcp mcp-server medical model-context-protocol pubmed pubmed-central

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • mindsdb

    mindsdb

    Connect, unify, and query data at scale with an open-source AI platform.

    MindsDB enables seamless connection to and unification of data from hundreds of enterprise sources, allowing for highly accurate responses across large-scale federated systems. It provides an open-source server with built-in support for the Model Context Protocol (MCP) to facilitate standardized interaction with AI-driven question answering over diverse data sets. The platform offers tools for preparing, organizing, and transforming both structured and unstructured data via knowledge bases, views, and scheduled jobs. Its agent framework and SQL interface empower users to configure data-centric agents, automate workflows, and interact with data conversationally.

    • 35,487
    • MCP
    • mindsdb/mindsdb
  • OpenMCP

    OpenMCP

    A standard and registry for converting web APIs into MCP servers.

    OpenMCP defines a standard for converting various web APIs into servers compatible with the Model Context Protocol (MCP), enabling efficient, token-aware communication with client LLMs. It also provides an open-source registry of compliant servers, allowing clients to access a wide array of external services. The platform supports integration with local and remote hosting environments and offers tools for configuring supported clients, such as Claude desktop and Cursor. Comprehensive guidance is offered for adapting different API formats including REST, gRPC, GraphQL, and more into MCP endpoints.

    • 252
    • MCP
    • wegotdocs/open-mcp
  • mcp

    mcp

    Universal remote MCP server connecting AI clients to productivity tools.

    WayStation MCP acts as a remote Model Context Protocol (MCP) server, enabling seamless integration between AI clients like Claude or Cursor and a wide range of productivity applications, such as Notion, Monday, Airtable, Jira, and more. It supports multiple secure connection transports and offers both general and user-specific preauthenticated endpoints. The platform emphasizes ease of integration, OAuth2-based authentication, and broad app compatibility. Users can manage their integrations through a user dashboard, simplifying complex workflow automations for AI-powered productivity.

    • 27
    • MCP
    • waystation-ai/mcp
  • 1mcp-app/agent

    1mcp-app/agent

    A unified server that aggregates and manages multiple Model Context Protocol servers.

    1MCP Agent provides a single, unified interface that aggregates multiple Model Context Protocol (MCP) servers, enabling seamless integration and management of external tools for AI assistants. It acts as a proxy, managing server configuration, authentication, health monitoring, and dynamic server control with features like asynchronous loading, tag-based filtering, and advanced security options. Compatible with popular AI development environments, it simplifies setup by reducing redundant server instances and resource usage. Users can configure, monitor, and scale model tool integrations across various AI clients through easy CLI commands or Docker deployment.

    • 96
    • MCP
    • 1mcp-app/agent
  • anyquery

    anyquery

    Universal SQL query engine for files, databases, apps, and LLM integration.

    Anyquery is a SQL query engine that enables users to run SQL queries on a wide array of data sources, including files, databases, and popular applications via plugins. It supports integrations with large language models (LLMs) through the Model Context Protocol (MCP), providing seamless access for AI models to query data. Built on SQLite, it extends functionality with a plugin system and can also function as a MySQL server for compatibility with conventional SQL clients. Its flexible installation options and broad plugin ecosystem allow extensive customization and integration.

    • 1,298
    • MCP
    • julien040/anyquery
  • mcp-server-templates

    mcp-server-templates

    Deploy Model Context Protocol servers instantly with zero configuration.

    MCP Server Templates enables rapid, zero-configuration deployment of production-ready Model Context Protocol (MCP) servers using Docker containers and a comprehensive CLI tool. It provides a library of ready-made templates for common integrations—including filesystems, GitHub, GitLab, and Zendesk—and features intelligent caching, smart tool discovery, and flexible configuration options via JSON, YAML, environment variables, or CLI. Perfect for AI developers, data scientists, and DevOps teams, it streamlines the process of setting up and managing MCP servers and has evolved into the MCP Platform for enhanced capabilities.

    • 5
    • MCP
    • Data-Everything/mcp-server-templates
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results