uniprot-mcp
The uniprot-mcp server provides a comprehensive interface to the UniProt REST API, enabling protein research and bioinformatics queries. Here's what it can do:
search_uniprotkb: Search UniProtKB using native query syntax (e.g., by gene name, organism, keyword, EC number). Supports filtering by reviewed status and organism taxonomy ID, with output as compact summaries, FASTA sequences, or TSV tables.get_entry: Retrieve detailed information for a single UniProtKB accession — including function, gene/protein names, subcellular location, domains, PTMs, keywords, and cross-references (PDB, AlphaFold, Ensembl, RefSeq, InterPro, GO). Formats: curated digest, full JSON, FASTA, flat-file (txt), or GFF.get_fasta: Fetch raw FASTA sequences for one or multiple UniProtKB accessions in a single batch call.map_ids: Convert identifiers between biological databases (e.g., RefSeq ↔ UniProtKB, UniProtKB → PDB, Ensembl → UniProtKB) via UniProt's async ID-mapping service. Returns mapped pairs and unmapped IDs.get_taxonomy: Resolve organism names (e.g., "human", "E. coli") or NCBI taxon IDs to taxon ID, scientific/common names, rank, and full lineage — useful for feeding organism IDs into protein searches.search_uniref: Search UniRef sequence-similarity clusters (UniRef100/90/50) to find groups of related proteins at different identity thresholds.search_proteomes: Search whole-organism protein sets (proteomes), filterable by organism taxonomy ID and reference proteome status, returning results as summaries or TSV.resource://uniprot/query-cheatsheet: A built-in reference resource documenting UniProtKB query syntax to help construct valid queries.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@uniprot-mcp search for human p53"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
uniprot-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-mcpThen point your MCP client at it (full config below):
{
"mcpServers": {
"uniprot": {
"command": "uvx",
"args": ["uniprotkb-mcp"],
"env": { "UNIPROT_MCP_CONTACT": "you@example.org" }
}
}
}Related MCP server: uniprot-unipressed-mcp
Tools
Tool | What it does |
| Search UniProtKB with native query syntax. |
| 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 |
| Raw FASTA for one accession or a batch. |
| Convert ids across databases via UniProt's async ID-mapping (e.g. |
| Resolve an organism name or taxon id → taxon id, names, rank, lineage. Turn "human" into |
| Search UniRef100/90/50 sequence-similarity clusters. |
| 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)
Install
git clone https://github.com/fzlzjerry/uniprot-mcp
cd uniprot-mcp
uv sync # creates .venv and installs fastmcp + httpxRun
# stdio server (what MCP clients launch):
uv run uniprotkb-mcpUniProt 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="you@example.org" uv run uniprotkb-mcpRun 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-mcpPin a version with uvx uniprotkb-mcp@0.1.0, 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": "you@example.org" }
}
}
}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": "you@example.org" }
}
}
}Or from the CLI:
# via uvx (published / git / local source):
claude mcp add uniprot -e UNIPROT_MCP_CONTACT=you@example.org -- uvx uniprotkb-mcp
# via a local checkout with uv:
claude mcp add uniprot -e UNIPROT_MCP_CONTACT=you@example.org \
-- uv run --directory /ABSOLUTE/PATH/TO/uniprot-mcp uniprotkb-mcpSmoke test
Exercises every tool against the live API and prints the output:
UNIPROT_MCP_CONTACT="you@example.org" uv run python -m tests.smokeDevelopment
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 testAvailable Tools
7 toolsget_entryA
Fetch one UniProtKB entry.
'summary' returns a clean digest: protein/gene names, organism, length, function, subcellular location, family/domains, key features, PTMs, keywords, and top cross-references (PDB, AlphaFold, Ensembl, RefSeq, InterPro, GO). Use 'json' for the complete record, 'fasta' for the sequence, 'txt' for the flat file, or 'gff' for feature coordinates.
Inputs: accession (required), format. Returns: result
get_fastaA
Return raw FASTA sequence(s) for one or more UniProtKB accessions.
A single accession uses the entry endpoint; a list uses the batch /accessions endpoint. Well-formed but unknown/obsolete accessions are dropped silently (a note reports the count discrepancy), but a malformed-format accession makes UniProt reject the whole request — so pass syntactically valid accessions.
Inputs: accessions (required). Returns: result
get_taxonomyA
Resolve a taxonomy name or id.
Pass a numeric taxon id to fetch that record, or a name to search. Returns the taxon id, scientific/common names, rank, and lineage — letting you turn an organism name into the organism_id used by search_uniprotkb.
Inputs: query_or_id (required). Returns: result
map_idsA
Map identifiers between databases via UniProt's async ID-mapping service.
Submits a job, polls until it finishes, then returns the mapped pairs plus
any unmapped input ids. When to_db is 'UniProtKB'/'UniProtKB-Swiss-Prot'
each result is enriched with the protein name, entry name, and organism.
Use 'UniProtKB_AC-ID' as from_db when starting from UniProt accessions.
Validates the database pair against the live UniProt config and, on an
invalid value, returns the allowed databases.
Inputs: from_db (required), to_db (required), ids (required). Returns: result
search_proteomesA
Search UniProt proteomes (the protein set of an organism's genome).
Returns the proteome id (UPID), organism, proteome type (Reference /
Non-reference / etc.), and protein/gene counts. Filter by organism_id and
set reference_only=True for reference proteomes.
Inputs: query, organism_id, reference_only, size, +1 more. Returns: result
search_uniprotkbA
Search UniProtKB and return matching protein entries.
Use this to find proteins by gene, name, organism, keyword, length, etc.
Returns a compact summary (accession, entry name, protein name, gene,
organism, length, Swiss-Prot/TrEMBL) by default. Pass reviewed=True to
restrict to curated Swiss-Prot entries, and organism_id to filter by
species. The total match count is always reported so you can page or narrow.
Inputs: query (required), reviewed, organism_id, fields, +2 more. Returns: result
search_unirefA
Search UniRef clusters (sequence-similarity clusters of UniProt proteins).
UniRef100/90/50 group sequences at 100/90/50% identity. Returns cluster id,
name, member/organism counts, and the representative member. Use identity
to restrict to one clustering level.
Inputs: query (required), identity, size, format. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Tools are mostly distinct, but get_entry and get_fasta have overlapping functionality for single-accession FASTA retrieval. However, the descriptions clearly differentiate them (single entry with multiple formats vs. raw FASTA for one or more accessions), so ambiguity is low.
All tool names follow a consistent verb_noun pattern with snake_case: get_* for retrieval and search_* for queries, plus map_ids. No deviations or mixed conventions.
Seven tools is well-scoped for a UniProt MCP server, covering core operations (entry retrieval, search, mapping, taxonomy, proteomes, clusters) without being too many or too few for the domain.
The tool set covers essential UniProtKB operations: retrieval (single entry, FASTA), searching (entries, proteomes, UniRef), ID mapping, and taxonomy resolution. No obvious gaps for typical read-only use cases.
Maintenance
Related MCP Connectors
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables language models to fetch protein information from the UniProt database, including protein details, sequences, functions, and structures.MIT
- AlicenseAqualityDmaintenanceAn MCP server that provides tools for searching and fetching protein data from the UniProt database using the unipressed library.2MIT
- AlicenseAqualityBmaintenanceA high-performance MCP server that gives LLMs access to 25 biomedical tools federated across 50+ upstream APIs for genes, variants, drugs, diseases, literature, clinical trials, and structural biology.43179 npm12Apache 2.0
- AlicenseAqualityAmaintenanceAn MCP server that gives AI assistants access to biological and biomedical RDF databases via SPARQL at the RDF Portal, as well as selected REST APIs (NCBI E-utilities, UniProt, ChEMBL, PDB, Reactome, Rhea, MeSH, and more).22921MIT