About Uniprot Mcp
Uniprot Mcp is an MCP server that exposes UniProt REST API functions to LLM clients. It supports protein and proteome searches, entry retrieval, FASTA access, identifier mapping, and taxonomy lookup, with compact summaries by default.
Key features
- 01Search UniProtKB, UniRef, and proteomes
- 02Retrieve entry details in multiple formats
- 03Fetch single or batch FASTA sequences
- 04Map identifiers across databases
- 05Resolve taxonomy names and IDs
- 06Query syntax cheat-sheet resource
Use cases
- 01Find reviewed proteins for an organism
- 02Retrieve sequence and annotation data for an accession
- 03Convert RefSeq or PDB identifiers to UniProtKB
- 04Search sequence-similarity clusters and proteomes
MCP support
Exposes UniProt REST API operations as MCP tools over stdio, plus a resource documenting UniProt query syntax.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEuniprot-mcp
GitHub repo:
fzlzjerry/uniprot-mcp· PyPI package & command:uniprotkb-mcp(the Python import package isuniprot_mcp).
A production-quality MCP server that exposes the UniProt REST API
to LLM clients (Claude Code, Claude Desktop, …) over stdio. Built with
FastMCP and managed with uv.
Tools return compact, token-efficient summaries by default and full payloads only on request, with robust error handling and an embedded UniProt query cheat-sheet so the model writes valid queries.
Quick start
Published on PyPI — no clone, no install needed:
uvx uniprotkb-mcp
Then point your MCP client at it (full config below):
{
"mcpServers": {
"uniprot": {
"command": "uvx",
"args": ["uniprotkb-mcp"],
"env": { "UNIPROT_MCP_CONTACT": "[email protected]" }
}
}
}
Tools
| Tool | What it does |
|---|---|
search_uniprotkb | Search UniProtKB with native query syntax. reviewed / organism_id filters are added for you. Summary, FASTA, or TSV output. |
get_entry | One entry as a curated digest (function, names, organism, length, subcellular location, family/domains, key features, PTMs, keywords, PDB/AlphaFold/Ensembl/RefSeq/InterPro/GO cross-refs) or json/fasta/txt/gff. |
get_fasta | Raw FASTA for one accession or a batch. |
map_ids | Convert ids across databases via UniProt's async ID-mapping (e.g. RefSeq_Protein→UniProtKB, UniProtKB_AC-ID→PDB). Returns mapped pairs and unmapped ids; validates the db pair against the live config. |
get_taxonomy | Resolve an organism name or taxon id → taxon id, names, rank, lineage. Turn "human" into organism_id:9606. |
search_uniref | Search UniRef100/90/50 sequence-similarity clusters. |
search_proteomes | Search proteomes (whole-organism protein sets); reference-proteome filter. |
Plus an MCP resource resource://uniprot/query-cheatsheet documenting the
UniProtKB query syntax (gene:, organism_id:, reviewed:true,
length:[X TO Y], keyword:, ec:, boolean AND/OR/NOT, …).
Requirements
- Python ≥ 3.10 (the repo pins 3.13 via
.python-version) uv
Install
git clone https://github.com/fzlzjerry/uniprot-mcp
cd uniprot-mcp
uv sync # creates .venv and installs fastmcp + httpx
Run
# stdio server (what MCP clients launch):
uv run uniprotkb-mcp
UniProt asks API clients to identify themselves with a contact address. Set one
via the UNIPROT_MCP_CONTACT environment variable (it goes into the
User-Agent); otherwise a placeholder is used.
UNIPROT_MCP_CONTACT="[email protected]" uv run uniprotkb-mcp
Run with uvx (no clone / no sync)
uvx (a.k.a. uv tool run) fetches, builds, and runs the console script in a
throwaway environment — nothing to install first. Pick whichever source you have:
# From PyPI (published):
uvx uniprotkb-mcp
# From a Git repo (note: repo is uniprot-mcp, command is uniprotkb-mcp):
uvx --from git+https://github.com/fzlzjerry/uniprot-mcp uniprotkb-mcp
# From a local checkout (this directory):
uvx --from /ABSOLUTE/PATH/TO/uniprot-mcp uniprotkb-mcp
# From a built wheel:
uvx --from ./dist/uniprotkb_mcp-0.1.0-py3-none-any.whl uniprotkb-mcp
Pin a version with uvx [email protected], or force a refresh of the cached
build with uvx --refresh --from <source> uniprotkb-mcp.
Register with Claude Desktop
Edit claude_desktop_config.json
(macOS: ~/Library/Application Support/Claude/claude_desktop_config.json,
Windows: %APPDATA%\Claude\claude_desktop_config.json) and add:
{
"mcpServers": {
"uniprot": {
"command": "uvx",
"args": ["uniprotkb-mcp"],
"env": { "UNIPROT_MCP_CONTACT": "[email protected]" }
}
}
}
This runs the published package straight from PyPI. To run unreleased code
instead, add a source: "args": ["--from", "git+https://github.com/fzlzjerry/uniprot-mcp", "uniprotkb-mcp"]
(git) or "args": ["--from", "/ABSOLUTE/PATH/TO/uniprot-mcp", "uniprotkb-mcp"]
(local checkout). Make sure uvx is on the PATH Claude Desktop sees (it ships
with uv; give the absolute path to uvx if needed, e.g. ~/.local/bin/uvx).
Restart Claude Desktop and the uniprot tools appear.
Prefer a cloned checkout instead of
uvx? Use"command": "uv", "args": ["run", "--directory", "/ABSOLUTE/PATH/TO/uniprot-mcp", "uniprotkb-mcp"].
Register with Claude Code
Project-scoped via a .mcp.json in your project root (same shape):
{
"mcpServers": {
"uniprot": {
"command": "uvx",
"args": ["uniprotkb-mcp"],
"env": { "UNIPROT_MCP_CONTACT": "[email protected]" }
}
}
}
Or from the CLI:
# via uvx (published / git / local source):
claude mcp add uniprot -e [email protected] -- uvx uniprotkb-mcp
# via a local checkout with uv:
claude mcp add uniprot -e [email protected] \
-- uv run --directory /ABSOLUTE/PATH/TO/uniprot-mcp uniprotkb-mcp
Smoke test
Exercises every tool against the live API and prints the output:
UNIPROT_MCP_CONTACT="[email protected]" uv run python -m tests.smoke
Development
Developing, testing, CI, and the release process (CI-driven PyPI Trusted
Publishing — no token) are documented in CONTRIBUTING.md.
TL;DR: uv sync, then uv run python -m tests.check_structure (offline) and
uv run python -m tests.smoke (live API).
Design notes
- Single shared
httpx.AsyncClientwith a descriptiveUser-Agentincluding your contact. - Retry/backoff on
429(honoringRetry-After) and5xx;400surfaces UniProt's own error message; no raw tracebacks reach the client (errors are raised asToolError). - Pagination via the
Linkheader /x-total-results; result sizes are capped (≤ 500) and the total is always reported so you can narrow or page. - ID mapping follows the real async flow:
POST /idmapping/run→ poll/idmapping/status/{job}(a303+Locationsignals completion) → fetch results, automatically choosing the enriched UniProtKB results endpoint vs. the simple-pair endpoint based on the target database.
Project layout
src/uniprot_mcp/
server.py # FastMCP instance, the 7 tools, cheat-sheet resource, main()
client.py # shared AsyncClient, retry/backoff, error mapping, header parsing
idmapping.py # async run/poll/results flow with target-aware routing
config.py # cached idmapping db config + from/to validation
formatting.py # JSON -> compact summary digests
cheatsheet.py # UniProt query cheat-sheet
tests/smoke.py # live-API smoke test
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.