Skip to main content
Glama

Quickstart • Architecture Guide • API Reference • Roadmap • Citation


🧬 What is BioContext?

Biological nomenclature is notoriously messy: historical aliases, deprecated identifiers, non-standard spelling, and taxon confusions (e.g., HER2 $\rightarrow$ ERBB2, p53 $\rightarrow$ TP53, p27 $\rightarrow$ CDKN1B, Trp53 in mouse vs. TP53 in human). When LLMs or naive API wrappers directly query downstream clinical/genomic endpoints, these ambiguities cause zero-hit failures, mismatched literature, or clinical false positives.

BioContext solves this fundamentally by providing a Deterministic Entity Disambiguation and Contextual Intelligence Engine. Instead of raw pass-through search, BioContext resolves messy user inputs into canonical reference standards with explicit confidence scores, persistent caching, and explainable audit trails before traversing downstream pathways and functional annotations.


Related MCP server: GenomeMCP

✨ Key Capabilities

  • Multi-Authority Resolution Hierarchy:

    • Human Genes (HGNC Primary): Direct symbol resolution and historical alias traversal with protein-coding prioritization (e.g., HER2 $\rightarrow$ ERBB2, p16 $\rightarrow$ CDKN2A, p21 $\rightarrow$ CDKN1A).

    • NCBI Entrez Integration: Direct Entrez Gene ID lookup (7157 $\rightarrow$ TP53) and cross-species identifier translation.

    • UniProtKB Mapping: Direct accession resolution (P04637 $\rightarrow$ TP53) and protein structural metadata enrichment.

    • Ensembl Genome & Transcripts: Ensembl Gene ID resolution, transcript mapping, canonical identification, and cross-species orthology.

    • Mouse Genome Informatics (MGI): Direct MGI ID resolution (MGI:98834 $\rightarrow$ Trp53) and mouse gene models.

  • Systems Biology & Functional Intelligence:

    • Gene Ontology (QuickGO): Automated functional annotation enrichment (Molecular Functions, Biological Processes, Cellular Components) with evidence codes and ECO mappings.

    • Reactome Pathways: Systems-level mechanism mapping, hierarchical pathway structures, and pathway summations.

  • High-Throughput Batch Engine:

    • Concurrent batch resolution bounded by asyncio.Semaphore with strict rate-limiting compliance.

    • Dual output modes: Interactive terminal stdout or formatted CSV exports.

    • Auto-detecting CSV/TSV input parser.

  • Production-Grade Persistence & Reliability:

    • Embedded SQLite cache with Write-Ahead Logging (WAL) and configurable TTL to minimize latency and eliminate redundant network calls.

    • Exponential backoff, jitter, and graceful degradation for resilient uptime.

  • Zero-Hallucination Guarantee:

    • Every resolution result includes exact matching rules, confidence scores ($0.0 - 1.0$), and authoritative source citations. No imaginary biological data.

  • Model Context Protocol (MCP):

    • Native stdio server compliant with MCP 2.x for instant connection to Cursor, Antigravity IDE, Claude Desktop, Claude Code, and Goose.


🚀 Quickstart & Installation

BioContext is distributed via PyPI as biocontext-mcp.

Installation

# Using pip
pip install biocontext-mcp

# Using uv (Recommended for isolated CLI tool usage)
uv tool install biocontext-mcp

Zero-Install AI Assistant Integration (MCP)

To connect BioContext directly to Cursor, Antigravity IDE, or Claude Desktop, add the following snippet to your editor's mcpServers configuration:

{
  "mcpServers": {
    "biocontext": {
      "command": "uvx",
      "args": ["biocontext-mcp", "serve"]
    }
  }
}
  • For step-by-step setup guides across Claude Desktop, Cursor, Antigravity IDE, Claude Code, and Goose, see docs/QUICKSTART.md.

  • For containerized microservice execution, see Docker Setup:

    docker run -i --rm -v biocontext_cache:/data ghcr.io/core-lab-research/biocontext:latest

🛠️ Command-Line Interface (CLI)

BioContext includes an interactive CLI for testing, terminal research, and workflow automation:

# 1. Resolve a gene symbol, historical alias, or database ID
biocontext resolve TP53
biocontext resolve HER2       # Resolves to ERBB2 (confidence 0.95)
biocontext resolve 7157       # Entrez Gene ID
biocontext resolve P04637     # UniProtKB primary accession

# 2. Genomic disambiguation using chromosome or locus hints
biocontext resolve TP53 --chrom 17 --locus-type protein-coding

# 3. Model organism resolution (e.g. Mus musculus - taxon 10090)
biocontext resolve Trp53 --taxon 10090
biocontext mouse MGI:98834

# 4. High-throughput concurrent batch resolution
biocontext batch TP53 EGFR BRCA1 KRAS BRAF
biocontext batch --file gene_list.csv --output results.csv --concurrency 8

# 5. Functional Gene Ontology enrichment
biocontext annotate TP53 --limit 5
biocontext go GO:0006915

# 6. Reactome biological pathway retrieval
biocontext pathway TP53
biocontext pathway-info R-HSA-5357801

# 7. Local persistent cache inspection
biocontext cache stats
biocontext cache clear

🔌 Available MCP Tools

When connected via MCP, BioContext exposes 12 production-ready biological, clinical & literature tools:

MCP Tool

Signature & Parameters

Description

resolve_gene

query: str, taxon_id: int = 9606, chromosome: str = None, locus_type: str = None

Resolves symbols, aliases, Entrez IDs, UniProt accessions, or MGI IDs with contextual scoring adjustments.

batch_resolve_genes

queries: list[str], taxon_id: int = 9606, concurrency: int = 5

High-throughput concurrent resolution engine with execution metrics.

get_protein

accession: str

Retrieves structured protein metadata from UniProtKB by primary accession (e.g. P04637).

annotate_function

query: str, taxon_id: int = 9606, aspect: str = None, limit: int = 10

Fetches Gene Ontology terms with evidence codes from EMBL-EBI QuickGO.

get_go_term

go_id: str

Inspects a specific Gene Ontology term definition and aspect.

get_pathways

query: str, taxon_id: int = 9606, species: str = "Homo sapiens", limit: int = 10

Maps genes/proteins to biological pathways via Reactome.

get_pathway_details

st_id: str

Retrieves descriptive summary and metadata for a Reactome pathway.

resolve_disease

query: str, limit: int = 5

Resolves disease names, synonyms, or IDs to canonical MONDO Disease Ontology entities.

get_target_diseases

gene: str, limit: int = 10

Retrieves evidence-backed therapeutic target-disease associations from Open Targets Platform.

get_supporting_publications

query: str, limit: int = 5

Retrieves peer-reviewed supporting scientific publications and citations from Europe PMC / PubMed.

get_publication_details

identifier: str

Fetches detailed publication metadata, abstract, and citation counts by PMID, PMCID, or DOI.

get_mouse_gene

mgi_id: str

Direct lookup of mouse gene models from MGI.


📊 Empirical Accuracy Benchmark

BioContext is deterministically validated against a curated biological test suite covering human cancer drivers, clinical aliases, protein accessions, and model organisms:

uv run pytest tests/test_benchmark.py -v
  • Accuracy: 100% Pass Rate across 100 benchmark cases.

  • Test Suite: 130 passed, 5 skipped (due to external Ensembl REST service migration).

  • Multi-Layer Pipeline: End-to-end integration verified in tests/test_e2e_pipeline.py (Entity Disambiguation $\rightarrow$ QuickGO Functional Annotations $\rightarrow$ Reactome Pathways).


🗺️ Roadmap & Phase Evolution

BioContext follows a strict, data-driven evolution roadmap:

  • Phase 1 (v0.5.0 - Completed & Released): Core molecular adapters (HGNC, NCBI, UniProt, Ensembl, MGI, GO, Reactome), SQLite caching, 100 passing benchmark test cases.

  • Phase 1.5 (v0.5.1 → v0.7.0 - In Progress): Disease & clinical grounding (MONDO Disease Ontology, Open Targets Platform, PubMed / Europe PMC literature intelligence).

  • Phase 2 (v0.8.0 → v1.0.0 - Production GA): Ontological Knowledge Graph foundation, multi-hop relationship traversal, FastMCP hardening, and public REST API v1.

  • Phase 2.5 (v1.1.0 → v1.7.0 - Systematic Expansion): Ingestion of 57 curated biomedical sources across 7 functional categories (ClinVar, CTGov v2, ChEMBL, PubTator3, cBioPortal, CPIC, etc. — specified in PRD-35).

  • Phase 3 (v2.0.0 - Clinical & Translational AI): Autonomous Clinical Reasoning, automated variant pathogenicity interpretation, biomarker actionability matching, and in silico hypothesis synthesis.

Read the full roadmap at PRD/ROADMAP.md.


📚 Documentation & Developer Resources


📄 Citation

If you use BioContext in your scientific research or software workflows, please cite:

@software{nandatama2026biocontext,
  author       = {Nandatama, Engki},
  title        = {BioContext: Authoritative Biological Entity Resolution & Contextual Intelligence Framework},
  month        = sep,
  year         = 2026,
  publisher    = {Zenodo},
  version      = {v0.5.0},
  doi          = {10.5281/zenodo.23023948},
  url          = {https://doi.org/10.5281/zenodo.23023948}
}

Or reference CITATION.cff.


⚖️ License

Distributed under the Apache License, Version 2.0.

Available Tools

16 tools
annotate_functionA

Fetch Gene Ontology functional annotations (MF, BP, CC) for a gene or protein.

Args: query: Gene symbol (e.g. 'TP53'), alias, or UniProt accession (e.g. 'P04637'). taxon_id: NCBI Taxonomy ID (default: 9606 for human). aspect: Optional filter: 'molecular_function', 'biological_process', or 'cellular_component'. limit: Maximum number of annotations per aspect (default: 25).

Returns: JSON string containing the functional profile structured into MF, BP, and CC with evidence codes.

Inputs: query (required), limit, aspect, taxon_id. Returns: result

batch_resolve_genesA

Resolve a list of gene identifiers/aliases in batch with concurrency control and performance metrics.

Args: queries: List of gene symbols or aliases (e.g. ["TP53", "HER2", "EGFR", "7157", "P04637"]). taxon_id: NCBI Taxonomy ID (default: 9606 for human). concurrency: Maximum concurrent requests (default: 10).

Returns: JSON string containing the batch resolution summary, success rate, and resolved entities.

Inputs: queries (required), taxon_id, concurrency. Returns: result

build_entity_subgraphA

Construct an ontological Knowledge Subgraph centered on a biological entity (PRD-21).

Connects the seed gene across multiple biological layers:

  • Encoded proteins (UniProt)

  • Transcripts (Ensembl)

  • Reactome pathways

  • Gene Ontology terms (processes & molecular functions)

  • Disease associations with evidence scores (Open Targets)

  • Key supporting peer-reviewed publications (Europe PMC)

Args: query: Gene symbol (e.g. 'TP53', 'BRCA1', 'EGFR') or alias. taxon_id: NCBI Taxonomy ID (default: 9606 for human). include_pathways: Include Reactome pathway nodes and edges (default: True). include_go: Include Gene Ontology nodes and edges (default: True). include_diseases: Include Open Targets disease association nodes and edges (default: True). include_literature: Include Europe PMC publication nodes and edges (default: True).

Returns: JSON string representing the connected subgraph nodes, edges, weights, and provenance.

Inputs: query (required), taxon_id, include_go, include_diseases, +2 more. Returns: result

find_orthologsA

Identify corresponding orthologous genes across species via Ensembl.

Args: query: Gene symbol (e.g. TP53) or Ensembl Gene ID (e.g. ENSG00000141510). target_species: Target species (default: 'mus_musculus', 'danio_rerio', etc.). source_species: Source species (default: 'homo_sapiens').

Returns: JSON string containing list of orthologous genes with identity and relation type.

Inputs: query (required), source_species, target_species. Returns: result

get_go_termB

Fetch metadata and functional definition for a Gene Ontology (GO) term ID.

Args: go_id: Gene Ontology identifier (e.g. 'GO:0006915').

Returns: JSON string containing term name, definition, aspect, and synonyms.

Inputs: go_id (required). Returns: result

get_mouse_geneA

Resolve mouse gene details and MGI identifiers (Mus musculus).

Args: query: Mouse gene symbol (e.g. 'Trp53') or MGI ID (e.g. 'MGI:98834') or Ensembl ID.

Returns: JSON string containing the resolved mouse gene entity with MGI identifier.

Inputs: query (required). Returns: result

get_pathway_detailsA

Fetch detailed information for a Reactome pathway by its stable identifier.

Args: st_id: Reactome pathway stable ID (e.g. 'R-HSA-5357801' for Programmed Cell Death).

Returns: JSON string containing pathway name, species, summary text, and diagram availability.

Inputs: st_id (required). Returns: result

get_pathwaysB

Fetch biological pathways involving a gene or protein from Reactome.

Args: query: Gene symbol (e.g. 'TP53'), alias, or UniProt accession (e.g. 'P04637'). taxon_id: NCBI Taxonomy ID (default: 9606 for human). species: Species name (default: 'Homo sapiens'). limit: Maximum number of pathways to return (default: 20).

Returns: JSON string containing the list of pathways with names, stable IDs, and Reactome links.

Inputs: query (required), limit, species, taxon_id. Returns: result

get_protein_infoA

Fetch structured protein details from UniProt by primary accession.

Args: accession: UniProt accession ID (e.g. P04637).

Returns: JSON string containing protein name, gene, length, mass, and organism.

Inputs: accession (required). Returns: result

get_publication_detailsA

Fetch detailed metadata for a specific scientific paper by PMID, PMCID, or DOI.

Args: identifier: Publication identifier (e.g. PMID '30514107', PMCID 'PMC6280721', or DOI '10.1038/s41586-018-0774-4').

Returns: JSON string containing full paper metadata, abstract, and direct web links.

Inputs: identifier (required). Returns: result

get_supporting_publicationsA

Fetch authoritative supporting scientific literature from Europe PMC / PubMed.

Args: query: Gene symbol (e.g. 'TP53'), disease name, or scientific query string. limit: Maximum number of peer-reviewed publications to return (default: 5).

Returns: JSON string containing publication titles, journal, year, authors, abstract, and citation counts.

Inputs: query (required), limit. Returns: result

get_target_diseasesA

Fetch evidence-backed therapeutic target-disease associations from Open Targets Platform.

Args: gene: Gene symbol (e.g. 'TP53', 'BRAF', 'EGFR') or Ensembl Gene ID ('ENSG00000141510'). limit: Maximum number of top disease associations to return (default: 10).

Returns: JSON string containing associated diseases, evidence scores (0.0-1.0), and datatype evidence breakdowns.

Inputs: gene (required), limit. Returns: result

get_transcriptsB

Fetch transcripts, canonical isoform, and exon structures from Ensembl.

Args: query: Ensembl Gene ID (e.g. ENSG00000141510) or gene symbol (e.g. TP53). species: Species name (default: 'homo_sapiens' or 'mus_musculus').

Returns: JSON string containing gene coordinates and transcript variants with exon models.

Inputs: query (required), species. Returns: result

resolve_diseaseA

Resolve a disease name, synonym, or MONDO identifier against the MONDO Disease Ontology.

Args: query: Disease name (e.g. 'Li-Fraumeni syndrome', 'Breast cancer'), synonym, or ID ('MONDO:0018875'). limit: Maximum number of matches to return (default: 5).

Returns: JSON string containing the list of resolved disease entities with MONDO IDs, definitions, and cross-references.

Inputs: query (required), limit. Returns: result

resolve_geneA

Resolve an ambiguous gene symbol, alias, or accession to an authoritative entity.

Args: query: Gene symbol (e.g. TP53), alias (e.g. HER2, p53), or accession. taxon_id: NCBI Taxonomy ID (default: 9606 for human). chromosome: Optional chromosome hint for disambiguation (e.g. '17' or 'chr17'). locus_type: Optional biotype hint (e.g. 'protein-coding', 'pseudogene').

Returns: JSON string containing the resolved canonical gene entity, cross-references, and match audit trail.

Inputs: query (required), taxon_id, chromosome, locus_type. Returns: result

traverse_biological_graphA

Enumerate graph paths from a source gene to a target entity (PRD-22).

Paths follow edges drawn from curated databases; each hop reports its source database and score if the source provides one. Scores are products of source-provided weights, not probabilities. Literature edges are keyword hits and are only used when target_type is 'publication'.

Args: source_query: Origin gene symbol or alias (e.g. 'TP53'). target_query: Target identifier (e.g. 'MONDO:0005575', 'R-HSA-69563') or a whole-phrase name (e.g. 'colorectal cancer'). max_hops: Maximum edges to traverse, 1 to 6 (default: 3). min_score: Minimum product of source-provided scores, 0.0 to 1.0 (default: 0.0). target_type: Optional node type filter: gene, protein, transcript, pathway, disease, publication, go_term.

Returns: JSON string with paths, matched targets, and warnings. On invalid input, a JSON object with an 'error' field.

Inputs: source_query (required), target_query (required), max_hops, min_score, +1 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 16 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: gene resolution, protein/transcript retrieval, GO term lookup, GO annotation, pathway retrieval, disease resolution, literature search, and graph construction/traversal. The two graph tools differ in intent (build a subgraph vs. enumerate paths), and batch_resolve_genes is an explicit batch counterpart to resolve_gene. Descriptions are detailed enough to prevent misselection.

    Naming Consistency5/5

    All tool names use snake_case and follow a verb_noun pattern (e.g., get_go_term, resolve_gene, build_entity_subgraph). The consistent use of action verbs like get_, resolve_, build_, traverse_, find_, and annotate_ makes the set predictable and readable.

    Tool Count4/5

    With 16 tools, the server is slightly above the ideal 3-15 range, but the breadth of biological data sources (genes, proteins, transcripts, pathways, GO, diseases, literature, graphs) justifies each tool. No tool appears redundant or trivial.

    Completeness4/5

    The tool set covers core multi-omics retrieval, including gene/protein/transcript details, orthologs, GO annotations, pathways, disease associations, literature, and graph operations. Minor gaps exist, such as explicit sequence retrieval (FASTA) or variant-level annotation, but the surface is robust for most workflows.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      Enables AI assistants to query gene annotations, expression, pathways, variants, and more via the MyGene.info API, supporting batch operations and multiple biological data sources.
      26
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to query clinical genomics databases, retrieve supporting literature, analyze population genetics, and visualize biological pathways.
      18
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables unified access to 110 life science APIs and databases, including genomics, proteomics, chemistry, literature, and clinical data. Users can query genes, proteins, compounds, pathways, and more through natural language.
      3
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to look up molecular interactions from the EBI IntAct database by gene/protein name or UniProt ID, returning detection method, interaction type, organism, PubMed reference, and MI confidence score, along with fast interaction counts. It is keyless and available either through a hosted MCP endpoint, a plain HTTP API, or a local stdio server.
      116 npm
      MIT