@cyanheads/pubmed-mcp-server

v2.6.1

Search PubMed, fetch articles, generate citations, explore MeSH terms, and discover related research.

public 9 tools 1 resources 1 prompts protocol 2025-11-25
@cyanheads/pubmed-mcp-server
{
  "mcpServers": {
    "pubmed-mcp-server": {
      "command": "bunx",
      "args": [
        "@cyanheads/pubmed-mcp-server@latest"
      ],
      "env": {
        "NCBI_API_KEY": "your-ncbi-api-key",
        "NCBI_ADMIN_EMAIL": "[email protected]",
        "UNPAYWALL_EMAIL": "[email protected]"
      }
    }
  }
}
{
  "mcpServers": {
    "pubmed-mcp-server": {
      "type": "http",
      "url": "https://pubmed.caseyjhand.com/mcp"
    }
  }
}
claude mcp add --transport http pubmed-mcp-server https://pubmed.caseyjhand.com/mcp
curl -X POST https://pubmed.caseyjhand.com/mcp \
  -H "Content-Type: application/json" \
  -H "MCP-Protocol-Version: 2025-11-25" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0.0"}}}'

Tools

9

Search PubMed with full query syntax, filters, and date ranges. Returns PMIDs and optional brief summaries. Supports field-specific filters (author, journal, MeSH terms), common filters (language, species, free full text), and pagination via offset for paging through large result sets.

Invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "pubmed_search_articles",
    "arguments": {
      "query": "<query>"
    }
  }
}
Input schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "PubMed search query (supports full NCBI syntax)"
    },
    "maxResults": {
      "default": 20,
      "description": "Maximum results to return",
      "type": "integer",
      "minimum": 1,
      "maximum": 1000
    },
    "offset": {
      "default": 0,
      "description": "Result offset for pagination (0-based)",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "sort": {
      "default": "relevance",
      "description": "Sort order: relevance (default), pub_date (newest first), author, or journal",
      "type": "string",
      "enum": [
        "relevance",
        "pub_date",
        "author",
        "journal"
      ]
    },
    "dateRange": {
      "description": "Filter by date range",
      "type": "object",
      "properties": {
        "minDate": {
          "type": "string",
          "pattern": "^$|^\\d{4}([/\\-.]\\d{1,2}([/\\-.]\\d{1,2})?)?$",
          "description": "Start date (YYYY/MM/DD, YYYY/MM, or YYYY)"
        },
        "maxDate": {
          "type": "string",
          "pattern": "^$|^\\d{4}([/\\-.]\\d{1,2}([/\\-.]\\d{1,2})?)?$",
          "description": "End date (YYYY/MM/DD, YYYY/MM, or YYYY)"
        },
        "dateType": {
          "default": "pdat",
          "description": "Date type: pdat (publication), mdat (modification), edat (entrez)",
          "type": "string",
          "enum": [
            "pdat",
            "mdat",
            "edat"
          ]
        }
      },
      "required": [
        "minDate",
        "maxDate",
        "dateType"
      ],
      "additionalProperties": false
    },
    "publicationTypes": {
      "description": "Filter by publication type (e.g. \"Review\", \"Clinical Trial\", \"Meta-Analysis\"). Multiple values are OR'd — any match qualifies.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "author": {
      "description": "Filter by author name (e.g. \"Smith J\")",
      "type": "string"
    },
    "journal": {
      "description": "Filter by journal name",
      "type": "string"
    },
    "meshTerms": {
      "description": "Filter by MeSH terms. Multiple terms are AND'd — all must match.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "language": {
      "description": "Filter by language (e.g. \"english\")",
      "type": "string"
    },
    "hasAbstract": {
      "description": "Only include articles with abstracts",
      "type": "boolean"
    },
    "freeFullText": {
      "description": "Only include free full text articles",
      "type": "boolean"
    },
    "species": {
      "description": "Filter by species",
      "type": "string",
      "enum": [
        "humans",
        "animals"
      ]
    },
    "summaryCount": {
      "default": 0,
      "description": "Fetch brief summaries for top N results (0 = PMIDs only)",
      "type": "integer",
      "minimum": 0,
      "maximum": 50
    }
  },
  "required": [
    "query",
    "maxResults",
    "offset",
    "sort",
    "summaryCount"
  ],
  "additionalProperties": false
}

Fetch full article metadata by PubMed IDs. Returns detailed article information including abstract, authors, journal, MeSH terms.

Invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "pubmed_fetch_articles",
    "arguments": {
      "pmids": "<pmids>"
    }
  }
}
Input schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "pmids": {
      "minItems": 1,
      "maxItems": 200,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^\\d+$"
      },
      "description": "PubMed IDs to fetch"
    },
    "includeMesh": {
      "default": true,
      "description": "Include MeSH terms",
      "type": "boolean"
    },
    "includeGrants": {
      "default": false,
      "description": "Include grant information",
      "type": "boolean"
    }
  },
  "required": [
    "pmids",
    "includeMesh",
    "includeGrants"
  ],
  "additionalProperties": false
}

Fetch full-text articles. Primary source is PubMed Central (structured JATS with sections and references). When a PMID has no PMC copy, transparently falls back to Unpaywall (open-access copies hosted by publishers or institutional repositories) and returns best-effort HTML-as-Markdown or PDF-as-text. Set UNPAYWALL_EMAIL to enable the fallback. Accepts PMC IDs directly or PubMed IDs (auto-resolved via the PMC ID Converter).

Invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "pubmed_fetch_fulltext",
    "arguments": {}
  }
}
Input schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "pmcids": {
      "description": "PMC IDs to fetch (e.g. [\"PMC9575052\"]). Provide this OR pmids, not both.",
      "minItems": 1,
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "pmids": {
      "description": "PubMed IDs. Articles in PMC are returned as structured JATS. Articles not in PMC are retrieved from Unpaywall when UNPAYWALL_EMAIL is set and a DOI is available. Provide this OR pmcids, not both.",
      "minItems": 1,
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^\\d+$"
      }
    },
    "includeReferences": {
      "default": false,
      "description": "Include reference list. Applies to `source=pmc` results only.",
      "type": "boolean"
    },
    "maxSections": {
      "description": "Maximum top-level body sections. Applies to `source=pmc` results only.",
      "type": "integer",
      "minimum": 1,
      "maximum": 50
    },
    "sections": {
      "description": "Filter to specific sections by title, case-insensitive (e.g. [\"Introduction\", \"Methods\", \"Results\", \"Discussion\"]). Applies to `source=pmc` results only.",
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "includeReferences"
  ],
  "additionalProperties": false
}

Get formatted citations for PubMed articles in APA, MLA, BibTeX, or RIS format.

Invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "pubmed_format_citations",
    "arguments": {
      "pmids": "<pmids>"
    }
  }
}
Input schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "pmids": {
      "minItems": 1,
      "maxItems": 50,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^\\d+$"
      },
      "description": "PubMed IDs to cite"
    },
    "styles": {
      "default": [
        "apa"
      ],
      "description": "Citation styles to generate",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "apa",
          "mla",
          "bibtex",
          "ris"
        ]
      }
    }
  },
  "required": [
    "pmids",
    "styles"
  ],
  "additionalProperties": false
}

pubmed_spell_check

read-onlyopen-world
view source ↗

Spell-check a query and get NCBI's suggested correction. Useful for refining search queries.

Invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "pubmed_spell_check",
    "arguments": {
      "query": "<query>"
    }
  }
}
Input schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 2,
      "description": "PubMed search query to spell-check"
    }
  },
  "required": [
    "query"
  ],
  "additionalProperties": false
}

pubmed_lookup_mesh

read-onlyopen-world
view source ↗

Search and explore MeSH (Medical Subject Headings) vocabulary. Essential for building precise PubMed queries.

Invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "pubmed_lookup_mesh",
    "arguments": {
      "term": "<term>"
    }
  }
}
Input schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "term": {
      "type": "string",
      "minLength": 1,
      "description": "MeSH term to look up"
    },
    "maxResults": {
      "default": 10,
      "description": "Maximum results",
      "type": "integer",
      "minimum": 1,
      "maximum": 50
    },
    "includeDetails": {
      "default": true,
      "description": "Fetch full MeSH records (scope notes, tree numbers, entry terms)",
      "type": "boolean"
    }
  },
  "required": [
    "term",
    "maxResults",
    "includeDetails"
  ],
  "additionalProperties": false
}

Look up PubMed IDs from partial bibliographic citations. Useful when you have a reference (journal, year, volume, page, author) and need the PMID. Uses NCBI ECitMatch for deterministic matching — more reliable than searching by citation fields.

Invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "pubmed_lookup_citation",
    "arguments": {
      "citations": "<citations>"
    }
  }
}
Input schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "citations": {
      "minItems": 1,
      "maxItems": 25,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "journal": {
            "description": "Journal title or ISO abbreviation (e.g., \"proc natl acad sci u s a\")",
            "type": "string"
          },
          "year": {
            "description": "Publication year (e.g., \"1991\")",
            "type": "string"
          },
          "volume": {
            "description": "Volume number",
            "type": "string"
          },
          "firstPage": {
            "description": "First page number",
            "type": "string"
          },
          "authorName": {
            "description": "Author name, typically \"lastname initials\" (e.g., \"mann bj\")",
            "type": "string"
          },
          "key": {
            "description": "Arbitrary label to track this citation in results. Auto-assigned if omitted.",
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "Citation to match against PubMed"
      },
      "description": "Citations to look up. More fields = better match accuracy."
    }
  },
  "required": [
    "citations"
  ],
  "additionalProperties": false
}

pubmed_convert_ids

read-onlyopen-world
view source ↗

Convert between article identifiers (DOI, PMID, PMCID). Accepts up to 50 IDs of a single type per request. Uses the NCBI PMC ID Converter API — only resolves articles indexed in PubMed Central. For articles not in PMC, use pubmed_search_articles instead.

Invocation
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "pubmed_convert_ids",
    "arguments": {
      "ids": "<ids>",
      "idtype": "<idtype>"
    }
  }
}
Input schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ids": {
      "minItems": 1,
      "maxItems": 50,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "description": "Article identifiers to convert. All IDs must be the same type. DOIs: \"10.1093/nar/gks1195\", PMIDs: \"23193287\", PMCIDs: \"PMC3531190\"."
    },
    "idtype": {
      "type": "string",
      "enum": [
        "pmcid",
        "pmid",
        "doi"
      ],
      "description": "The type of IDs being submitted. Required so the API can unambiguously resolve them."
    }
  },
  "required": [
    "ids",
    "idtype"
  ],
  "additionalProperties": false
}

Resources

1

PubMed database metadata including field list, last update date, and record count.

uri pubmed://database/info mime application/json

Prompts

1

Generate a structured research plan outline for a biomedical research project.

  • titlerequired — Project title
  • goalrequired — Primary research goal
  • keywordsrequired — Research keywords (comma-separated)
  • organism — Target organism
  • includeAgentPrompts — Include detailed prompts for consuming LLM ("true" or "false")