NCBI Entrez MCP Server for PubMed, Genes
Access biomedical data via MCP server for NCBI Entrez: search PubMed, genes, proteins and more using E-utilities for research and analysis.
npx -y @QuentinCody/entrez-mcp-serverOverview
The NCBI Entrez MCP Server exposes NCBI Entrez (PubMed, Genes, Proteins and related databases) through a Model Context Protocol (MCP)–compatible HTTP interface. It wraps Entrez E-utilities (ESearch, ESummary, EFetch, ELink, etc.) and presents them as discoverable tools that can be invoked directly by LLM agents or other automated clients. This makes it easy to integrate biomedical literature and sequence metadata into downstream analysis workflows or tool-enabled language models without direct handling of XML responses or E-utilities URL composition.
The server is useful when you want programmatic, reproducible access to Entrez datasets and prefer a JSON-friendly, tool-oriented interface. It manages common concerns such as API key configuration, rate-limiting control, optional caching, and returning concise, parsed summaries suitable for prompt contexts or structured pipelines.
Features
- MCP-compliant discovery endpoint that returns a toolset describing available Entrez operations
- Wraps core NCBI E-utilities: ESearch, ESummary, EFetch, ELink
- Support for PubMed, Gene, Protein, Nucleotide and other Entrez databases
- Query parameter mapping and pagination support (retstart/retmax)
- Optional caching and configurable cache TTL to reduce repeated calls
- API key support via environment variable to increase rate limits
- JSON responses and parsed summaries to simplify downstream use
- Lightweight HTTP server deployable via Docker or as a local process
Installation / Configuration
Clone the repository and run with Docker (recommended) or install locally.
Using Docker (example)
# Build and run (example)
# Build image (if Dockerfile present)
# Run with environment variables
Using Node / npm (if project is Node-based)
# set env vars and run
Configuration environment variables
PORT # HTTP port to listen on (default: 8080)
NCBI_API_KEY # Optional NCBI API key to increase rate limits
CACHE_TTL # Cache time-to-live in seconds (optional)
LOG_LEVEL # Logging verbosity (info/debug)
Adjust configuration files or command-line flags as provided by the repository README.
Available Resources
The server exposes a small set of MCP-discoverable tools that correspond to Entrez operations. Typical endpoints:
| Tool name | Purpose | Example backend |
|---|---|---|
| esearch | Search a database for IDs matching a query | ESearch |
| esummary | Retrieve summaries for given IDs | ESummary |
| efetch | Fetch full records (XML/FASTA/etc.) | EFetch |
| elink | Follow links between Entrez databases | ELink |
| discover | MCP discovery document listing tools | /mcp/discover |
Discovery endpoint (returns MCP tool descriptors):
Search/search-result endpoint (JSON):
Use Cases
- Search PubMed for recent papers and fetch summaries
# Find PMIDs for "single-cell RNA-seq"
# Get summaries for returned PMIDs
- Retrieve gene summaries for downstream annotation
# Search for a gene by symbol
# Fetch gene summary
- Integrate with an LLM tool loop
- The MCP discovery endpoint exposes tool metadata the model can use to plan actions (search → summarize → fetch full records).
- Use the esearch tool to produce candidate IDs, then call efetch to obtain full records for extraction or citation generation.
- Batch retrieval and caching
- For systematic reviews or pipelines that re-query the same set of PMIDs, enable CACHE_TTL to reduce NCBI requests and improve throughput.
Notes and Best Practices
- Provide an NCBI API key (NCBI_API_KEY) for higher request quota when running programmatically.
- Respect NCBI usage policies and rate limits; the server exposes controls to throttle or cache calls.
- Use esummary for compact metadata (titles, authors, abstracts summary) and efetch when full XML/FASTA records are required.
- Inspect the MCP discovery document to understand tool argument schemas and response formats before integrating into an LLM agent.
Repository and source code
- GitHub: https://github.com/QuentinCody/entrez-mcp-server
Tags: database, search