Skip to main content

Model Context Protocol server for PubMed — search, fetch, related-articles, and author lookup against NCBI E-utilities. No API key required.

Project description

pubmed-mcp

A small, focused Model Context Protocol server that exposes NCBI PubMed as MCP tools, so any MCP-compatible client (Claude Desktop, Claude Code, custom agents) can search the literature, fetch abstracts, walk the citation graph, and look up an author's publications without leaving the chat.

No API key required. An optional NCBI_API_KEY raises the rate limit from 3 → 10 requests/sec.

Tools

Tool What it does
search_pubmed(query, max_results, sort) Free-text or full-syntax PubMed query. Returns title, authors, journal, pubdate, DOI, PubMed URL.
fetch_article(pmid) Full abstract for one PMID, with section labels preserved (Background / Methods / Results / Conclusions).
find_related(pmid, max_results) NCBI's "related articles" neighbors — walk the citation graph from any paper.
search_by_author(author, max_results, sort) Author publication list using the [au] field qualifier.

All tools are read-only; PubMed itself is read-only.

Install

pip install ryogena-pubmed-mcp

Or from source:

git clone https://github.com/KyleVick4/pubmed-mcp
cd pubmed-mcp
pip install -e .

Configure in Claude Desktop

Edit your claude_desktop_config.json:

{
  "mcpServers": {
    "pubmed": {
      "command": "python",
      "args": ["-m", "pubmed_mcp"],
      "env": {
        "NCBI_API_KEY": "<optional>",
        "NCBI_EMAIL":   "<optional, recommended by NCBI>"
      }
    }
  }
}

Restart Claude Desktop. The pubmed server should show up in the MCP panel with four tools.

Configure in Claude Code

claude mcp add pubmed -- python -m pubmed_mcp

Try it

Once wired up:

Find me the three most-cited papers on JAK2 V617F selectivity from 2023, then pull the abstract of the top hit.

Claude will plan a search_pubmedfetch_article chain and cite each paper with its DOI and PubMed URL.

Verify the server before debugging your client

Use the MCP Inspector — it's the fastest way to see if the server starts cleanly and the tools register:

npx @modelcontextprotocol/inspector python -m pubmed_mcp

Run the tests

The test suite is hermetic — no NCBI requests, no network. Every HTTP call is intercepted by httpx.MockTransport.

pip install -e ".[dev]"
pytest -v

Why this exists

I built Pico, a closed-source AI-native drug discovery platform, with its own MCP server that exposes molecule and assay tools to Claude Desktop. Building pubmed-mcp in the open lets me share the integration patterns I use — slim LLM-friendly projections, hermetic test design, error-envelope contracts — without exposing the domain code.

If you're building an MCP server and want a tiny reference, the server.py and tests/test_tools.py files together are about 500 lines and demonstrate the full pattern.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ryogena_pubmed_mcp-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ryogena_pubmed_mcp-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file ryogena_pubmed_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: ryogena_pubmed_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for ryogena_pubmed_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 96d53b0f73615d9a6d96cb07129ebf768bfd7ae6c1c60f4c49e6212e84823856
MD5 076b8b585897f4066d91c0d33637c2f2
BLAKE2b-256 d40bde3443bec3507b8ee49b0f83d9a7588a240bea9d0117fc092c9261e1d704

See more details on using hashes here.

File details

Details for the file ryogena_pubmed_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ryogena_pubmed_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8aee1ce750cfa4fcc26a6066216b05620b6b0ecc9b97f1b109b283bb582da9bc
MD5 6982fca31a5b8c7a340cb0209ab1e510
BLAKE2b-256 da179aba17891f4848338ec6b82a4e2c6570b6311c7690c0bda00b948e614407

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page