Skip to main content

MCP server for PubMed/NCBI E-utilities API — search, fetch, and verify citations

Project description

PubMed MCP Server

An MCP (Model Context Protocol) server that provides tools for searching and retrieving biomedical literature from PubMed via the NCBI E-utilities API.

Features

Tool Description
search_pubmed Search PubMed with a query string, returns article summaries
fetch_article Fetch full metadata and abstract for a specific PMID
fetch_abstract Get just the abstract text for a PMID
verify_citation Check if a PMID matches a given title (returns similarity score)
search_by_title Find the correct PMID for a given article title

Installation

From PyPI

pip install pubmed-mcp-server

From source

git clone https://github.com/gomezmera/suppevo-pubmed-mcp.git
cd suppevo-pubmed-mcp/pubmed
pip install -e .

Configuration

NCBI API Key (recommended)

An API key increases your rate limit from 3 requests/sec to 10 requests/sec.

  1. Create a free NCBI account at NCBI
  2. Go to Account Settings and generate an API key
  3. Set the environment variable:
export NCBI_API_KEY="your-api-key-here"

Or add it to a .env file in your home directory (~/.env):

NCBI_API_KEY=your-api-key-here

The server will automatically load it from ~/.env if present.

Running the Server

Standalone

# If installed via pip
pubmed-mcp

# Or run directly with FastMCP
fastmcp run server.py

With Kiro

Add to your .kiro/settings/mcp.json:

{
  "mcpServers": {
    "pubmed": {
      "command": "python",
      "args": ["/path/to/suppevo-pubmed-mcp/pubmed/server.py"],
      "env": {
        "NCBI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Or if installed from PyPI:

{
  "mcpServers": {
    "pubmed": {
      "command": "uvx",
      "args": ["pubmed-mcp-server"],
      "env": {
        "NCBI_API_KEY": "your-api-key-here"
      }
    }
  }
}

With Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "pubmed": {
      "command": "uvx",
      "args": ["pubmed-mcp-server"],
      "env": {
        "NCBI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Usage Examples

Once connected to an MCP client, you can use natural language:

  • "Search PubMed for vitamin D supplementation meta-analysis 2024"
  • "Fetch the full details for PMID 30415628"
  • "Verify that PMID 17846391 is about vitamin D supplementation and total mortality"
  • "Find the PMID for the article titled 'Effect of zinc supplementation on C-reactive protein'"
  • "Get the abstract for PMID 25927176"

Query Syntax

The search_pubmed tool supports PubMed's full query syntax:

# Basic search
vitamin D supplementation

# Field-specific
curcumin AND inflammation[Title]

# Author search
Prasad AS[Author] AND zinc

# Date range
omega-3 AND cardiovascular[Title] AND 2020:2024[dp]

# MeSH terms
"Zinc/therapeutic use"[MeSH]

Rate Limits

Configuration Rate Limit
Without API key 3 requests/second
With API key 10 requests/second

The server automatically throttles requests to stay within limits. NCBI may temporarily block IPs that exceed these limits.

Development

# Clone and install in development mode
git clone https://github.com/gomezmera/suppevo-pubmed-mcp.git
cd suppevo-pubmed-mcp/pubmed
pip install -e .

# Run the server
python server.py

Publishing

See RELEASING.md for instructions on publishing to PyPI.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

suppevo_pubmed_mcp-1.0.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

suppevo_pubmed_mcp-1.0.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file suppevo_pubmed_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: suppevo_pubmed_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for suppevo_pubmed_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2be15927fdf8e416c0294b171702ab942ee7c69301635229b6d8fe89f373c505
MD5 9b64a25464f7a5fa7be119be98d9da6a
BLAKE2b-256 0ff3ef1fc9e8fabbaac284064e314f461185a469c9a79a4ccab80e2ea4d72890

See more details on using hashes here.

File details

Details for the file suppevo_pubmed_mcp-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for suppevo_pubmed_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c6381ad07e21e41a72bdf6977e7e98484525019173d46d31df2329d81afdbe5
MD5 d90573e804486e6acb863f9b35fa194a
BLAKE2b-256 55678cd9b2561464db1fa5069db0e878180d2b6cb6c268756ee44d0202944132

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page