UniProt MCP Server
The UniProt MCP Server provides access to protein function and sequence information from UniProt.
Fetch protein information: Retrieve details like protein name, function, sequence, length, and organism using a UniProt accession number.
Batch retrieval: Get information for multiple proteins at once by providing a list of accession numbers.
Caching: Improves performance with a 24-hour TTL cache.
Error handling: Manages invalid accessions, network issues, and rate limiting.
Integration: Works with AI assistants via the Model Context Protocol (MCP).
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 Serverget protein info for P04637"
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 access to UniProt protein information. This server allows AI assistants to fetch protein function and sequence information directly from UniProt.
Features
Search UniProtKB by protein name, gene name or keyword when the accession number is not known yet
Get protein information by UniProt accession number
Batch retrieval of multiple proteins
Get annotated sequence features with their positions: signal peptide, propeptide, mature chain, active and binding sites, disulfide bonds, domains, glycosylation, natural variants and mutagenesis
Get the available structures: PDB entries with method, resolution and covered residue ranges, plus the AlphaFold DB model
Caching for improved performance (24-hour TTL), shared across the tools that read the same entry
Error handling and logging
Related MCP server: UniProt MCP Server
Requirements
Python 3.10 or higher
MCP Python SDK 1.x (
mcp>=1.1,<2)
The MCP SDK's 2.0 release removed the
@server.list_tools()/@server.call_tool()decorators from the low-levelServerclass that this project is built on. Installed againstmcp2.x, the server raisesAttributeError: 'Server' object has no attribute 'list_tools'at startup, so the dependency is pinned to the 1.x line. Migrating to the 2.x server API is tracked separately.
Quick Start
Ensure you have Python 3.10 or higher installed
Clone this repository:
git clone https://github.com/TakumiY235/uniprot-mcp-server.git cd uniprot-mcp-serverInstall dependencies:
# Using uv (recommended) uv pip install -r requirements.txt # Or using pip pip install -r requirements.txt
Configuration
Add to your Claude Desktop config file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"uniprot": {
"command": "uv",
"args": ["--directory", "path/to/uniprot-mcp-server", "run", "uniprot-mcp-server"]
}
}
}Usage Examples
After configuring the server in Claude Desktop, you can ask questions like:
Can you get the protein information for UniProt accession number P98160?For batch queries:
Can you get and compare the protein information for both P04637 and P02747?When you do not have an accession number to hand:
Find the reviewed human phospholipase A2 entries and show me their lengths.Before designing a construct or a variant panel, to get the boundaries and the residues that have to be respected:
What are the signal peptide, propeptide and mature chain boundaries of P04054,
and where are its active sites and disulfide bonds?To find a structure to work from:
Which PDB structures cover P04054, and at what resolution?API Reference
Tools
get_protein_infoGet information for a single protein
Required parameter:
accession(UniProt accession number)Example response:
{ "accession": "P12345", "protein_name": "Example protein", "function": ["Description of protein function"], "sequence": "MLTVX...", "length": 123, "organism": "Homo sapiens" }
get_batch_protein_infoGet information for multiple proteins
Required parameter:
accessions(array of UniProt accession numbers)Returns an array of protein information objects
A lookup that fails is reported per accession, so one bad entry does not lose the rest of the batch
search_proteinsFind entries when the accession number is not known yet
Required parameter:
query(search terms; UniProt query syntax is accepted, e.g.gene:PLA2G1B)Optional:
organism_id(NCBI taxonomy ID, e.g.9606for human),reviewed_only(defaulttrue, Swiss-Prot only),limit(1-50, default 10)Sequences are not included, so a result list stays small
Example response:
{ "count": 1, "results": [ { "accession": "P04054", "entry_name": "PA2GA_HUMAN", "protein_name": "Phospholipase A2", "gene_names": ["PLA2G1B"], "organism": "Homo sapiens", "taxon_id": 9606, "length": 148, "reviewed": true } ] }
get_protein_featuresGet the annotated sequence features with 1-based inclusive positions
Required parameter:
accessionOptional:
types(keep only these feature types, matched case-insensitively, e.g.["Active site", "Disulfide bond"]),include_secondary_structure(defaultfalse)Secondary structure (
Helix,Beta strand,Turn) is reported per element, so an entry carries dozens of them and they say nothing a sequence-design decision needs. They are withheld unlessinclude_secondary_structureis set or they are named intypes.Example response:
{ "accession": "P04054", "length": 148, "feature_counts": {"Signal": 1, "Propeptide": 1, "Chain": 1, "Active site": 2, "Disulfide bond": 7}, "features": [ {"type": "Signal", "start": 1, "end": 15, "description": ""}, {"type": "Propeptide", "start": 16, "end": 22, "description": "Activation peptide"}, {"type": "Chain", "start": 23, "end": 148, "description": "Phospholipase A2"} ] }Features are ordered by position. A feature whose position UniProt leaves unset reports
nulland sorts last.
get_protein_structuresGet the structures available for a protein
Required parameter:
accessionExample response:
{ "accession": "P04054", "pdb_entries": [ {"pdb_id": "3ELO", "method": "X-ray", "resolution": "1.55 A", "chains": "A=16-148"}, {"pdb_id": "6Q42", "method": "X-ray", "resolution": "1.90 A", "chains": "A/B=23-148"} ], "alphafold_id": "P04054" }A protein with no solved structure reports an empty list and a null
alphafold_idrather than an error
get_protein_info, get_protein_features and get_protein_structures read
different parts of the same UniProt entry, so they share one cached request per
accession: asking for all three costs a single round trip.
Development
Setting up development environment
Clone the repository
Create a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activateInstall development dependencies:
pip install -e ".[dev]"
Running tests
pytestCode style
This project uses:
Black for code formatting
isort for import sorting
flake8 for linting
mypy for type checking
bandit for security checks
pip-audit for dependency vulnerability checks
Run all checks:
black .
isort .
flake8 .
mypy .
bandit -r src/
pip-audit .Technical Details
Built using the MCP Python SDK
Uses httpx for async HTTP requests
Implements caching with 24-hour TTL using an OrderedDict-based cache
Bounds every UniProt request with a timeout (10s connect, 30s total)
Surfaces UniProt API errors - including 429 rate limiting - as tool errors; there is no automatic retry or backoff
Provides detailed error messages
Error Handling
The server handles various error scenarios:
Invalid accession numbers (UniProt answers with 400, not 404)
API connection issues (network errors)
Rate limiting (429 responses) - reported to the caller, not retried
Malformed responses (JSON parsing errors)
Cache management (TTL and size limits)
Contributing
We welcome contributions! Please feel free to submit a Pull Request. Here's how you can contribute:
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Please make sure to update tests as appropriate and adhere to the existing coding style.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
UniProt for providing the protein data API
Anthropic for the Model Context Protocol specification
Contributors who help improve this project
Available Tools
2 toolsget_batch_protein_infoB
Get protein information for multiple accession No.
| Name | Required | Description | Default |
|---|---|---|---|
| accessions | Yes | List of UniProt accession No. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden but lacks behavioral details. It doesn't disclose whether this is a read-only operation, potential rate limits, authentication needs, or what 'protein information' includes (e.g., format, fields). The description is minimal and adds little beyond the basic action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no wasted words, clearly front-loading the purpose. It is appropriately sized for a simple tool with one parameter.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations and no output schema, the description is incomplete. It doesn't explain what 'protein information' entails, potential errors, or behavioral traits, leaving significant gaps for a tool that presumably returns complex data.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with the parameter 'accessions' documented as 'List of UniProt accession No.' in the schema. The description adds no additional meaning beyond this, such as format examples, constraints, or usage tips, so it meets the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get protein information') and the resource ('multiple accession No.'), making the purpose understandable. It distinguishes from the sibling tool 'get_protein_info' by specifying 'multiple' vs. presumably single, though not explicitly naming the alternative.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when multiple accession numbers are needed, but provides no explicit guidance on when to use this vs. the sibling tool 'get_protein_info' (e.g., for bulk vs. single queries). No exclusions or prerequisites are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_protein_infoB
Get protein function and sequence information from UniProt using an accession No.
| Name | Required | Description | Default |
|---|---|---|---|
| accession | Yes | UniProt Accession No. (e.g., P12345) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It mentions the data source (UniProt) and type of information, but lacks details on behavioral traits like rate limits, error handling, authentication needs, or response format. This is a significant gap for a tool with no annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the purpose without unnecessary words. Every part of the sentence contributes to understanding the tool's function.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations and no output schema, the description is incomplete. It does not explain what the return values look like (e.g., format of function and sequence information), error cases, or other contextual details needed for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, with the parameter 'accession' well-documented in the schema. The description adds minimal value by mentioning 'UniProt Accession No.' and providing an example, but does not elaborate beyond what the schema already specifies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get') and resource ('protein function and sequence information from UniProt'), specifying the data source and type of information retrieved. It distinguishes from the sibling tool 'get_batch_protein_info' by implying this is for single proteins, though not explicitly contrasting them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when you have a UniProt accession number and need protein details, but does not explicitly state when to use this versus the sibling batch tool or other alternatives. No exclusions or prerequisites are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
- First observed
get_batch_protein_info - First observed
get_protein_info
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: get_protein_info retrieves detailed function and sequence information for a single protein accession, while get_batch_protein_info handles multiple accessions in batch. There is no overlap or ambiguity in their functions.
Both tools follow a consistent verb_noun pattern with 'get_' prefix and snake_case naming. The naming clearly indicates the action (get) and target (protein_info), with batch differentiation for the multi-accession tool.
With only two tools, the server feels severely under-scoped for a UniProt domain. While the tools cover basic retrieval, there are obvious gaps for operations like searching, filtering, or accessing related data (e.g., taxonomy, structures), making the surface too thin for comprehensive protein information workflows.
The server is severely incomplete for UniProt functionality. It only provides protein information retrieval (single and batch), missing essential operations like search_by_keyword, get_taxonomy, get_structure, or update tracking. This will cause agent failures when trying to perform typical bioinformatics tasks beyond simple lookups.
Maintenance
Related MCP Connectors
Give AI assistants access to real-time data. Search the web, compare flights, find hotels, and more.
Provide AI assistants with real-time access to official SEC EDGAR filings and financial data. Enab…
Enable AI assistants to perform web searches using Perplexity's Sonar Pro.
Live data gateway for AI — 3,300+ tools across 750+ sources, with citations
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
- AlicenseBqualityDmaintenanceProvides seamless access to UniProtKB protein database, enabling queries for protein entries, sequences, Gene Ontology annotations, full-text search, and ID mapping across 200+ database types.521 PyPI2MIT
- AlicenseNot gradedqualityBmaintenanceProvides access to UniProt protein sequence and function knowledge base, enabling search and retrieval of protein entries, proteomes, taxonomy, and feature annotations.31 npmMIT
- FlicenseBqualityDmaintenanceProvides programmatic access to AlphaFold protein structure predictions and UniProt data, enabling users to retrieve protein structures, summaries, and annotations through natural language.3-