home / mcp / pubmed mcp server

PubMed MCP Server

Provides MCP access to PubMed's E-utilities for searching, downloading, and summarizing biomedical articles in XML, JSON, and text formats.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "aeghnnsw-pubmed-mcp": {
      "command": "python",
      "args": [
        "server.py"
      ],
      "env": {
        "NCBI_EMAIL": "[email protected]",
        "NCBI_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

You run a local MCP server that exposes PubMed’s E-utilities API for searching and downloading biomedical articles. It lets you quickly search PubMed, retrieve metadata and abstracts, and fetch full content when available, all through the MCP interface.

How to use

Now that your PubMed MCP Server is running, you can perform practical tasks through an MCP client. You can search PubMed with flexible queries, fetch individual articles, download multiple articles in a single request, and retrieve document summaries that include metadata. Outputs can be returned in XML, JSON, or plain text. If you need to stay within PubMed’s usage limits, the server automatically applies rate limiting.

Common workflows you can perform:

  • Search for articles by query to get a list of PubMed IDs (PMIDs) and total results.
  • Download a single article by PMID in your preferred format (abstract, Medline, or full content) and choose the return format (XML, JSON, or text).
  • Request summaries for multiple PMIDs to get metadata without full content.
  • Batch download several articles in one request to save round trips and improve performance.

Key tips to get the most from the server:

  • Use clear, targeted queries to reduce results and improve relevance (e.g., CRISPR[Title], 2023[PDAT], Nature[Journal]).
  • Choose an output format that your application expects (XML for strict parsing, JSON for modern apps, or text for quick human reading).
  • Leverage batch operations for efficiency when you need multiple articles.
  • Respect rate limits to avoid API throttling or failures.

How to install

Install prerequisites and set up a local Python environment, then start the server so you can begin using MCP clients.

# Prerequisites
# - Python 3.8+ installed
# - Optional: git for cloning

# Create a virtual environment
python3 -m venv venv

# Activate the virtual environment
# On macOS/Linux
source venv/bin/activate
# On Windows
venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Optional: copy environment template for API key and contact email
cp .env.example .env
# Edit .env to include your NCBI API key and email
```} ,{

Available tools

search_articles

Search PubMed articles by a query and return matching PMIDs and metadata.

download_article

Download details for a single PubMed ID in a chosen format (abstract, medline, or full) and return in a specified return format (xml, text, or json).

download_articles_batch

Download multiple articles in a single request and return combined content along with the list of requested PMIDs.

get_article_summaries

Fetch document summaries (metadata only) for a list of PubMed IDs.