Skip to main content
Glama

pubmed-mcp

Polski

MCP server exposing NCBI PubMed/PMC APIs: E-utilities (search, summaries, full records, links, database info, spelling, citation matching), BioC full text, the Literature Citation Exporter, and the PMC ID Converter.

Table of contents

Related MCP server: mcp-pubmed

Tools

Tool

Parameters

Description

search_pubmed

term: str, db: str = "pubmed", retmax: int = 20, retstart: int = 0, sort: Optional[str] = None, mindate: Optional[str] = None, maxdate: Optional[str] = None, datetype: Optional[str] = None

ESearch — matching UIDs and total count

get_summaries

db: str, ids: str, select: str = "*"

ESummary — document metadata for a list of UIDs

fetch_records

db: str, ids: str, rettype: str, retmode: "xml"|"text" = "text", max_chars: int = 20000

EFetch — full records (abstracts, FASTA, GenBank, etc.)

find_related_links

ids: str, dbfrom: str = "pubmed", db: str = "pubmed", linkname: Optional[str] = None, cmd: str = "neighbor"

ELink — related/cross-referenced records

get_database_info

db: Optional[str] = None

EInfo — list of Entrez databases, or fields/links for one database

global_query_counts

term: str

EGQuery — result counts across all Entrez databases

spelling_suggestions

db: str, term: str

ESpell — spelling-corrected search term

match_citations

citations: str

ECitMatch — batch citation-to-PMID matching

get_full_text

id: str, id_type: "pmid"|"pmcid" = "pmid", encoding: "unicode"|"ascii" = "unicode", max_chars: int = 20000

BioC — full text of a PMC Open Access article

export_citation

ids: str, db: "pubmed"|"pmc" = "pubmed", format: "citation"|"csl"|"ris"|"nbib" = "citation"

Literature Citation Exporter — formatted citation

convert_ids

ids: str, idtype: Optional["pmcid"|"pmid"|"mid"|"doi"] = None, versions: bool = False

PMC ID Converter — convert between PMID/PMCID/MID/DOI

raw_request

service: "eutils"|"bioc"|"citexport"|"idconv", path: str, params: Dict[str, Any]

Raw GET request to any of the four underlying APIs

Environment variables

Variable

Required

Description

PUBMED_MCP_EMAIL

no

Email reported to NCBI (recommended by their usage policy)

PUBMED_MCP_API_KEY

no

NCBI E-utilities API key — raises the rate limit from 3 to 10 requests/second

Wiring it up

Only requirement: uv (https://docs.astral.sh/uv/). Nothing else to install.

Claude Code

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

With optional email/API key:

claude mcp add pubmed-mcp -e PUBMED_MCP_EMAIL=<value> -e PUBMED_MCP_API_KEY=<value> -- uvx --from git+https://github.com/dam2452/pubmed-mcp.git pubmed-mcp

Claude Desktop / other MCP client

{
  "mcpServers": {
    "pubmed-mcp": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/dam2452/pubmed-mcp.git", "pubmed-mcp"],
      "env": { "PUBMED_MCP_EMAIL": "<value>", "PUBMED_MCP_API_KEY": "<value>" }
    }
  }
}

After pushing a new version: uv cache clean and restart the client.

Local run

uv run --directory . pubmed-mcp

Tests (manual):

uv run --directory . --with pytest pytest test/

Available Tools

12 tools
convert_idsA

Convert between PubMed IDs, PMCIDs, Author Manuscript IDs, and DOIs via the PMC ID Converter API.

ids accepts up to 200 comma-separated IDs, all of the same type. Type is auto-detected from format unless idtype is set explicitly. Only returns results for articles present in PMC. Set versions=True to include manuscript/version history in the response.

Examples: convert_ids(ids="23193287") convert_ids(ids="3531190", idtype="pmcid") convert_ids(ids="10.1093/nar/gks1195", idtype="doi")

Inputs: ids (required), idtype, versions. Returns: object

export_citationA

Export formatted citation(s) for one or more articles via the Literature Citation Exporter.

ids is a comma-separated list of PMIDs (db="pubmed") or PMCIDs (db="pmc"). format: "citation" (formatted human-readable citation), "csl" (Citation Style Language JSON), "ris" (Research Info Systems), "nbib" (PubMed/MEDLINE tag format). ris/nbib are plain text.

Examples: export_citation(ids="28012456") export_citation(ids="28012456,29886577", format="ris")

Inputs: ids (required), db, format. Returns: object

fetch_recordsA

Fetch full records (EFetch) for a list of UIDs. USE SPARINGLY: records can be large.

rettype/retmode combinations are database-specific, e.g.: pubmed: rettype="abstract"|"medline", retmode="text"|"xml" pmc: rettype="full" (retmode="xml") protein/nuccore: rettype="fasta"|"gb"|"gp", retmode="text" Response is truncated to max_chars characters; check the "truncated" flag.

Examples: fetch_records(db="pubmed", ids="34523456", rettype="abstract") fetch_records(db="protein", ids="NP_000509.1", rettype="fasta")

Inputs: db (required), ids (required), rettype (required), retmode, +1 more. Returns: object

get_database_infoA

List available Entrez databases (EInfo), or describe searchable fields and link names for one database.

Call without db to list all Entrez database names. Call with db set to get its indexed fields and available link names.

Examples: get_database_info() get_database_info(db="pubmed")

Inputs: db. Returns: object

get_full_textA

Fetch the full text of a PMC Open Access article in BioC JSON format. USE SPARINGLY: full articles can be large.

Only articles in the PMC Open Access Subset or Author Manuscript Collection are available. id is a single PubMed ID (e.g. "17299597") or PMC ID (e.g. "PMC1790863") matching id_type. Response is truncated to max_chars characters; check the "truncated" flag.

Examples: get_full_text(id="17299597") get_full_text(id="PMC1790863", id_type="pmcid")

Inputs: id (required), id_type, encoding, max_chars. Returns: object

get_summariesA

Fetch document summaries (ESummary) for a list of UIDs from an Entrez database.

ids is a comma-separated list of UIDs (e.g. from search_pubmed). select limits returned fields by name (comma-separated); "*" (default) returns all fields.

Examples: get_summaries(db="pubmed", ids="34523456,34523457") get_summaries(db="pubmed", ids="34523456", select="title,pubdate,authors")

Inputs: db (required), ids (required), select. Returns: object

global_query_countsA

Get the number of results a query would return in every Entrez database at once (EGQuery).

Useful for scoping a search before committing to a specific database with search_pubmed.

Examples: global_query_counts(term="alzheimer's disease")

Inputs: term (required). Returns: object

match_citationsA

Batch match free-text citations against PubMed to retrieve their PMIDs (ECitMatch).

citations holds one or more citation strings in the pipe-delimited ECitMatch format: "journal_title|year|volume|first_page|author_name|your_key|", one per line, e.g. "proc natl acad sci u s a|1991|88|3248|mann bj|key1|". ECitMatch only supports plain-text output; the raw response is returned under "raw_text".

Examples: match_citations(citations="proc natl acad sci u s a|1991|88|3248|mann bj|key1|")

Inputs: citations (required). Returns: object

raw_requestA

Make a raw GET request to one of the four supported NCBI PubMed/PMC APIs. Safety valve for endpoints not covered by other tools.

service selects the base URL: "eutils" (E-utilities), "bioc" (BioC full text), "citexport" (Literature Citation Exporter), "idconv" (PMC ID Converter). path is appended to the service base URL (e.g. "esearch.fcgi" for eutils, "BioC_json/17299597/unicode" for bioc, "pubmed/" for citexport, "" for idconv). params is a dict of query-string parameters specific to that endpoint.

Examples: raw_request(service="eutils", path="einfo.fcgi", params={"retmode": "json"}) raw_request(service="bioc", path="BioC_xml/PMC1790863/unicode", params={})

Inputs: path (required), params (required), service (required). Returns: object

search_pubmedA

Search an NCBI Entrez database (ESearch) and return matching UIDs plus the total result count.

db defaults to "pubmed" but accepts any Entrez database name (e.g. "pmc", "gene", "protein"). sort accepts database-specific values such as "relevance" or "pub_date" (pubmed). mindate/maxdate use YYYY/MM/DD, YYYY/MM, or YYYY and require datetype ("pdat" or "edat"). Result is capped at 10000 UIDs per NCBI policy; use retstart to page through more.

Examples: search_pubmed(term="CRISPR AND cancer", retmax=50) search_pubmed(term="covid-19", db="pmc", sort="pub_date", mindate="2024/01/01", maxdate="2024/12/31", datetype="pdat")

Inputs: term (required), db, sort, retmax, +4 more. Returns: object

spelling_suggestionsA

Get a spelling-corrected version of a search term for a given Entrez database (ESpell).

ESpell only supports XML output; the raw XML is returned under "raw_text".

Examples: spelling_suggestions(db="pubmed", term="asthmaa treatment")

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

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 12 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose: searching, retrieving summaries/full records/full text, converting IDs, exporting citations, finding related links, spelling suggestions, global query counts, database info, and raw requests. No two tools overlap in functionality.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case (e.g., search_pubmed, get_summaries, convert_ids). The naming is predictable and clearly conveys the action and resource.

    Tool Count5/5

    12 tools is well-scoped for a PubMed/MEDLINE API wrapper. Each tool serves a specific need in the retrieval workflow, and the count is neither overly large nor too small for the domain.

    Completeness5/5

    The tool set covers the entire search and retrieval lifecycle: searching, spelling correction, global counts, database info, summaries, full records, full text, citation export, ID conversion, batch citation matching, and related links. A raw_request tool handles edge cases. No obvious gaps for a read-only PubMed client.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      An MCP server that provides access to PubMed and NCBI's biomedical literature database for searching articles, retrieving metadata, and tracking citations. It enables users to explore related research, browse MeSH vocabulary, and find free full-text links.
      6
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that provides direct access to PubMed and PubMed Central via the NCBI E-utilities API. It enables AI models to search biomedical literature, retrieve detailed article metadata, and download open-access full texts.
      5
      MIT