The PubMed MCP Server enables comprehensive interaction with PubMed's database of over 30 million biomedical literature citations through Claude.
Core Capabilities:
Search PubMed articles - Query with flexible search terms and parameters including date ranges, sorting options (relevance, publication date, author, journal), pagination controls, and result limits
Fetch detailed article summaries - Retrieve comprehensive information using PubMed IDs (PMIDs), including abstracts, authors, DOIs, and publication metadata
Access full text content - Get full article text when available using PMIDs
Performance & Configuration:
Rate limiting - Supports 3 requests/second without API key or 10 requests/second with NCBI API key
Caching - Built-in response caching with configurable cache directory and TTL to reduce redundant API calls
Flexible setup - Configure via command-line arguments, environment variables (PUBMED_EMAIL, PUBMED_API_KEY, PUBMED_CACHE_DIR, PUBMED_CACHE_TTL), or JSON configuration files
Type-safe implementation - Built with TypeScript for robust development
Integration - Can be installed at project or global scope with support for email authentication and optional API keys
Allows retrieval of Digital Object Identifier (DOI) information for scientific articles when fetching detailed article information from PubMed.
Enables searching PubMed scientific articles database using NCBI E-utilities API, providing tools for querying articles, fetching detailed summaries including abstracts and authors, and retrieving full text information when available.
pubmed-mcp: MCP Server for PubMed
PubMed is a free database maintained by the National Library of Medicine (NLM) at the National Institutes of Health (NIH), offering access to over 30 million citations for biomedical literature.
This is MCP server for searching PubMed scientific articles using NCBI E-utilities API.
Features
Search PubMed articles with flexible query parameters
Fetch detailed article information including abstracts, authors, and DOI
Built-in rate limiting (3 req/s without API key, 10 req/s with API key)
Caching support for improved performance
TypeScript implementation with full type safety
Related MCP server: Academic Paper Search MCP Server
Usage with Claude Code
Node.js v18 or higher is required. Claude Code typically installs Node.js during setup.
Adding pubmed-mcp in project scope
The -y option is used to skip the confirmation prompt during the initial installation.
The --scope project option installs the server in project scope, creating a .mcp.json file in the project root to store the MCP server settings.
If you omit --scope project, the server will be installed globally:
You can also set the email address via the PUBMED_EMAIL environment variable. For better security, consider managing credentials in a .env file.
Adding pubmed-mcp with an API key
Specifying a PubMed API key relaxes PubMed’s request rate limits. Obtain an API key by creating an NCBI account and visiting the API Key Management page:
Alternatively, set the API key via the PUBMED_API_KEY environment variable. For security reasons, it is recommended to store sensitive information like API keys in a .env file rather than in command line arguments or configuration files.
Enabling caching
Enabling caching returns cached results for identical requests, reducing the number of API calls.
Using command line arguments
Use --cache-dir to specify the cache directory, and --cache-ttl to set the cache time-to-live in seconds (default: 1 day / 86400 seconds):
You can also configure caching via environment variables.
PUBMED_CACHE_DIR: Directory path for caching responsesPUBMED_CACHE_TTL: Cache time-to-live in seconds (default: 86400)
Configuration via JSON file
Instead of running commands, you can edit the JSON file directly.
For project scope: edit
.mcp.jsonin the project root.For global scope: edit
~/.claude.json.
Usage with Claude Desktop
1. Edit Configuration File
Edit Claude Desktop's configuration file (~/.claude/claude_desktop_config.json):
2. Configuration with Caching
3. Configuration for Globally Installed Version
If you've installed globally:
Requirements
System Requirements
Node.js: >= 18
npm: Latest version recommended
Environment Variables (Recommended)
PUBMED_EMAIL: Email address recommended by NCBIPUBMED_API_KEY: API key for higher rate limits (optional)PUBMED_CACHE_DIR: Directory path for caching responses (optional)PUBMED_CACHE_TTL: Cache time-to-live in seconds (optional, default: 86400)
How to Use
Available Tools
search
Search PubMed articles with query parameters.
Parameters:
query(required): Search query stringmax_results: Maximum number of results (default: 20)sort: Sort order for results
Example usage:
fetch_summary
Fetch detailed summary for specific PubMed articles.
Parameters:
pmids(required): Array of PubMed IDs to fetch
Example usage:
get_full_text
Get full text information for PubMed articles (when available).
Parameters:
pmids(required): Array of PubMed IDs
MCP Server Development
Development Environment Setup
Development Commands
Directory Structure
Testing During Development
Debugging
Packaging
Rate Limits
Without API key: 3 requests per second
With API key: 10 requests per second
NCBI recommends including an email address in requests for better support.
Technical Specifications
Runtime: Node.js (>=18)
Language: TypeScript with ES2022 target
Module System: ESM
Build Tool: Vite
Testing: Vitest
MCP SDK: @modelcontextprotocol/sdk v1.17.1
License
MIT License