UniProt MCP Server
A Model Context Protocol (MCP) server that provides seamless access to UniProtKB protein data. Query protein entries, sequences, Gene Ontology annotations, and perform ID mappings through a typed, resilient interface designed for LLM agents.
β¨ Features
π Dual Transport: Stdio for local development and Streamable HTTP for remote deployments
π Rich Data Access: Fetch complete protein entries with sequences, features, GO annotations, cross-references, and taxonomy
π Advanced Search: Full-text search with filtering by review status, organism, keywords, and more
π ID Mapping: Convert between 200+ database identifier types with progress tracking
π‘οΈ Production Ready: Automatic retries with exponential backoff, CORS support, Prometheus metrics
π Typed Responses: Structured Pydantic models ensure data consistency
π― MCP Primitives: Resources, tools, and prompts designed for agent workflows
π Quick Start
Installation
Run the Server
Local development (stdio):
Remote deployment (HTTP):
The HTTP server provides:
MCP endpoint:
http://localhost:8000/mcpHealth check:
http://localhost:8000/healthzMetrics:
http://localhost:8000/metrics(Prometheus format)
Test with MCP Inspector
π MCP Primitives
Resources
Access static or dynamic data through URI patterns:
URI | Description |
| Raw UniProtKB entry JSON for any accession |
| Documentation for search query syntax |
Tools
Execute actions and retrieve typed data:
Tool | Parameters | Returns | Description |
|
,
|
| Fetch complete protein entry with all annotations |
|
|
| Get protein sequence with length and metadata |
|
,
,
,
,
,
|
| Full-text search with advanced filtering |
|
,
,
|
| Convert identifiers between 200+ databases |
|
,
,
|
| Retrieve historical entry versions (txt/fasta) |
Progress tracking: map_ids reports progress (0.0 β 1.0) for long-running jobs.
Prompts
Pre-built templates for common workflows:
Summarize Protein: Generate a structured summary from a UniProt accession, including organism, function, GO terms, and notable features.
π§ Configuration
Environment Variables
Variable | Default | Description |
| unset | Request minimal field subsets to reduce payload size |
|
| Logging level:
,
,
,
|
|
| Log format:
or
|
|
| Max concurrent UniProt API requests |
|
| HTTP server bind address |
|
| HTTP server port |
|
| Uvicorn log level |
|
| Enable auto-reload:
or
|
|
| CORS allowed origins (comma-separated) |
|
| CORS allowed methods |
|
| CORS allowed headers |
CLI Flags
π Usage Examples
Fetching a Protein Entry
Searching for Proteins
Mapping Identifiers
π οΈ Development
Prerequisites
Python 3.11 or 3.12
uv (recommended) or pip
Setup
Running Tests
Code Quality
Local Development Server
ποΈ Architecture
π¦ Publishing
This server is published to:
PyPI: uniprot-mcp
MCP Registry: io.github.josefdc/uniprot-mcp
Building and Publishing
See docs/registry.md for detailed registry publishing instructions.
π€ Contributing
Contributions are welcome! Please:
Read our Contributing Guidelines
Follow our Code of Conduct
Check the Security Policy for vulnerability reporting
Review the Changelog for recent changes
Quick start for contributors:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Make your changes with tests
Run quality checks:
uv tool run ruff check . && uv tool run mypy src && uv run pytestCommit using Conventional Commits (
feat:,fix:,docs:, etc.)Push and open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
UniProt Consortium: For providing comprehensive, high-quality protein data through their REST API
Anthropic: For the Model Context Protocol specification and Python SDK
Community: For feedback, bug reports, and contributions
π Links
Documentation: GitHub Repository
UniProt API: REST API Documentation
MCP Specification: Model Context Protocol
Issues & Support: GitHub Issues
β οΈ Disclaimer
This is an independent project and is not officially affiliated with or endorsed by the UniProt Consortium. Please review UniProt's terms of use when using their data.
Built with β€οΈ for the bioinformatics and AI communities