BI

BioMCP MCP Server: PubMed, ClinicalTrials, MyVariant

Access the MCP server to search PubMed, ClinicalTrials.gov, and MyVariant.info for biomedical research insights.

Quick Install
npx -y @genomoncology/biomcp

Overview

The BioMCP MCP Server exposes biomedical search and annotation services through the Model Context Protocol (MCP). It aggregates three commonly used biomedical data sources — PubMed (literature), ClinicalTrials.gov (trials), and MyVariant.info (variant annotations) — and presents results in a consistent, machine-friendly MCP JSON format. This makes it easier to incorporate authoritative biomedical context into downstream applications such as retrieval-augmented generation, evidence citation layers, dashboards, and analysis pipelines.

For developers, the server simplifies access to multiple APIs behind a single interface and normalizes their outputs so LLMs, search clients, or indexing components can consume them consistently. The server is lightweight, can be hosted locally or in a container, and supports optional API keys and simple caching to reduce downstream rate limiting and latency.

Features

  • Unified REST API that proxies PubMed, ClinicalTrials.gov, and MyVariant.info
  • MCP-compliant JSON responses (metadata + content fragments suitable for context windows)
  • Optional caching to reduce rate limits and improve performance
  • Simple configuration via environment variables or Docker
  • Endpoints for text-based search and identifier-based lookup
  • Designed to integrate with RAG pipelines, search layers, or clinical/variant tools

Installation / Configuration

Clone and run locally (Python/uvicorn example)

git clone https://github.com/genomoncology/biomcp.git
cd biomcp
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# run (example)
uvicorn biomcp.app:app --host 0.0.0.0 --port 8080

Docker (build + run)

docker build -t biomcp .
docker run -p 8080:8080 \
  -e NCBI_API_KEY=your_ncbi_api_key \
  -e CACHE_TTL=3600 \
  biomcp

Common environment variables

  • NCBI_API_KEY — optional NCBI/Entrez API key to increase PubMed throughput
  • CACHE_TTL — integer seconds to cache API responses (default 0 = no cache)
  • HOST — bind address (default: 0.0.0.0)
  • PORT — port to listen on (default: 8080)
  • MYVARIANT_BASE — override MyVariant.info base URL (optional)

If you expect heavy usage, provide an NCBI API key and configure a cache backend (Redis) where supported.

Available Resources

The server exposes simple endpoints to perform searches and lookups. Example endpoints:

PathMethodDescriptionImportant query params
/mcp/searchGETSearch across a single sourcesource (pubmed
/mcp/lookupGETLookup by identifiersource, id
/mcp/healthGETServer health check

Example: search PubMed for a phrase

curl 'http://localhost:8080/mcp/search?source=pubmed&q=egfr+lung+cancer' \
  -H 'Accept: application/json'

Example: lookup a variant in MyVariant.info

curl 'http://localhost:8080/mcp/lookup?source=myvariant&id=chr7:g.140453136A>T' \
  -H 'Accept: application/json'

Response format

  • The API returns MCP-style JSON objects. Each result includes:
    • id: stable identifier (e.g., PubMed ID, NCT number, variant ID)
    • title / snippet: short human-readable headline
    • text: longer textual fragment suitable for model context
    • metadata: source-specific fields (authors, journal, dates, variants annotations)
    • provenance: URL and raw API source reference

A minimal example result (abridged):

{
  "id": "PMID:12345678",
  "title": "EGFR mutations in lung cancer",
  "text": "Abstract text or clinical trial summary...",
  "metadata": {
    "authors": ["A. Smith", "B. Jones"],
    "journal": "Clin Oncol",
    "published": "2020-03-15"
  },
  "provenance": {
    "source": "pubmed",
    "url": "https://pubmed.ncbi.nlm.nih.gov/12345678"
  }
}

Use Cases

  • Literature retrieval for RAG workflows: Query PubMed through the MCP server to collect succinct abstracts and metadata, then feed those fragments as context to an LLM for evidence-supported answers.
  • Clinical trial discovery: Search ClinicalTrials.gov for trials matching disease names, biomarkers, or interventions and include trial summaries and recruitment statuses in downstream applications.
  • Variant annotation: Use MyVariant.info lookups to retrieve aggregated variant annotations (clinically significant predictions, allele frequencies, gene context) and incorporate the normalized annotations into variant interpretation pipelines.
  • Multisource citation assembly: Combine PubMed abstracts, trial summaries, and variant annotations to produce consolidated, MCP-formatted context blocks for clinical decision support or research summaries.
  • Indexing and vectorization: Use the consistent MCP JSON output to build an indexing pipeline that stores text fragments and metadata into a vector database for semantic search.

Notes and best practices

  • Be mindful of upstream API rate limits (NCBI Entrez and ClinicalTrials endpoints); configure an API key and caching where available.
  • Normalize search queries (escape special characters) and paginate large result sets.
  • Inspect provenance fields before surfacing results in clinical contexts; always display original sources and identifiers for traceability.

For additional examples and advanced configuration, consult the repository README and example clients in the project.

Tags:search