UniProt MCP Server: Sequences, Annotations, Taxonomy
Access UniProt protein sequences, functional annotations, taxonomy and cross-references via the MCP server for proteomics and bioinformatics research.
npx -y @QuentinCody/uniprot-mcp-serverOverview
The UniProt MCP Server exposes UniProt protein sequences, functional annotations, taxonomy data, and cross-references through a lightweight Model Context Protocol (MCP) compatible API. It is intended for bioinformatics and proteomics pipelines that need programmatic, high-throughput access to canonical and isoform sequences, Gene Ontology terms, enzymatic (EC) annotations, taxonomic identifiers, and links to external resources such as PDB and Ensembl.
Running a local MCP server that proxies and caches UniProt data reduces reliance on remote rate-limited APIs, simplifies reproducible analysis, and lets downstream tools request context payloads in a stable, JSON-based format required by many modern model serving and data-integration workflows.
Features
- Retrieve UniProt protein sequences (canonical and isoforms) by accession or identifier
- Fetch functional annotations: GO terms, EC numbers, keywords, and domain descriptions
- Lookup taxonomy information (scientific name, lineage, taxid) for proteins and organisms
- Expose cross-references to external resources (PDB, Ensembl, RefSeq, KEGG)
- Full-text search endpoint for name/keyword/accession queries
- Lightweight caching layer to reduce repeated remote lookups and speed pipelines
- Standard MCP metadata and content negotiation (JSON) for easy integration
- Health and metrics endpoints for orchestration and monitoring
- CORS support for web-based tools and notebooks
Installation / Configuration
Prerequisites: Docker (recommended) or Node.js / Python runtime if building from source.
Clone the repository and run via Docker:
# Build and run with Docker
Example .env (for local development):
PORT=8080
UNIPROT_API_BASE=
CACHE_DIR=./cache
CACHE_TTL_SECONDS=86400
LOG_LEVEL=info
CORS=true
If the project provides a package.json or requirements.txt, install dependencies and run directly:
Node.js
Python (if applicable)
Adjust environment variables to point at a custom UniProt mirror or to tune cache behavior.
Available Resources
Common HTTP endpoints (examples):
| Endpoint | Method | Description |
|---|---|---|
| /health | GET | Liveness and readiness check |
| /metrics | GET | Prometheus-style metrics (if enabled) |
| /mcp/metadata | GET | MCP service metadata |
| /sequences/:accession | GET | Return sequence (FASTA/JSON) for accession |
| /annotations/:accession | GET | Functional annotation payload for accession |
| /taxonomy/:taxid | GET | Taxonomy record (name, lineage, rank) |
| /search?q=… | GET | Full-text search across entries |
| /xref/:accession | GET | Cross-reference map for accession |
OpenAPI / Swagger: check /openapi.json or /docs (if included) to explore the API schema and try endpoints interactively.
Client libraries / examples: the repo may include short example clients in JavaScript and Python for fetching MCP payloads and parsing responses.
Use Cases
Proteomics FASTA generation
- Query a list of UniProt accessions and pull canonical sequences as FASTA for database search engines (e.g., MSFragger, MaxQuant).
- Example:
# returns FASTA for accession P31946
Functional enrichment and annotation
- Fetch GO, EC, and keyword annotations for a protein set, then aggregate counts for enrichment analysis.
- Example:
|
Taxonomy-aware filtering
- Limit searches and sequence retrievals to a specific taxid or lineage (e.g., bacteria-only databases).
- Example search:
|
Cross-reference mapping for multi-omics
- Retrieve links to PDB, Ensembl, and RefSeq to crosswalk protein identifers across datasets.
- Example:
|
Integration with model-driven tools
- Use MCP metadata and standardized payloads to feed context into downstream ML models or annotation pipelines that expect MCP-compatible inputs.
Tips for Developers
- Use the cache when running bulk queries to avoid hitting UniProt rate limits; tune CACHE_TTL_SECONDS according to update frequency needs.
- Normalize incoming accession inputs (trim spaces, uppercase) before requesting to avoid errors.
- When integrating with orchestration systems (Kubernetes, Airflow), wire the /health endpoint for readiness probes and expose /metrics for monitoring.
- For reproducible analyses, snapshot cache files alongside your workflow inputs so sequence/annotation sets are versioned.
For the latest code, issues, and contribution guidelines, see the project repository: https://github.com/QuentinCody/uniprot-mcp-server.