pubmed-mcp-server — Claude Code MCP server: features and setup
Search PubMed and Europe PMC, retrieve article details and available full text, and format references through an MCP-enabled coding agent.
claude mcp add --transport http pubmed-mcp-server https://pubmed.caseyjhand.com/mcpWhat pubmed-mcp-server does
The server gives an agent tools to search biomedical papers, retrieve abstracts and metadata, find related articles, and convert DOI, PMID, and PMCID identifiers. It can also look up MeSH vocabulary, correct PubMed queries, and format references as APA, MLA, BibTeX, RIS, or Vancouver.
For full-text retrieval, provide a DOI, PMID, or PMCID. The server checks PMC, Europe PMC, then Unpaywall; access through Unpaywall requires the UNPAYWALL_EMAIL environment variable. Results can include sections, tables, and figures, and response size can be limited.
In Claude Code, connect to the hosted HTTP endpoint or run the package locally with npx. Local setup accepts environment variables. Without UNPAYWALL_EMAIL, the Unpaywall source cannot be used for full-text retrieval.
What it helps with
- search PubMed with a topic and filters
- retrieve article details from a PMID
- look for full text using a DOI or PMCID
- format references as BibTeX or Vancouver
- convert a DOI to a PMID or PMCID
Example prompts for the agent
- Search PubMed for studies on this topic and narrow the results by publication date.
- Get the abstract, authors, and MeSH terms for PMID 12345678.
- Format these papers as BibTeX and check for available full text.
How to install pubmed-mcp-server
1Platform CLI: remote server
claude mcp add --transport http pubmed-mcp-server https://pubmed.caseyjhand.com/mcp2Platform CLI
claude mcp add --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> --env NCBI_API_KEY=<NCBI_API_KEY> --env NCBI_ADMIN_EMAIL=<NCBI_ADMIN_EMAIL> --env UNPAYWALL_EMAIL=<UNPAYWALL_EMAIL> --env MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> --transport stdio pubmed-mcp-server -- npx -y @cyanheads/pubmed-mcp-serverReplace <…> with your own values. 5 more environment variables are in the server README
1Platform CLI: remote server
codex mcp add pubmed-mcp-server --url https://pubmed.caseyjhand.com/mcp2Platform CLI
codex mcp add pubmed-mcp-server --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> --env NCBI_API_KEY=<NCBI_API_KEY> --env NCBI_ADMIN_EMAIL=<NCBI_ADMIN_EMAIL> --env UNPAYWALL_EMAIL=<UNPAYWALL_EMAIL> --env MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> -- npx -y @cyanheads/pubmed-mcp-serverReplace <…> with your own values. 5 more environment variables are in the server README
Config file
{
"mcpServers": {
"pubmed-mcp-server": {
"url": "https://pubmed.caseyjhand.com/mcp"
}
}
}{
"mcpServers": {
"pubmed-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/pubmed-mcp-server"
],
"env": {
"MCP_LOG_LEVEL": "<MCP_LOG_LEVEL>",
"NCBI_API_KEY": "<NCBI_API_KEY>",
"NCBI_ADMIN_EMAIL": "<NCBI_ADMIN_EMAIL>",
"UNPAYWALL_EMAIL": "<UNPAYWALL_EMAIL>",
"MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>"
}
}
}
}Replace <…> with your own values. 5 more environment variables are in the server README
Config file
{
"servers": {
"pubmed-mcp-server": {
"type": "http",
"url": "https://pubmed.caseyjhand.com/mcp"
}
}
}{
"servers": {
"pubmed-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@cyanheads/pubmed-mcp-server"
],
"env": {
"MCP_LOG_LEVEL": "<MCP_LOG_LEVEL>",
"NCBI_API_KEY": "<NCBI_API_KEY>",
"NCBI_ADMIN_EMAIL": "<NCBI_ADMIN_EMAIL>",
"UNPAYWALL_EMAIL": "<UNPAYWALL_EMAIL>",
"MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>"
}
}
}
}Replace <…> with your own values. 5 more environment variables are in the server README
1Platform CLI: remote server
gemini mcp add -t http pubmed-mcp-server https://pubmed.caseyjhand.com/mcp2Platform CLI
gemini mcp add -e MCP_LOG_LEVEL=<MCP_LOG_LEVEL> -e NCBI_API_KEY=<NCBI_API_KEY> -e NCBI_ADMIN_EMAIL=<NCBI_ADMIN_EMAIL> -e UNPAYWALL_EMAIL=<UNPAYWALL_EMAIL> -e MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> pubmed-mcp-server npx -y @cyanheads/pubmed-mcp-serverReplace <…> with your own values. 5 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about pubmed-mcp-server
How do I install pubmed-mcp-server in Claude Code?
To connect to the hosted HTTP server, run claude mcp add --transport http pubmed-mcp-server https://pubmed.caseyjhand.com/mcp.
What does pubmed-mcp-server do?
It searches PubMed and Europe PMC, retrieves article information and accessible full text, and handles citation formatting and publication identifiers.
Is an email address needed to retrieve full text?
The Unpaywall source requires the UNPAYWALL_EMAIL environment variable. The server also checks PMC and Europe PMC.