UniProt logo

UniProt

Community
josefdc

UniProt MCP Server - Access comprehensive protein data via Model Context Protocol. Search, retrieve, and analyze UniProt entries with full-text search, ID mapping, and rich metadata. Supports stdio & HTTP transports for Claude Desktop and custom integrations.

Publisherjosefdc
RepositoryUniprot-MCP
LanguagePython
Forks
2
Stars
2
Available tools
5
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    UniProt exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 5 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    2 stars and 2 forks from the linked repository.

UniProt MCP Server

PyPI version Python versions License: MIT MCP Registry

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

bash
pip install uniprot-mcp

Run the Server

Local development (stdio):

bash
uniprot-mcp

Remote deployment (HTTP):

bash
uniprot-mcp-http --host 0.0.0.0 --port 8000

The HTTP server provides:

  • MCP endpoint: http://localhost:8000/mcp
  • Health check: http://localhost:8000/healthz
  • Metrics: http://localhost:8000/metrics (Prometheus format)

Test with MCP Inspector

bash
npx @modelcontextprotocol/inspector uniprot-mcp

📚 MCP Primitives

Resources

Access static or dynamic data through URI patterns:

URIDescription
uniprot://uniprotkb/{accession}Raw UniProtKB entry JSON for any accession
uniprot://help/searchDocumentation for search query syntax

Tools

Execute actions and retrieve typed data:

ToolParametersReturnsDescription
fetch_entryaccession, fields?EntryFetch complete protein entry with all annotations
get_sequenceaccessionSequenceGet protein sequence with length and metadata
search_uniprotquery, size, reviewed_only, fields?, sort?, include_isoformSearchHit[]Full-text search with advanced filtering
map_idsfrom_db, to_db, idsMappingResultConvert identifiers between 200+ databases
fetch_entry_flatfileaccession, version, formatstringRetrieve 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

VariableDefaultDescription
UNIPROT_ENABLE_FIELDSunsetRequest minimal field subsets to reduce payload size
UNIPROT_LOG_LEVELinfoLogging level: debug, info, warning, error
UNIPROT_LOG_FORMATplainLog format: plain or json
UNIPROT_MAX_CONCURRENCY8Max concurrent UniProt API requests
MCP_HTTP_HOST0.0.0.0HTTP server bind address
MCP_HTTP_PORT8000HTTP server port
MCP_HTTP_LOG_LEVELinfoUvicorn log level
MCP_HTTP_RELOAD0Enable auto-reload: 1 or true
MCP_CORS_ALLOW_ORIGINS*CORS allowed origins (comma-separated)
MCP_CORS_ALLOW_METHODSGET,POST,DELETECORS allowed methods
MCP_CORS_ALLOW_HEADERS*CORS allowed headers

CLI Flags

bash
# HTTP server flags
uniprot-mcp-http --host 127.0.0.1 --port 9000 --log-level debug --reload

📖 Usage Examples

Fetching a Protein Entry

python
# 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 databases

Searching for Proteins

python
# 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 scores

Mapping Identifiers

python
# 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

bash
# 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 mypy

Running Tests

bash
# 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/ -v

Code Quality

bash
# 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 pytest

Local Development Server

bash
# 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:

Building and Publishing

bash
# 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 publish

See docs/registry.md for detailed registry publishing instructions.

🤝 Contributing

Contributions are welcome! Please:

  1. Read our Contributing Guidelines
  2. Follow our Code of Conduct
  3. Check the Security Policy for vulnerability reporting
  4. Review the Changelog for recent changes

Quick start for contributors:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes with tests
  4. Run quality checks: uv tool run ruff check . && uv tool run mypy src && uv run pytest
  5. Commit using Conventional Commits (feat:, fix:, docs:, etc.)
  6. 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

⚠️ 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

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "uniprot-mcp": {
      "command": "uvx",
      "args": [
        "uniprot-mcp"
      ]
    }
  }
}

Available Tools

  • fetch_entry

    Return a structured UniProt entry.

  • get_sequence

    Return only the sequence metadata for an accession.

  • search_uniprot

    Search UniProtKB and return curated hits.

  • fetch_entry_flatfile

    Return the UniProt flatfile (txt or fasta) for a specific entry version.

  • map_ids

    Map identifiers between UniProt-supported namespaces.

Use UniProt MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once UniProt is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add UniProt as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the UniProt MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "uniprot": {
      "command": "npx",
      "args": [
        "-y",
        "uniprot-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the UniProt MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the UniProt MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use UniProt to help me with this task?
UniProt
Sure. I read it.
Here is what I found using UniProt.

Frequently asked questions

What is the UniProt MCP server used for?

UniProt is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use UniProt MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use UniProt with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use UniProt MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With UniProt connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect UniProt MCP to TypingMind?

UniProt runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does UniProt MCP provide in TypingMind?

UniProt exposes 5 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use UniProt MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If UniProt requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇