PubMed MCP Server

by chrismannina

9 384 downloads Not rated yet MIT
GitHub

About

A Model Context Protocol (MCP) server that enables AI assistants to search and analyze PubMed medical literature with advanced filtering, citations, and research tools.

Details

License
MIT

Explore

- Advanced PubMed Search: Search with complex filters including date ranges, article types, authors, journals, and MeSH terms
- Article Details: Retrieve detailed information for specific PMIDs including abstracts, authors, and metadata
- Citation Export: Export citations in multiple formats (BibTeX, APA, MLA, Chicago, Vancouver, EndNote, RIS)
- Author Search: Find articles by specific authors with co-author information
- Related Articles: Discover articles related to a specific PMID
- MeSH Term Search: Search and explore Medical Subject Headings
- Journal Analysis: Get metrics and recent articles from specific journals
- Research Trends: Analyze publication trends over time
- Article Comparison: Compare multiple articles side by side
- Caching: Built-in caching for improved performance
- Rate Limiting: Respectful API usage with configurable rate limits

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name PubMed MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- Python 3.8 or higher
- NCBI API key (free registration required)
- Valid email address for NCBI API identification

For development with additional tools:

make install-dev

Or manually:

pip install -r requirements.txt
pip install -e .
pip install black isort mypy flake8

1. Visit NCBI Account Settings
2. Sign in or create an account
3. Navigate to "API Key Management"
4. Create a new API key
5. Copy the key to your .env file

import asyncio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client

async def main():
server_params = StdioServerParameters(
command="python",
args=["-m", "src.main"]
)

async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:

bash

make docker-run PUBMED_API_KEY=your_key PUBMED_EMAIL=your_email
```

The server provides the following MCP tools:

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "pubmed mcp server": {
            "pubmed-mcp": {
                "command": "python",
                "args": [
                    "-m",
                    "src.main"
                ]
            }
        }
    }
}

McpServers

{
    "pubmed-mcp": {
        "command": "python",
        "args": [
            "-m",
            "src.main"
        ]
    }
}

CI

A comprehensive Model Context Protocol (MCP) server for PubMed literature search and management. This server provides advanced search capabilities, citation formatting, and research analysis tools through the MCP protocol.

<a href="https://glama.ai/mcp/servers/@chrismannina/pubmed-mcp">
PubMed Server MCP server
</a>

Features

- Advanced PubMed Search: Search with complex filters including date ranges, article types, authors, journals, and MeSH terms
- Article Details: Retrieve detailed information for specific PMIDs including abstracts, authors, and metadata
- Citation Export: Export citations in multiple formats (BibTeX, APA, MLA, Chicago, Vancouver, EndNote, RIS)
- Author Search: Find articles by specific authors with co-author information
- Related Articles: Discover articles related to a specific PMID
- MeSH Term Search: Search and explore Medical Subject Headings
- Journal Analysis: Get metrics and recent articles from specific journals
- Research Trends: Analyze publication trends over time
- Article Comparison: Compare multiple articles side by side
- Caching: Built-in caching for improved performance
- Rate Limiting: Respectful API usage with configurable rate limits

Installation

Prerequisites

- Python 3.8 or higher
- NCBI API key (free registration required)
- Valid email address for NCBI API identification

Quick Start

1. Clone the repository:

   git clone https://github.com/your-org/pubmed-mcp.git
cd pubmed-mcp

2. Install dependencies:

   pip install -r requirements.txt

3. Set up environment variables:

   cp env.example .env
# Edit .env with your NCBI API key and email

4. Run the server:

   python -m src.main

Development Installation

For development with additional tools:

make install-dev

Or manually:

pip install -r requirements.txt
pip install -e .
pip install black isort mypy flake8

Configuration

Create a .env file in the project root with the following variables:

```env

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.