UniProt MCP Server
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 Server fetch the protein entry for P12345"
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 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
Related MCP server: mcp-uniprot
π Quick Start
Installation
pip install uniprot-mcpRun the Server
Local development (stdio):
uniprot-mcpRemote deployment (HTTP):
uniprot-mcp-http --host 0.0.0.0 --port 8000The HTTP server provides:
MCP endpoint:
http://localhost:8000/mcpHealth check:
http://localhost:8000/healthzMetrics:
http://localhost:8000/metrics(Prometheus format)
Test with MCP Inspector
npx @modelcontextprotocol/inspector uniprot-mcpπ 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: |
|
| Max concurrent UniProt API requests |
|
| HTTP server bind address |
|
| HTTP server port |
|
| Uvicorn log level |
|
| Enable auto-reload: |
|
| CORS allowed origins (comma-separated) |
|
| CORS allowed methods |
|
| CORS allowed headers |
CLI Flags
# HTTP server flags
uniprot-mcp-http --host 127.0.0.1 --port 9000 --log-level debug --reloadπ Usage Examples
Fetching a Protein Entry
# Using MCP client
result = await session.call_tool("fetch_entry", {
"accession": "P12345"
})
# Returns structured Entry with:
# - primaryAccession, protein names, organism
# - sequence (length, mass, sequence string)
# - features (domains, modifications, variants)
# - GO annotations (biological process, molecular function, cellular component)
# - cross-references to other databasesSearching for Proteins
# Search reviewed human proteins
result = await session.call_tool("search_uniprot", {
"query": "kinase AND organism_id:9606",
"size": 50,
"reviewed_only": True,
"sort": "annotation_score"
})
# Returns list of SearchHit objects with accessions and scoresMapping Identifiers
# Convert UniProt IDs to PDB structures
result = await session.call_tool("map_ids", {
"from_db": "UniProtKB_AC-ID",
"to_db": "PDB",
"ids": ["P12345", "Q9Y6K9"]
})
# Returns MappingResult with successful and failed mappingsπ οΈ Development
Prerequisites
Python 3.11 or 3.12
uv (recommended) or pip
Setup
# Clone the repository
git clone https://github.com/josefdc/Uniprot-MCP.git
cd Uniprot-MCP
# Install dependencies
uv sync --group dev
# Install development tools
uv tool install ruff
uv tool install mypyRunning Tests
# Run all tests with coverage
uv run pytest --maxfail=1 --cov=uniprot_mcp --cov-report=term-missing
# Run specific test file
uv run pytest tests/unit/test_parsers.py -v
# Run integration tests only
uv run pytest tests/integration/ -vCode Quality
# Lint
uv tool run ruff check .
# Format
uv tool run ruff format .
# Type check
uv tool run mypy src
# Run all checks
uv tool run ruff check . && \
uv tool run ruff format --check . && \
uv tool run mypy src && \
uv run pytestLocal Development Server
# Stdio server
uv run uniprot-mcp
# HTTP server with auto-reload
uv run python -m uvicorn uniprot_mcp.http_app:app --reload --host 127.0.0.1 --port 8000ποΈ Architecture
src/uniprot_mcp/
βββ adapters/ # UniProt REST API client and response parsers
β βββ uniprot_client.py # HTTP client with retry logic
β βββ parsers.py # Transform UniProt JSON β Pydantic models
βββ models/
β βββ domain.py # Typed data models (Entry, Sequence, etc.)
βββ server.py # MCP stdio server (FastMCP)
βββ http_app.py # MCP HTTP server (Starlette + CORS)
βββ prompts.py # MCP prompt templates
βββ obs.py # Observability (logging, metrics)
tests/
βββ unit/ # Unit tests for parsers, models, tools
βββ integration/ # End-to-end tests with VCR fixtures
βββ fixtures/ # Test data (UniProt JSON responses)π¦ Publishing
This server is published to:
PyPI: uniprot-mcp
MCP Registry: io.github.josefdc/uniprot-mcp
Building and Publishing
# Build distribution packages
uv build
# Publish to PyPI (requires token)
uv publish --token pypi-YOUR_TOKEN
# Publish to MCP Registry (requires GitHub auth)
mcp-publisher login github
mcp-publisher publishSee 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
Available Tools
5 toolsfetch_entryC
Return a structured UniProt entry.
Inputs: accession (required), fields, version. Returns: Normalized UniProtKB entry.
fetch_entry_flatfileC
Return the UniProt flatfile (txt or fasta) for a specific entry version.
Inputs: accession (required), version (required), format. Returns: result
get_sequenceA
Return only the sequence metadata for an accession.
Inputs: accession (required). Returns: result
map_idsC
Map identifiers between UniProt-supported namespaces.
Inputs: from_db (required), to_db (required), ids (required). Returns: Outcome of UniProt ID mapping operations.
search_uniprotC
Search UniProtKB and return curated hits.
Inputs: query (required), size, reviewed_only, fields, +2 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: fetch_entry retrieves structured data, fetch_entry_flatfile provides flatfile formats, get_sequence focuses on sequence metadata, map_ids handles identifier mapping, and search_uniprot performs searches. There is no overlap or ambiguity between these functions.
The naming is mostly consistent with a verb_noun pattern (e.g., fetch_entry, get_sequence, map_ids, search_uniprot), but fetch_entry_flatfile deviates slightly by including an extra descriptor. Overall, the pattern is readable and predictable.
With 5 tools, this server is well-scoped for the UniProt domain. Each tool serves a specific, essential function without redundancy, making the count appropriate for typical use cases like data retrieval, mapping, and searching.
The toolset covers core operations for UniProt access: fetching entries in different formats, getting sequences, mapping IDs, and searching. A minor gap might be the lack of update or delete tools, but these are likely unnecessary for a read-only biological database, so agents can work effectively with the provided tools.
Maintenance
Related MCP Connectors
Search UniProtKB proteins, fetch entries by accession, query by gene or organism, and functions.
Protein research over UniProtKB: search by function, fetch curated records, map IDs, proteomes.
UniProt protein data: find proteins, map genes to proteins, function and disease links
UniProt MCP β protein sequence + function database.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables AI assistants to access protein information directly from UniProt, allowing retrieval of protein names, functions, sequences, and organism data by accession number.214MIT
- AlicenseNot gradedqualityCmaintenanceProvides access to UniProt protein sequence and function knowledge base, enabling search and retrieval of protein entries, proteomes, taxonomy, and feature annotations.67 npmMIT
- AlicenseBqualityDmaintenanceProvides seamless access to UniProtKB protein data, enabling querying of protein entries, sequences, Gene Ontology annotations, and ID mappings through a typed, resilient interface.5MIT
- FlicenseBqualityDmaintenanceProvides programmatic access to AlphaFold protein structure predictions and UniProt data, enabling users to retrieve protein structures, summaries, and annotations through natural language.3-