Skip to main content
Glama

biolit-mcp

An MCP server that keeps LLMs honest about biomedical literature and proteins.

Ask a language model for "three papers on base editing" and it often gives you PMIDs that do not exist, or real PMIDs attached to the wrong titles. Ask it for the length of a protein it has rarely seen and it will guess. biolit-mcp gives any MCP client (Claude Desktop, Claude Code, Cursor, your own agent) five tools that look the answers up in PubMed and UniProt, plus a deterministic citation checker. It also ships with an eval suite that measures how much the tools actually reduce hallucination.

flowchart LR
    A[LLM / agent] -- MCP --> S[biolit-mcp]
    S --> P[pubmed_search<br/>pubmed_fetch]
    S --> U[uniprot_search<br/>uniprot_entry]
    S --> V[verify_references]
    P & V --> E[(NCBI E-utilities)]
    U --> R[(UniProt REST)]
    S -. rate limit, retry, SQLite cache .- E & R

Tools

Tool

What it does

pubmed_search

PubMed search with year filters and sort. Returns PMID, title, journal, year, DOI, and PubMed's own query translation.

pubmed_fetch

Full records for up to 20 PMIDs: abstract (structured sections kept), authors, MeSH terms, DOI. Long abstracts are cut and flagged.

uniprot_search

UniProtKB search by gene or protein name, filtered by organism and Swiss-Prot status.

uniprot_entry

One entry: names, genes, organism, length, mass, function, subcellular location, GO terms; sequence on request.

verify_references

Checks a list of citations (PMID, DOI or title). Each gets a status: verified, found_by_title, title_mismatch, not_found or unverifiable. No model is involved in this check.

The server also sends instructions to the client telling the model to verify every citation before showing it and to read protein facts from uniprot_entry instead of memory.

Related MCP server: ColabAI MCP Server

Quick start

pip install git+https://github.com/pzx1253342437-dot/biolit-mcp

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "biolit": {
      "command": "biolit-mcp",
      "env": { "NCBI_API_KEY": "optional", "NCBI_EMAIL": "you@example.org" }
    }
  }
}

Claude Code:

claude mcp add biolit -- biolit-mcp

Run biolit-mcp --http to serve streamable HTTP instead of stdio.

Variable

Default

Purpose

NCBI_API_KEY

none

Raises the NCBI limit from 3 to 10 requests/s

NCBI_EMAIL

none

Sent to NCBI as contact info, as their usage policy asks

BIOLIT_CACHE

1

Set to 0 to disable the on-disk cache

BIOLIT_CACHE_DIR

~/.cache/biolit-mcp

Cache location

Evaluation

evals/ compares the same model with and without the tools on two task sets:

  • Citations (20 topics): "List 3 PubMed papers about X, with PMID and title." Every claimed citation is checked against PubMed. Metrics: share of valid citations, nonexistent PMIDs, and PMIDs that point to a different paper.

  • Proteins (10 well-known accessions + N random Swiss-Prot entries from less-studied organisms): "Give gene name, organism and sequence length for accession X." The gold answer is fetched live from UniProt at eval time, so the dataset never goes stale.

Token use, tool calls and latency are recorded per task, so the accuracy gain can be weighed against cost.

pip install -e ".[eval]"
export ANTHROPIC_API_KEY=...
python -m evals.run --model claude-sonnet-5-5 --obscure 10

Each run writes the raw transcript scores to evals/results/*.json and a summary table to evals/results/*.md.

Results

Not run yet. The table below is filled in from evals/results/ after the first run.

condition

citations valid

nonexistent PMIDs

PMID points to other paper

length exact (famous)

length exact (obscure)

gene correct

tokens / task

latency / task

baseline

tools

Engineering notes

  • Rate limiting follows NCBI policy (3 req/s, or 10 with an API key) using an async limiter.

  • Retries use exponential backoff with jitter on 429/5xx and transport errors, and honour Retry-After. 400/404 are not retried.

  • Caching: a SQLite TTL cache (1 day for searches, 7 days for records). API keys are excluded from cache keys.

  • Errors the model can act on: bad input and upstream outages come back as MCP tool errors with a short instruction ("use uniprot_search to find one"), so the agent can recover.

  • Context budget: abstracts and function text are truncated with an explicit flag; sequences are only returned on request.

See DESIGN.md for the reasoning behind these choices and the known limits.

Development

pip install -e ".[dev]"
pytest                   # offline: HTTP is mocked with recorded-format fixtures
BIOLIT_LIVE=1 pytest     # also hit the real NCBI and UniProt APIs
ruff check . && ruff format --check .

The offline suite covers parsing, retries, rate limiting, caching, every verification status, the MCP tool layer, a real stdio session, and the eval harness (with a scripted model).

Limitations

  • The citation check confirms that a paper exists and that the title matches. It does not judge whether the paper supports the claim it is cited for.

  • Title matching uses a fuzzy threshold (85/100). Very short titles or heavy rewording can be misjudged.

  • Only PubMed and UniProtKB are covered. Preprints that are not in PubMed will show as not_found.

License

MIT

Available Tools

5 tools
pubmed_fetchA

Fetch full records (abstract, authors, journal, DOI, MeSH terms) for up to 20 PMIDs.

Abstracts longer than max_abstract_chars are cut and flagged, to protect the context window. PMIDs that do not exist are left out of the result.

Inputs: pmids (required), max_abstract_chars. Returns: result

uniprot_entryA

Get one UniProtKB entry: names, genes, organism, length, mass, function, subcellular location and GO terms. The sequence is only included on request.

Inputs: accession (required), include_sequence. Returns: url, genes, length, mass_da, +10 more

verify_referencesA

Check that citations point to real PubMed records and that the titles match.

Status per reference: verified, found_by_title, title_mismatch (the ID exists but is a different paper), not_found, or unverifiable. Run this on every reference before showing it to the user, and drop or fix anything that is not verified.

Inputs: references (required). Returns: checked, results, problems, verified

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool maps to a distinct resource+action: discovering papers by query (pubmed_search), retrieving records by PMID (pubmed_fetch), validating citations (verify_references), and UniProt lookup by query or accession. verify_references touches the same PMID space as pubmed_fetch but its output (status per reference) makes its purpose clearly separate.

    Naming Consistency4/5

    Four tools use a predictable source_action pattern (pubmed_search, pubmed_fetch, uniprot_search, uniprot_entry), which is easy to scan. Minor deviations: verify_references drops the source prefix, and uniprot_entry uses a noun where its sibling uses a verb (compare uniprot_search).

    Tool Count5/5

    Five tools is tightly scoped for a literature+protein lookup server: two per data source plus a cross-cutting verification step. Nothing appears redundant and no obvious operation is missing that would need its own tool.

    Completeness4/5

    The surface covers the core lifecycle for both domains: search and fetch for PubMed, plus a citation-integrity check, and search plus detailed entry for UniProt. Gaps are minor, e.g. no pagination/cursor control for large result sets, no batch or ID-mapping tool across PubMed<->UniProt, and no full-text retrieval.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      A high-performance MCP server that gives LLMs access to 25 biomedical tools federated across 50+ upstream APIs for genes, variants, drugs, diseases, literature, clinical trials, and structural biology.
      43
      153 npm
      12
      Apache 2.0
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents and LLM tools to verify academic citations against real literature, detect hallucinated references, retrieve authoritative metadata and DOIs, generate BibTeX/APA/IEEE citations, and search over 200M+ scientific publications via MCP tools.
      3
      23 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables searching PubMed and Europe PMC, fetching article metadata and full text via PMC/Europe PMC/Unpaywall, formatting citations, resolving partial references and identifiers, and grounding queries in MeSH vocabulary. Runs over stdio or Streamable HTTP, exposing these biomedical literature capabilities as MCP tools, a resource, and a prompt.
      9 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables searching PubMed and Europe PMC, fetching article metadata and full text via PMC, Europe PMC, or Unpaywall, resolving citations and identifiers, and looking up MeSH terms through MCP. Runs over STDIO or Streamable HTTP with 11 tools, 1 resource, and 1 prompt.
      9 npm
      MIT