MCP server for the NCBI Entrez E-utilities APIs.
This repository is set up to expose the current nine E-utilities as MCP tools, then add a small workflow layer for common agent tasks such as search-then-summary and search-then-fetch.
These tools are intended to map closely to the underlying NCBI E-utilities.
| MCP tool | Backing utility | Purpose |
|---|---|---|
eutils_info |
EInfo |
Discover databases, fields, links, and database metadata. |
eutils_search |
ESearch |
Search an Entrez database and return UIDs and optional history tokens. |
eutils_post |
EPost |
Upload UIDs to the Entrez History server. |
eutils_summary |
ESummary |
Retrieve document summaries for UIDs or history-backed result sets. |
eutils_fetch |
EFetch |
Retrieve full records in supported rettype and retmode formats. |
eutils_link |
ELink |
Traverse related records across or within databases. |
eutils_global_query |
EGQuery |
Run a cross-database query and return counts by database. |
eutils_spell |
ESpell |
Retrieve spelling suggestions for a query. |
eutils_citation_match |
ECitMatch |
Resolve citation strings to PubMed identifiers. |
These are convenience tools built on top of the core layer.
| MCP tool | Purpose |
|---|---|
eutils_search_and_summary |
Search a database and immediately summarize the matching records. |
eutils_search_and_fetch |
Search a database and immediately fetch the matching records. |
eutils_find_related |
Search or summarize a source set, then follow links to related records in a target database. |
- Prefer live database validation through
EInfoinstead of a hardcoded database list. - Support either direct identifiers (
ids) or Entrez History inputs (webenv,query_key) when a utility allows both. - Return both concise text and structured JSON-friendly data.
- Preserve raw upstream payloads when requested with
include_raw. - Include actionable error messages for invalid
db, unsupported format combinations, or empty result sets.
Purpose: inspect database metadata and supported search fields.
Key inputs:
db: optional database name; omitted means list databases.version: optional2.0support for richer field metadata.
Structured output:
databasesdb_infofieldslinks
Purpose: execute Entrez searches and optionally store results on the History server.
Key inputs:
dbtermretstartretmaxsortusehistoryfielddatetypemindatemaxdatereldateidtype
Structured output:
countidsquery_translationtranslation_stackretstartretmaxhistory
Purpose: upload UID lists to the History server for downstream calls.
Key inputs:
dbids
Structured output:
query_keywebenvcount
Purpose: retrieve compact summaries for records.
Key inputs:
dbidswebenvquery_keyretstartretmaxversion
Structured output:
dbresult_countsummaries
Purpose: retrieve full records from a database.
Key inputs:
dbidswebenvquery_keyrettyperetmoderetstartretmax
Structured output:
dbrecord_countformatrecordsorraw_payload
Purpose: retrieve related records or neighbor history sets.
Key inputs:
dbfromdbidswebenvquery_keylinknamecmd
Structured output:
source_dbtarget_dblinksetshistory
Purpose: search globally and compare counts across databases.
Key inputs:
term
Structured output:
termresults
Purpose: suggest corrected query text.
Key inputs:
dbterm
Structured output:
querycorrected_queryreplaced
Purpose: match citation strings to PubMed records.
Key inputs:
citationsraw
Structured output:
matchesunmatched
mcp-server-ncbi-eutils/
|-- README.md
|-- app.yaml
|-- main.py
|-- pyproject.toml
`-- src/
`-- eutils_server/
|-- __init__.py
|-- app.py
|-- routes.py
|-- client.py
|-- constants/
| |-- __init__.py
| `-- eutils.py
|-- models/
| |-- __init__.py
| |-- common.py
| `-- tool_specs.py
`-- tools/
|-- __init__.py
|-- core.py
`-- workflows.py
- Package structure scaffolded
- Health route scaffolded
- Tool names and responsibilities specified
client.pyimplemented with shared request handling, throttling, and retry logiceutils_info,eutils_search,eutils_summary, andeutils_fetchimplementedeutils_post,eutils_link,eutils_global_query,eutils_spell, andeutils_citation_matchimplementedeutils_global_querycurrently parses the live NCBIgqueryHTML results page as a compatibility layereutils_search_and_summary,eutils_search_and_fetch, andeutils_find_relatedimplemented
- Expand normalization for non-PubMed databases and more
EFetchformat combinations. - Refine edge-case handling for
ELinkhistory outputs andECitMatchnon-match statuses. - Add richer result shaping for workflow outputs when models need more compact summaries.