PubMed Searcher MCP server

Search, retrieve, and analyze scientific literature from PubMed with capabilities for identifying research trends and generating statistical reports.
Back to servers
Provider
Darkroaster
Release date
Apr 06, 2025
Language
Python
Stats
53 stars

PubMed Analysis MCP Server is a specialized tool that helps researchers analyze medical literature from PubMed. It retrieves and processes literature data to identify research hotspots, track publication trends, and generate comprehensive analysis reports about medical research dynamics.

Features

  • Literature Retrieval: Supports PubMed advanced search syntax with date range filtering
  • Hotspot Analysis: Analyzes keyword frequencies to identify popular research areas
  • Trend Tracking: Tracks keyword changes over time to reveal evolving research trends
  • Publication Count: Analyzes publication volume changes with customizable time periods
  • Comprehensive Reports: Generates complete analytical reports with customizable parameters

Installation

Setting Up the Environment

It's recommended to use uv virtual environment for installation:

# In the project root directory:
uv pip install -e .

Configuring the MCP Server

Create or modify your mcp.json file with the following configuration (for Windows):

{
  "mcpServers": {
    "pubmearch": {
      "command": "cmd",
      "args": [
        "/c",
        "uv",
        "run",
        "--directory",
        "path/to/project/root/directory",
        "-m",
        "pubmearch.server"
      ],
      "env": {
        "NCBI_USER_EMAIL": "[email protected]",
        "NCBI_USER_API_KEY": "your_api_key"
      }
    }
  }
}

Getting a PubMed API Key

  1. Log in to the PubMed website
  2. Click on your profile picture and select "Account Settings"
  3. Scroll down to the "API Keys" section and click "Create API Key"

Usage

The MCP server provides several tools for analyzing PubMed literature:

1. Searching PubMed

Use the search_pubmed tool to retrieve and save search results.

Key parameters:

  • advanced_search: PubMed search query (required, uses advanced search syntax)
  • start_date: Start date (format: YYYY/MM/DD)
  • end_date: End date (format: YYYY/MM/DD)
  • max_results: Maximum results (default: 1000)

2. Listing Result Files

Use list_result_files tool to see available result files from previous searches.

3. Analyzing Research Keywords

The analyze_research_keywords tool identifies research hotspots and trends.

Key parameters:

  • top_n: Number of keywords to analyze (default: 20)

4. Analyzing Publication Counts

Use analyze_publication_count to examine how publication frequency changes over time.

5. Generating Comprehensive Analysis

The generate_comprehensive_analysis tool creates full reports combining multiple analyses.

Example LLM Prompts

When using with language models in agent mode, it's recommended to use advanced search syntax:

Help me analyze the research hotspots on prostate cancer immunotherapy in the past three months. The advanced search query is ((prostat*[Title/Abstract]) AND (cancer[Title/Abstract])) AND (immu*[Title/Abstract]).

Important Notes

  • Search results are saved in the pubmearch/results directory
  • Logs are stored in pubmed_server.log
  • Always follow NCBI's API usage policies

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later