PubMed Plugin for Claude Code
A Claude Code plugin that integrates the @cyanheads/pubmed-mcp-server MCP server, enabling biomedical literature search, article retrieval, citation formatting, and research planning directly within Claude Code.
Features
- Literature search — search PubMed with full query syntax, MeSH terms, date ranges, and publication type filters
- Article retrieval — fetch full metadata, abstracts, author affiliations, and DOIs by PMID
- Citation mapping — find similar articles, papers that cite a work, and a paper's own references
- Citation export — format citations in BibTeX, RIS, APA, and MLA
- Research planning — generate structured systematic review plans with recommended search strings
- Trend visualization — create PNG charts of publication trends over time
Prerequisites
- Claude Code — install with
npm install -g @anthropic-ai/claude-code
- Node.js ≥ 20.0.0 — required to run the MCP server; download here
- npx — included with Node.js/npm
- Internet access — to reach the NCBI PubMed API
Verify your Node.js version:
node --version # must be v20.0.0 or higher
Installation
Option 1: Marketplace (Recommended)
This repo is a Claude Code plugin marketplace. Add it once and install the plugin in seconds.
Step 1: Add the marketplace
In Claude Code, run /plugins, select Manage marketplaces, and add:
thorrak/pubmed_plugin
Step 2: Install the plugin
/plugins install pubmed@pubmed-marketplace
Step 3: Restart Claude Code (required for the MCP server to start)
Step 4: Verify
/pubmed:setup
Option 2: Local / development install
Clone the repo and point Claude Code at it:
git clone https://github.com/thorrak/pubmed_plugin.git
cc --plugin-dir /path/to/pubmed_plugin
Or set it permanently in your Claude Code config:
{
"pluginDirs": ["/path/to/pubmed_plugin"]
}
After installation
- Restart Claude Code (required for MCP server to start)
- Run
/mcp in Claude Code — you should see a pubmed server listed with five tools
- Run
/pubmed:setup to verify everything is working
Configuration
NCBI API Key (Strongly Recommended)
Without an API key, NCBI limits requests to 3/second. With one, the limit is 10/second. For any serious research workload (systematic reviews, bulk fetches), the key is effectively required.
Step 1: Create a free NCBI account
Go to https://www.ncbi.nlm.nih.gov/ and sign up.
Step 2: Generate an API key
- Sign in and go to Account Settings
- Click API Key Management
- Click Create an API Key
- Copy the 36-character key
Step 3: Set the environment variable
Add to your shell profile (~/.zshrc, ~/.bashrc, or ~/.profile):
export NCBI_API_KEY="your_api_key_here"
Reload your shell:
source ~/.zshrc # or ~/.bashrc
The MCP server reads NCBI_API_KEY automatically — no other configuration needed.
MCP Server Version
The plugin is pinned to @cyanheads/pubmed-mcp-server@1.4.5 in .mcp.json. To use a different version, edit .mcp.json:
"args": ["-y", "@cyanheads/pubmed-mcp-server@<version>"]
Verify Setup
Run the built-in diagnostic command in Claude Code:
/pubmed:setup
This performs four checks and reports results:
| Check | Description |
|---|
| Node.js (≥20) | Verifies runtime is installed and meets version requirement |
| npx | Verifies package runner is available |
| NCBI API Key | Checks whether NCBI_API_KEY is set in the environment |
| MCP Connection | Attempts a live search to confirm the MCP server is running |
Usage
Once installed, Claude automatically activates the PubMed skill when you ask research questions. No slash command needed for searches — just ask naturally.
Example prompts
Search PubMed for recent randomized controlled trials on semaglutide in NASH
Find papers that cite PMID 35486828 and format them as BibTeX
Plan a systematic literature review on GLP-1 agonists and liver disease
Show me publication trends on mRNA vaccines from 2015 to 2024 as a bar chart
Get the full abstracts for PMIDs 35486828, 34577062, and 24475906
Find all papers similar to PMID 33264437 and export citations in APA format
MCP Tools
The plugin exposes five tools from the PubMed MCP server (prefixed as mcp__plugin_pubmed_pubmed__*):