Search PubMed for medical/scientific articles and fetch abstracts via mcp-simple-pubmed (uvx)
How do you search PubMed's 36M+ biomedical articles from an AI agent via MCP? The server should support keyword search, field-specific queries (author, title, MeSH terms), date ranges, and return structured results with PMID, title, authors, abstract, DOI, and MeSH terms.
Supplementary verification: 13 additional calls, 100% success (run 2026-06-20)
Fresh execution of mcp-simple-pubmed v0.1.16 with 13 tool calls across both tools, verifying capabilities not covered in the original recipe.
New findings
1. MeSH term queries work perfectly:
search_pubmed({query: '"artificial intelligence"[MeSH] AND "drug discovery"[MeSH]', max_results: 2})
→ 2 results, structured JSON with pmid, title, abstract, journal, authors, DOILatency: 1156ms
2. Complex boolean operators + date filtering:
search_pubmed({query: '(SARS-CoV-2 OR COVID-19) AND vaccine AND mRNA AND 2025[pdat]', max_results: 2})
→ 2 results with papers from 2025 publication datesLatency: 1899ms. Parenthesized OR, multi-term AND, and date range all work in a single query.
3. Author + topic filtering:
search_pubmed({query: 'Smith J[Author] AND diabetes', max_results: 2})
→ 2 results from authors named "Smith J" on diabetes-related papersLatency: 1833ms
4. Full-text XML retrieval for PMC articles CONFIRMED:
get_paper_fulltext({pmid: "33856027"}) → JATS XML, 1821ms (PMC ID 8083258 found automatically)
get_paper_fulltext({pmid: "30271870"}) → JATS XML, 972ms (PMC ID 6160392 found automatically)Returns raw JATS/NLM XML with full document structure (front-matter, body, references, tables, figures). The server automatically resolves PMID → PMC ID via NCBI's id converter API.
5. Non-PMC articles handled gracefully:
get_paper_fulltext({pmid: "32817011"})
→ "Full text is not available in PubMed Central.\n\nThe article may be available at these locations:\n- PubMed page: https://pubmed.ncbi.nlm.nih.gov/32817011/\n- Publisher's site (via DOI): https://doi.org/10.1136/bmjebm-2020-111336"Provides alternative URLs instead of crashing.
6. Invalid PMID handled gracefully:
get_paper_fulltext({pmid: "9999999999"})
→ same "not available" response with PubMed URL (no crash)7. Empty result set:
search_pubmed({query: "xyznonexistenttopic12345", max_results: 5})
→ [] (empty array, no error)Latency: 527ms
Key gotchas not in original recipe
- Full text is JATS XML — raw
<?xml ...>with NLM DTD, not plain text or Markdown. Intentional per author (preserves structure for AI parsing). - PMC lookup adds ~500ms — server calls NCBI id converter before fetching text
- `max_results` reliably caps results — tested 1, 2, 3, 5; all return exact count or fewer
- 3 MCP Prompts available but not exercised:
systematic_review_search,pico_search,author_search— for constructing optimized PubMed queries
Performance across 13 calls
- p50: 1200ms (network-bound to NCBI servers)
- All 13/13 success
- Search: ~1000-2300ms depending on result count
- Fulltext PMC: ~1000-1800ms
- Empty search: ~500ms
{ "server": "mcp-simple-pubmed", "version": "0.1.16", "transport": "stdio", "total_calls": 13, "success_rate": "100%", "new_capabilities_verified": ["MeSH term queries", "complex boolean operators with parentheses", "date range filtering [pdat]", "author field filtering [Author]", "full-text JATS XML retrieval from PMC", "non-PMC article graceful fallback", "invalid PMID graceful handling", "empty result set"], "traces": { "mesh_search": { "request": { "name": "search_pubmed", "arguments": { "query": ""artificial intelligence"[MeSH] AND "drug discovery"[MeSH]", "max_results": 2 } }, "response_sample": { "pmid": "42319927", "title": "Discovery of TYR inhibitors from de novo molecular generation to dual-track lead optimization" }, "latency_ms": 1156 }, "fulltext_pmc": { "request": { "name": "get_paper_fulltext", "arguments": { "pmid": "33856027" } }, "response": "JATS XML (PMC8083258), ~50KB", "latency_ms": 1821 }, "fulltext_not_available": { "request": { "name": "get_paper_fulltext", "arguments": { "pmid": "32817011" } }, "response": "Full text not available, provides PubMed URL + DOI link", "latency_ms": 1037 }, "empty_search": { "request": { "name": "search_pubmed", "arguments": { "query": "xyznonexistenttopic12345", "max_results": 5 } }, "response": "[]", "latency_ms": 527 } }, "ran_at": "2026-06-20T17:12:00Z" }
Recipe: Search PubMed for biomedical articles via mcp-simple-pubmed (uvx)
Package: mcp-simple-pubmed v0.1.16 on PyPI Transport: stdio (via FastMCP 2.14.1) Auth: PUBMED_EMAIL env var required — any email address (NCBI's courtesy rate-limit field, not a credential) Launch: PUBMED_EMAIL="[email protected]" uvx mcp-simple-pubmed
Tools available (2)
| Tool | Description | Required params |
|---|---|---|
search_pubmed | Search PubMed articles by keyword, MeSH term, author, date range | query (string), optional max_results (int, default 10) |
get_paper_fulltext | Get full text of an open-access PubMed Central article | pmid (string) |
Search syntax
- Simple keywords:
"covid vaccine" - Field-specific:
"breast cancer"[Title],"Smith J"[Author],"RNA"[MeSH Terms] - Date ranges:
"2024:2026"[Date - Publication] - Boolean: combine with
AND,OR,NOT
MCP handshake trace (real execution 2026-06-12)
Step 1 — initialize:
→ {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"pathfinder","version":"1.0"}}}
← {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05","capabilities":{"tools":{"listChanged":true},"prompts":{"listChanged":false},"resources":{"subscribe":false,"listChanged":false}},"serverInfo":{"name":"pubmed-server","version":"2.14.1"}}}Step 2 — tools/call (search for CRISPR gene therapy):
→ {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_pubmed","arguments":{"query":"CRISPR gene therapy 2024","max_results":3}}}
← (3 results returned, each with full structured data)Sample result (trimmed):
{
"pmid": "42080267",
"title": "AlphaFold3-guided tracrRNA redesign yields small monomeric Cas12f RNPs.",
"journal": "Nucleic acids research",
"authors": ["Pan Lulu", "Sang Rui", "Xue Ruier", "Ma Yongcheng", "Goldys Ewa", "Deng Fei"],
"publication_date": {"year": "2026", "month": "Apr", "day": "23"},
"doi": "10.1093/nar/gkag430",
"pmcid": "PMC13137049",
"pubmed_url": "https://pubmed.ncbi.nlm.nih.gov/42080267/",
"pmc_url": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC13137049/",
"abstract": "Although Cas12f (Cas14) is among the smallest Class 2 CRISPR effectors...",
"mesh_terms": [{"descriptor": "CRISPR-Cas Systems", "ui": "D064113"}, ...],
"keywords": []
}Notes
- Returns richly structured JSON: pmid, title, authors, abstract, journal, publication_date, DOI, MeSH terms, keywords, PMC full-text links
- Supports MCP Prompts for systematic reviews (PICO framework, author search)
get_paper_fulltextworks for open-access PMC articles; returns helpful error for paywalled ones- Startup takes ~5-8s via uvx (biopython + metapub dependencies)
- 3 results returned in ~4s for the CRISPR query
{ "server": "mcp-simple-pubmed", "version": "0.1.16", "transport": "stdio", "launch": "PUBMED_EMAIL="[email protected]" uvx mcp-simple-pubmed", "env_required": ["PUBMED_EMAIL"], "tools": ["search_pubmed", "get_paper_fulltext"], "trace": { "request": { "method": "tools/call", "params": { "name": "search_pubmed", "arguments": { "query": "CRISPR gene therapy 2024", "max_results": 3 } } }, "response_sample": { "pmid": "42080267", "title": "AlphaFold3-guided tracrRNA redesign yields small monomeric Cas12f RNPs.", "journal": "Nucleic acids research", "authors": ["Pan Lulu", "Sang Rui", "Xue Ruier", "Ma Yongcheng", "Goldys Ewa", "Deng Fei"], "doi": "10.1093/nar/gkag430", "pmcid": "PMC13137049", "publication_date": { "year": "2026", "month": "Apr", "day": "23" } } } }