uniprot mcp server
Enables AI assistants to access protein information directly from UniProt, allowing retrieval of protein names, functions, sequences, and organism data by accession number.
Enables AI assistants to access protein information directly from UniProt, allowing retrieval of protein names, functions, sequences, and organism data by accession number.
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.
git clone https://github.com/TakumiY235/uniprot-mcp-server.git
cd uniprot-mcp-server
# Using uv (recommended)
uv pip install -r requirements.txt
# Or using pip
pip install -r requirements.txt
Add to your Claude Desktop config file:
%APPDATA%Claudeclaude_desktop_config.json
~/Library/Application Support/Claude/claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"uniprot": {
"command": "uv",
"args": ["--directory", "path/to/uniprot-mcp-server", "run", "uniprot-mcp-server"]
}
}
}
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?
get_protein_info
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_info
accessions
(array of UniProt accession numbers)python -m venv .venv
source .venv/bin/activate # On Windows: .venvScriptsactivate
pip install -e ".[dev]"
pytest
This project uses: - Black for code formatting - isort for import sorting - flake8 for linting - mypy for type checking - bandit for security checks - safety for dependency vulnerability checks
Run all checks:
black .
isort .
flake8 .
mypy .
bandit -r src/
safety check
The server handles various error scenarios: - Invalid accession numbers (404 responses) - API connection issues (network errors) - Rate limiting (429 responses) - Malformed responses (JSON parsing errors) - Cache management (TTL and size limits)
We welcome contributions! Please feel free to submit a Pull Request. Here's how you can contribute:
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)Please make sure to update tests as appropriate and adhere to the existing coding style.
This project is licensed under the MIT License - see the LICENSE file for details.
[
{
"description": "Get protein function and sequence information from UniProt using an accession No.",
"inputSchema": {
"properties": {
"accession": {
"description": "UniProt Accession No. (e.g., P12345)",
"type": "string"
}
},
"required": [
"accession"
],
"type": "object"
},
"name": "get_protein_info"
},
{
"description": "Get protein information for multiple accession No.",
"inputSchema": {
"properties": {
"accessions": {
"description": "List of UniProt accession No.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"accessions"
],
"type": "object"
},
"name": "get_batch_protein_info"
}
]