PubMed MCP Server: AI Search, Access, Analysis
Enable AI assistants to search, access, and analyze PubMed articles with the MCP server for fast, simple AI-driven literature retrieval and analysis.
npx -y @JackKuo666/PubMed-MCP-ServerOverview
The PubMed MCP Server provides an MCP (Model Context Protocol)–compatible backend that enables AI assistants to search, retrieve, and analyze PubMed literature programmatically. It wraps PubMed/E-utilities (or other public biomedical indexes) into a small HTTP service that exposes a set of compact tools AI models can call to perform literature discovery tasks without the model needing to know PubMed APIs directly.
This server is useful when building assistants, chatbots, or pipelines that require fast access to biomedical abstracts, metadata, and simple analytic operations (summaries, citation extraction, evidence snippets). By exposing a consistent, tool-oriented API, the PubMed MCP Server makes it straightforward to integrate literature retrieval into MCP-compatible agents and to limit the information returned to the model for safer, more controlled context construction.
Features
- Expose PubMed search and fetch operations as MCP-compatible tool endpoints
- Return structured article metadata (PMID, title, authors, journal, DOI, abstract)
- Simple summarization and excerpting utilities for abstracts and results
- Support for pagination, filters (date, author, journal), and relevance sorting
- Optional API key configuration for NCBI/E-utilities
- Lightweight server intended for local or containerized deployment
- Designed for easy integration with AI agents and pipelines
GitHub: https://github.com/JackKuo666/PubMed-MCP-Server
Installation / Configuration
Clone the repository and run the server. The example assumes a Node.js implementation; adjust commands if your environment uses a different runtime.
# clone
# install dependencies (Node.js example)
# configure environment variables
# Optional: get an NCBI API key to increase rate limits
# start server
Alternatively, run with Docker:
Configuration options (typical environment variables):
- PORT — HTTP port to listen on (default: 8080)
- NCBI_API_KEY — optional NCBI E-utilities API key
- MAX_RESULTS — max results per search page
Available Tools / Resources
The server exposes a small set of HTTP endpoints that map to discrete MCP tools. Below is a representative table; refer to the server’s /openapi or /tools endpoint for the live tool list.
| Endpoint | Method | Query / Body | Purpose |
|---|---|---|---|
| /search | GET | q, page, size, sort, from, to | Search PubMed and return a list of matching PMIDs and brief metadata |
| /fetch | GET | pmid | Fetch detailed metadata and abstract for a given PMID |
| /summary | POST | { pmids: [], max_sentences } | Produce concise summaries for one or more articles |
| /extract | POST | { pmid, sections } | Extract specific sections or evidence snippets (e.g., methods, results) |
| /tools | GET | — | List available MCP-compatible tool descriptors (for agents) |
Simple example: search for COVID-19 vaccine studies
Fetch a single article by PMID
The /tools endpoint typically returns JSON tool manifests suitable for MCP clients.
Use Cases
- AI Research Assistant: Let an MCP-compatible assistant call /search to find recent studies, then /fetch and /summary to present a concise, referenced answer with PMIDs and short evidence snippets.
- Rapid Literature Triage: Use the server in screening pipelines to fetch abstracts for batches of PMIDs, apply minimal summarization, and prioritize articles for human review.
- Systematic Review Support: Automate retrieval of metadata and abstracts for extracted PMIDs; feed summaries into human-in-the-loop selection.
- Monitoring & Alerts: Periodically run targeted searches (author, keyword, date window) and send summarized digests when new relevant articles appear.
- Evidence Extraction for Clinical QA: Extract results or methods snippets from fetched abstracts to surface supporting text for model-generated claims.
Integration tips
- Rate limiting: If you expect many requests, obtain an NCBI API key and add server-side caching to avoid repeated calls for the same PMIDs.
- Privacy & provenance: Always attach PMIDs, titles, and source links to AI outputs so users can verify the original literature.
- MCP compatibility: Use the /tools manifest to let agents discover tool signatures dynamically; wrap each endpoint as an atomic tool (search, fetch, summarize). Provide clear schemas for inputs and outputs to reduce hallucination risk.
Troubleshooting
- No results: Verify your query encoding, date filters, and that the NCBI service is reachable.
- Rate limit errors: Add NCBI_API_KEY or implement retry/backoff.
- Missing full text: PubMed may not host full text; fetch returns abstracts and links to publishers or PubMed Central when available.
For the latest documentation, examples, and source code, see the project repository: https://github.com/JackKuo666/PubMed-MCP-Server.