pubmed-mcp-server
Provides tools for searching PubMed, fetching article metadata and full text, formatting citations, finding related articles, spell checking queries, looking up MeSH terms, resolving partial citations, and converting identifiers.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pubmed-mcp-serversearch PubMed for recent CRISPR off-target papers and cite them in APA"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Public Hosted Server: https://pubmed.caseyjhand.com/mcp
Overview
Biomedical literature from PubMed, PubMed Central, and Europe PMC. Search it, fetch metadata and full text, resolve identifiers and partial citations, format references, and ground queries in MeSH vocabulary. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
Tools
Tool | Description |
| Search PubMed with full query syntax, structured filters, date ranges, and optional summaries |
| Fetch article metadata by PMID: abstract, authors, journal, MeSH terms, grants, a collective author's investigators on request, linked retraction and correction notices |
| Fetch full text by PMID, PMCID, or DOI, falling back from PMC to Europe PMC to Unpaywall |
| Search Europe PMC for preprints, patents, Agricola, and open-access records PubMed doesn't carry |
| Fetch complete Europe PMC records, including the untruncated abstract, as |
| Format citations in APA 7th, MLA 9th, BibTeX, RIS, or Vancouver (ICMJE/NLM), with linked retraction and correction notices |
| Find similar articles, citing articles, or references for a PMID |
| Correct a misspelled PubMed query via NCBI ESpell |
| Look up MeSH headings with tree numbers, scope notes, and entry terms |
| Resolve partial references, up to 25 at a time, to PMIDs via ECitMatch |
| Convert between DOI, PMID, and PMCID via the PMC ID Converter |
Resources
Resource | Description |
| PubMed database metadata via EInfo (field list, record count, last update) |
Prompts
Prompt | Description |
| Generate a structured four-phase biomedical research plan |
Related MCP server: NCBI Literature Search MCP Server
Capability reference
pubmed_search_articles tool
Full PubMed query syntax plus filters (author, journal, MeSH, publication type, language, species, abstract, free full text) and publication/modification/Entrez date ranges
Up to 1,000 results per page and offsets up to 9,998, or
maxResults: 0for the match count alone;summaryCountadds briefs for up to 50 hitsReports
totalCount, theeffectiveQueryPubMed ran, and theappliedFiltersRejects blank filter values, impossible dates, and reversed date ranges before PubMed is called
pubmed_fetch_articles tool
Up to 200 PMIDs per call; misses are listed in
unavailablePmidsAbstract, authors, journal, DOI, publication types, linked retraction/erratum/comment notices, and links; MeSH terms on by default, grants via
includeGrants, and the members of a collective author (itsInvestigatorList, thousands on some consortium trials) viaincludeInvestigatorsA retracted, corrected, or questioned article opens with the same notice block as
pubmed_format_citations, directly under its titlerecordTypeseparates journal articles from Bookshelf chapters and books; opt-inmaxResponseCharactersdefers overflow todeferred.ids
pubmed_fetch_fulltext tool
pmcids,pmids, anddoisin any mix, up to 50 distinct identifiers per call: the first 10 are fetched and the rest returned inoverLimitfor a follow-up call. Each is tried against PMC, then Europe PMC, then Unpaywall (needsUNPAYWALL_EMAIL); an article several of them name is fetched and returned once, andviaSourcenames the tier that answeredsource: "pmc"returns sections (the body, then back matter such as acknowledgments, declarations, and appendices), tables, and figures;source: "unpaywall"returns a best-effort HTML or PDF text bodyMisses carry a typed
reasonandtriedTiers;sections,maxCharacters,overflowMode, andmaxResponseCharactersbound the response, andtruncationreports what was cut
pubmed_europepmc_search tool
Adds preprints (
PPR), patents (PAT), and Agricola (AGR) toMEDandPMC; defaults toMED,PMC,PPRCursor pagination via
cursorMark/nextCursorMark, up to 100 per page; abstracts arrive as 400-character snippetsOptional
sortof comma-separated<field> asc|desckeys;relevanceis the default order, and a sort Europe PMC cannot use fails aseuropepmc_invalid_inputNot registered when
EUROPEPMC_ENABLED=false
pubmed_europepmc_fetch tool
Up to 25 records per call as
records: [{ source, epmcId }], each pair copied from a search hit, with the full abstract; unresolved ids land innotFound; opt-inmaxResponseCharactersdefers overflow todeferred.recordsNot registered when
EUROPEPMC_ENABLED=false
pubmed_format_citations tool
Up to 50 PMIDs per call, in any mix of
apa,mla,bibtex,ris, andvancouverBookshelf records cite as edited books, each chapter dated by its own last revision or contribution date; PMIDs that can't be fetched are reported as unavailable
Retractions, errata, and expressions of concern NCBI links to an article come back as
noticesand are shown ahead of its citations; Vancouver adds aRetraction in:/Erratum in:note and APA a retraction parenthetical
pubmed_find_related tool
similar,cited_by, orreferences, up to 50 per page with offset paginationFalls back to Europe PMC, then OpenAlex, and names the provider that answered; fails as
all_providers_failedif none can
pubmed_spell_check tool
Returns
original,corrected, andhasSuggestion; corrections land in place, so field tags, operators, spacing, and gene symbols stay as writtenRun it after a zero-hit or thin search, then retry
pubmed_search_articleswithcorrected
pubmed_lookup_mesh tool
Descriptors by name or free-text term, with an exact heading match pinned first (the descriptor, for a drug-class heading); up to 50 per page, continued via
nextOffsetRecords carry their MeSH unique ID (
meshId, e.g.D000072657) beside the Entrez UID;includeDetails(default on) adds tree numbers, scope notes, and entry terms
pubmed_lookup_citation tool
Up to 25 partial citations per call; a journal or a four-digit year is required, and volume, first page, and author sharpen the match
Each is matched independently and comes back
matched,not_found, orambiguous, with recovery detail
pubmed_convert_ids tool
Up to 50 ids per call, all of one declared
idType(doi,pmid,pmcid); only PMC-indexed articles resolveOne success or error row per id, in order, so a partial batch never fails
pubmed://database/info resource
Live EInfo call for the
pubmeddatabase, returned asapplication/jsoncount,lastUpdate, andfields[], whose names are the search tagspubmed_search_articlesaccepts
research_plan prompt
Arguments:
title,goal, andkeywordsrequired;organismandincludeAgentPromptsoptionalReturns a four-phase research plan;
includeAgentPrompts: "true"adds an agent-guidance block under each of its nine sub-steps, two of which point at tools: the literature review namespubmed_search_articlesandpubmed_lookup_mesh, and the interpretation step namespubmed_search_articles
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
PubMed-specific:
NCBI E-utilities (ESearch, EFetch, ESummary, ELink, ESpell, EInfo, ECitMatch) and the PMC ID Converter, with Europe PMC, OpenAlex, and Unpaywall filling the gaps
Shared NCBI request queue: paced request starts, capped concurrency, a cooldown that holds every caller after an NCBI 429, and one deadline covering queue wait and retries
XML parsing built for PubMed's inconsistent records: structured abstracts, missing fields, varying date formats
Forgiving identifiers: a zero-padded PMID resolves as the PMID it spells in every tool that takes one;
pubmed_fetch_fulltextalso matches DOIs case-insensitively and PMC IDs with or without thePMCprefixHand-rolled citation formatters (APA, MLA, BibTeX, RIS, Vancouver) with no dependencies
Agent-friendly output:
Provenance on every response: source labels, license fields, best-effort warnings on Unpaywall results, and effective-query echo on searches, so agents can judge what to trust
Graceful partial failure: batch tools return per-item success/error rows instead of failing the request, with structured status codes and actionable next-step text
Discriminated output contracts:
source: "pmc" | "unpaywall", typedunavailablereasons,viaSourceandtriedTiersfields, so callers branch on data, not string parsing
Getting started
Public Hosted Instance
A public instance is available at https://pubmed.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"pubmed-mcp-server": {
"type": "streamable-http",
"url": "https://pubmed.caseyjhand.com/mcp"
}
}
}Self-Hosted / Local
Add the following to your MCP client configuration file.
{
"mcpServers": {
"pubmed-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/pubmed-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"NCBI_API_KEY": "your-key-here"
}
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"pubmed-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/pubmed-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"NCBI_API_KEY": "your-key-here"
}
}
}
}Or with Docker:
{
"mcpServers": {
"pubmed-mcp-server": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/pubmed-mcp-server:latest"]
}
}
}For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcpPrerequisites
Bun v1.4.0 or higher (or Node.js v24+).
Optional: an NCBI API key raises the rate limit from 3 to 10 requests per second.
Installation
Clone the repository:
git clone https://github.com/cyanheads/pubmed-mcp-server.gitNavigate into the directory:
cd pubmed-mcp-serverInstall dependencies:
bun installConfigure environment:
cp .env.example .env
# edit .env and set NCBI_API_KEY, NCBI_ADMIN_EMAIL, and UNPAYWALL_EMAIL as neededConfiguration
Variable | Description | Default |
| NCBI API key; raises the rate limit from 3 to 10 req/s. | none |
| Contact email sent with NCBI requests, as NCBI recommends. | none |
| Minimum gap between NCBI request starts, in ms. |
|
| Max concurrent in-flight NCBI requests. |
|
| Retry attempts for failed NCBI requests. |
|
| Per-request HTTP timeout, in ms. |
|
| Deadline for one NCBI call across queue wait, retries, and backoff, in ms. A call that can't start in time is rejected at once. |
|
| Contact email for Unpaywall. Setting it enables the Unpaywall tier of | none |
| Per-request timeout for Unpaywall lookups and content fetches, in ms. |
|
| Set |
|
| Optional contact email sent with Europe PMC requests. | none |
| Minimum gap between Europe PMC request starts, in ms. |
|
| Retry attempts for failed Europe PMC requests. |
|
| Per-request timeout for Europe PMC calls, in ms. |
|
| Transport: |
|
| HTTP server port. |
|
| HTTP session mode: |
|
| Authentication: |
|
| Log level ( |
|
| Directory for log files (Node.js only). |
|
| Storage backend: |
|
| Enable OpenTelemetry. |
|
See .env.example for every server setting and the common framework overrides.
Running the server
Local development
Build and run the production version:
# One-time build bun run rebuild # Run the built server bun run start:http # or bun run start:stdioRun checks and tests:
bun run devcheck # Lints, formats, type-checks, and more bun run test # Runs the test suite
Project structure
Directory | Purpose |
| Tool definitions ( |
| Resource definitions. Database info resource. |
| Prompt definitions. Research plan prompt. |
| NCBI E-utilities service layer — API client, queue, parser, formatter. |
| Europe PMC service — search + |
| Unpaywall service — DOI → OA location resolution and content fetch (HTML/PDF). |
| OpenAlex service — last-resort provider for |
| Server-specific environment variable parsing and validation with Zod. |
| Unit and integration tests, mirroring the |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor logging,ctx.statefor storageRegister new tools and resources in the
createApp()arrays insrc/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Search PubMed/Europe PMC, fetch articles and full text (PMC/EPMC/Unpaywall), citations, MeSH terms.
Search biomedical literature, get article details, find related articles, and explore MeSH terms
Search biomedical papers, inspect publication records, and traverse citation or semantic graphs.
Search 36M+ PubMed biomedical articles and ClinicalTrials.gov studies.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to search and retrieve biomedical research articles from PubMed's database of over 35 million citations, including metadata, abstracts, MeSH terms, and full-text PDFs when available.11MIT
- FlicenseNot gradedqualityDmaintenanceProvides seamless access to over 35 million PubMed scientific articles through natural language queries for research discovery and analysis. It enables tools for advanced searches, retrieving article details, and exploring related research within the life sciences and biomedical fields.13-
- AlicenseAqualityDmaintenanceEnables AI agents to search and read PubMed academic literature directly, without requiring an NCBI API key.21MIT
- AlicenseAqualityDmaintenanceEnables searching and fetching articles from PubMed, a database of biomedical literature.1MIT