Skip to main content
Glama

pubmed-mcp

An MCP server for medical and biomedical literature research — 17 tools covering PubMed, Europe PMC, full-text retrieval, MeSH, citations, clinical trials, Semantic Scholar, OpenFDA and DrugBank.

One file, deps: FastMCP + httpx only. Works out of the box — all API keys are optional (they raise rate limits and enable a couple of extras). Read-only: it never writes to upstream services.

17 tools · optional API keys · read-only · works with any MCP client (Claude Desktop, Claude Code, Cursor, Windsurf, Hermes, ...).

The server itself is a single Python file: server.py — everything else in this repo is documentation, packaging and tests.

What it gives your assistant

#

Tool

Source

What it does

1

pubmed_search

PubMed

Search with year / free-fulltext / abstract filters

2

pubmed_fetch

PubMed

Full metadata by PMID (abstract, authors, DOI, grants)

3

pubmed_summary

PubMed

Fast summaries for many PMIDs at once

4

pubmed_find_related

PubMed

Similar / citing / reference articles

5

pubmed_citation_search

PubMed

Partial citation → PMID resolution

6

pubmed_europepmc_search

Europe PMC

Broader corpus: preprints, patents, Agricola

7

pubmed_spell_check

NCBI ESpell

Medical and biomedical query spell check

8

pubmed_lookup_mesh

MeSH

Medical Subject Headings vocabulary

9

pubmed_convert_ids

PMC ID Converter

DOI ↔ PMID ↔ PMCID conversion

10

pubmed_fetch_fulltext

PMC / Europe PMC / Unpaywall

Full text as structured sections

11

pubmed_format_citations

Local

APA, MLA, BibTeX, RIS, Vancouver

12

pubmed_clinical_trials

ClinicalTrials.gov

Search studies by condition / drug / status

13

pubmed_semantic_scholar

Semantic Scholar

Citation counts, influence, OA PDF links

14

openfda_adverse_events

FDA FAERS

Drug side-effect reports

15

openfda_drug_label

FDA labels

Indications, warnings, mechanism, PK

16

openfda_drug_enforcement

FDA

Recalls and market withdrawals

17

drugbank_search

DrugBank

Drug targets / interactions (needs free key)

Related MCP server: pubmed-evidence

Quick start

No installation needed — run it straight from GitHub with uv:

uvx --from git+https://github.com/BerkayCelk/pubmed-mcp pubmed-mcp

or from a clone:

pip install -r requirements.txt
python server.py

Client setup

Claude Desktop — merge into claude_desktop_config.json:

{
  "mcpServers": {
    "pubmed": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/BerkayCelk/pubmed-mcp", "pubmed-mcp"]
    }
  }
}

Claude Code:

claude mcp add pubmed -- uvx --from git+https://github.com/BerkayCelk/pubmed-mcp pubmed-mcp

Cursor (~/.cursor/mcp.json) and Windsurf: same JSON shape as Claude Desktop. Hermes: add to your config.yaml under mcp_servers (see examples/hermes_config.yaml).

Ready-made config files live in examples/.

For AI agents (automated setup)

Written so an AI coding agent (Claude Code, Codex, Cursor, Hermes, ...) can install and verify this server on its own.

1. Install command (no clone needed):

uvx --from git+https://github.com/BerkayCelk/pubmed-mcp pubmed-mcp

2. Register with a client:

  • Claude Code:

    claude mcp add pubmed -- uvx --from git+https://github.com/BerkayCelk/pubmed-mcp pubmed-mcp
  • Claude Desktop — merge into claude_desktop_config.json (~/Library/Application Support/Claude/ on macOS, %APPDATA%\Claude\ on Windows, ~/.config/Claude/ on Linux):

    {"mcpServers": {"pubmed": {"command": "uvx", "args": ["--from", "git+https://github.com/BerkayCelk/pubmed-mcp", "pubmed-mcp"]}}}
  • Cursor — same JSON in ~/.cursor/mcp.json (project scope: .cursor/mcp.json).

  • Hermes — see examples/hermes_config.yaml.

  • Any other MCP client — register this stdio command: uvx --from git+https://github.com/BerkayCelk/pubmed-mcp pubmed-mcp

3. Verify (no client needed):

printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"probe","version":"0"}}}' | uvx --from git+https://github.com/BerkayCelk/pubmed-mcp pubmed-mcp | head -c 400

Expect JSON containing "serverInfo":{"name":"PubMed".

4. Usage notes for agents:

  • Literature questions -> pubmed_search, then pubmed_fetch / pubmed_summary for the hits; use pubmed_europepmc_search for preprints and grey literature.

  • Full text -> pubmed_fetch_fulltext (chain: PMC → Europe PMC → Unpaywall; set UNPAYWALL_EMAIL to enable the last step).

  • Drug safety -> openfda_* tools (no key needed); drugbank_search requires a free DRUGBANK_API_KEY.

  • Batch PMIDs whenever possible (up to 50 per call) and don't remove the built-in throttles — these are shared public APIs.

5. Copy-paste prompt for users:

Set up the PubMed MCP server for me: register uvx --from git+https://github.com/BerkayCelk/pubmed-mcp pubmed-mcp as a stdio MCP server named pubmed in my client config, restart/reload the client, then verify by calling the pubmed_search tool with a small test query.

Optional API keys

Everything works without keys. Keys only raise rate limits or enable extras:

Env var

Effect

Where to get it

NCBI_API_KEY

3 → 10 requests/sec on NCBI

https://www.ncbi.nlm.nih.gov/account/settings/

UNPAYWALL_EMAIL

Enables the Unpaywall fallback in pubmed_fetch_fulltext (any email works)

—

S2_API_KEY

Relaxes Semantic Scholar rate limits

https://www.semanticscholar.org/product/api

EUROPEPMC_EMAIL

Polite-pool identifier for Europe PMC

—

DRUGBANK_API_KEY

Enables drugbank_search

https://go.drugbank.com

Full text chain & rate limits

pubmed_fetch_fulltext tries, in order: NCBI PMC → Europe PMC → Unpaywall, returning structured sections (Introduction, Methods, Results, ...) when available.

The server throttles itself: 0.35 s between NCBI calls (0.1 s with a key) and 3 s for Semantic Scholar. This wraps shared public APIs — please keep the throttles. Data sources: NCBI, Europe PMC, OpenFDA, ClinicalTrials.gov, Semantic Scholar, Unpaywall, DrugBank.

Development

  • Run from a clone: uv run --with fastmcp --with httpx python server.py

  • Smoke test (spawns the server over stdio, a few live calls — keep it gentle): uv run --with fastmcp --with httpx python smoke_test.py

  • Packaging check: uv build

Disclaimer

Unofficial community project — not affiliated with or endorsed by NCBI/NLM, Europe PMC, the FDA, ClinicalTrials.gov, Semantic Scholar, OurResearch, or DrugBank. For research assistance only; not medical advice.

License

MIT — see LICENSE.

Available Tools

17 tools
openfda_adverse_eventsOpenfda Adverse EventsB

Query FDA Adverse Event Reporting System (FAERS) for drug side effects.

Inputs: drug_name (required), limit. Returns: object

openfda_drug_enforcementOpenfda Drug EnforcementC

Query FDA enforcement reports (recalls, warnings, market withdrawals).

Inputs: limit, drug_name. Returns: object

openfda_drug_labelOpenfda Drug LabelC

Get FDA drug label information: indications, warnings, dosage, mechanism.

Inputs: drug_name (required). Returns: object

pubmed_clinical_trialsPubmed Clinical TrialsC

Search ClinicalTrials.gov for clinical studies.

Inputs: status, condition, max_results, intervention. Returns: object

pubmed_convert_idsPubmed Convert IdsA

Convert between DOI, PMID, and PMCID. Only resolves articles indexed in PubMed Central.

Inputs: ids (required), input_type. Returns: object

pubmed_fetchPubmed FetchA

Fetch detailed article metadata by PubMed IDs.

Inputs: pmids (required), include_mesh. Returns: object

pubmed_fetch_fulltextPubmed Fetch FulltextB

Fetch full-text articles via PMC → Europe PMC → Unpaywall chain.

Inputs: pmids (required), max_sections, sections_filter. Returns: object

pubmed_format_citationsPubmed Format CitationsC

Generate formatted citations for articles.

Inputs: pmids (required), style. Returns: object

pubmed_lookup_meshPubmed Lookup MeshB

Search and explore MeSH (Medical Subject Headings) vocabulary.

Inputs: term (required), max_results. Returns: object

pubmed_semantic_scholarPubmed Semantic ScholarA

Search or analyze papers via Semantic Scholar API (citations, influence, references).

Use search_mode='search' for keyword search, or 'paper' with paper_id (DOI, PMID prefixed with 'PMID:', or Semantic Scholar ID) for deep analysis.

Inputs: query, paper_id, max_results, search_mode. Returns: object

pubmed_spell_checkPubmed Spell CheckA

Spell-check a biomedical query using NCBI's ESpell service. Useful for query refinement before searching.

Inputs: query (required). Returns: object

pubmed_summaryPubmed SummaryA

Get concise summaries of articles — faster than pubmed_fetch. Up to 50 PMIDs per request.

Inputs: pmids (required). Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 17 tools

    Disambiguation5/5

    Each tool targets a distinct source, action, or resource: search vs. summary vs. fetch vs. full-text vs. citation matching vs. ID conversion, with separate tools for Europe PMC, ClinicalTrials.gov, Semantic Scholar, FDA, and DrugBank. Overlaps are minimal and well-clarified by descriptions.

    Naming Consistency4/5

    All names use snake_case with a source prefix (pubmed_, openfda_, drugbank_), which is predictable. However, the pubmed_ group mostly follows verb_noun while openfda_ tools use noun phrases, a minor deviation.

    Tool Count4/5

    17 tools is slightly above the ideal 3–15 range but reasonable for a broad biomedical literature and drug information server spanning multiple APIs and workflows. Each tool appears to earn its place.

    Completeness5/5

    The surface covers the full literature research lifecycle: query refinement, search across multiple databases, summaries, metadata, full text, citation resolution, ID conversion, formatting, related articles, MeSH lookup, clinical trials, and drug safety/label data. No obvious gaps for the stated domain.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables comprehensive biomedical literature research through PubMed database access with advanced search, full-text retrieval, citation analysis, and batch processing capabilities. Supports both local deployment and cloud hosting for seamless integration with AI assistants.
      1
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables searching biomedical literature across PubMed, PubMed Central, and Europe PMC, fetching article metadata and full text, resolving citations and identifiers, and grounding queries in MeSH vocabulary. Runs over stdio or Streamable HTTP, exposing 11 tools, a database-info resource, and a research-plan prompt.
      9 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables searching PubMed, PubMed Central, and Europe PMC and fetching article metadata, full text, citations, related works, MeSH terms, and identifier conversions. Runs over STDIO or Streamable HTTP and exposes 11 tools, a database info resource, and a research-planning prompt.
      9 npm
      MIT