Get the FREE Ultimate OpenClaw Setup Guide →

pubmed

pubmed mcp server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio hanxuanliang-pubmed-mcp-server uvx main.py \
  --env DOWNLOAD_PATH="Path to store PDFs (default: /tmp/pubmed-pdfs)"

How to use

PubMed MCP Server provides a FastAPI-based MCP interface to search PubMed, retrieve article metadata, and download PMC PDFs. It exposes endpoints that allow clients to search PubMed by keywords, fetch detailed information for specific PubMed IDs (including title, abstract, authors, and keywords), and download related PMC article PDFs to a local directory specified by configuration. The server is designed to be used with an MCP client, which can configure the PubMed endpoint and consume data via the provided API in SSE mode for streaming updates or results. Typical usage involves running the server locally, then querying the search endpoint with a keyword to retrieve a list of articles, followed by requesting metadata for a chosen article and initiating a PDF download to the configured path.

How to install

Prerequisites:

  • Python 3.12+ installed
  • Internet access to install dependencies

Installation steps:

  1. Clone the repository
git clone https://github.com/yourusername/pubmed-mcp-server.git
cd pubmed-mcp-server
  1. Create and activate a Python environment and install uv as described in the project
pip install uv
  1. Install project dependencies (via pyproject.toml)
pip install -r <requirements-if-any.txt> || python -m pip install .
  1. Configure environment variables
# Create a config file or set environment variables as needed
echo "DOWNLOAD_PATH=/path/to/store/pdfs" > .env
  1. Run the server using uv
uv run main.py
  1. Verify the server is running at http://localhost:8977

Additional notes

Environment variable DOWNLOAD_PATH controls where downloaded PDFs are stored; if not set, the default is /tmp/pubmed-pdfs. Ensure network access to PubMed/PubMed Central services. The server runs on port 8977 by default, so if you have a firewall or proxy, adjust rules accordingly. If you encounter issues with dependencies, recreate the virtual environment with uv sync and install the required packages from pyproject.toml. When using the MCP client, configure the PubMed endpoint URL and enable SSE if supported for streaming results.

Related MCP Servers

Sponsor this space

Reach thousands of developers