UN

UniProt MCP Server: Sequences, Annotations, Taxonomy

Access UniProt protein sequences, functional annotations, taxonomy and cross-references via the MCP server for proteomics and bioinformatics research.

Quick Install
npx -y @QuentinCody/uniprot-mcp-server

Overview

The UniProt MCP Server exposes UniProt protein sequences, functional annotations, taxonomy data, and cross-references through a lightweight Model Context Protocol (MCP) compatible API. It is intended for bioinformatics and proteomics pipelines that need programmatic, high-throughput access to canonical and isoform sequences, Gene Ontology terms, enzymatic (EC) annotations, taxonomic identifiers, and links to external resources such as PDB and Ensembl.

Running a local MCP server that proxies and caches UniProt data reduces reliance on remote rate-limited APIs, simplifies reproducible analysis, and lets downstream tools request context payloads in a stable, JSON-based format required by many modern model serving and data-integration workflows.

Features

  • Retrieve UniProt protein sequences (canonical and isoforms) by accession or identifier
  • Fetch functional annotations: GO terms, EC numbers, keywords, and domain descriptions
  • Lookup taxonomy information (scientific name, lineage, taxid) for proteins and organisms
  • Expose cross-references to external resources (PDB, Ensembl, RefSeq, KEGG)
  • Full-text search endpoint for name/keyword/accession queries
  • Lightweight caching layer to reduce repeated remote lookups and speed pipelines
  • Standard MCP metadata and content negotiation (JSON) for easy integration
  • Health and metrics endpoints for orchestration and monitoring
  • CORS support for web-based tools and notebooks

Installation / Configuration

Prerequisites: Docker (recommended) or Node.js / Python runtime if building from source.

Clone the repository and run via Docker:

git clone https://github.com/QuentinCody/uniprot-mcp-server.git
cd uniprot-mcp-server

# Build and run with Docker
docker build -t uniprot-mcp-server .
docker run -p 8080:8080 \
  -e PORT=8080 \
  -e UNIPROT_API_BASE=https://rest.uniprot.org \
  -e CACHE_DIR=/data/cache \
  -v $(pwd)/data:/data \
  uniprot-mcp-server

Example .env (for local development):

PORT=8080
UNIPROT_API_BASE=https://rest.uniprot.org
CACHE_DIR=./cache
CACHE_TTL_SECONDS=86400
LOG_LEVEL=info
CORS=true

If the project provides a package.json or requirements.txt, install dependencies and run directly:

Node.js

npm install
npm start

Python (if applicable)

pip install -r requirements.txt
python app.py

Adjust environment variables to point at a custom UniProt mirror or to tune cache behavior.

Available Resources

Common HTTP endpoints (examples):

EndpointMethodDescription
/healthGETLiveness and readiness check
/metricsGETPrometheus-style metrics (if enabled)
/mcp/metadataGETMCP service metadata
/sequences/:accessionGETReturn sequence (FASTA/JSON) for accession
/annotations/:accessionGETFunctional annotation payload for accession
/taxonomy/:taxidGETTaxonomy record (name, lineage, rank)
/search?q=…GETFull-text search across entries
/xref/:accessionGETCross-reference map for accession

OpenAPI / Swagger: check /openapi.json or /docs (if included) to explore the API schema and try endpoints interactively.

Client libraries / examples: the repo may include short example clients in JavaScript and Python for fetching MCP payloads and parsing responses.

Use Cases

  1. Proteomics FASTA generation

    • Query a list of UniProt accessions and pull canonical sequences as FASTA for database search engines (e.g., MSFragger, MaxQuant).
    • Example:
      curl -sS "http://localhost:8080/sequences/P31946" -H "Accept: text/plain"
      # returns FASTA for accession P31946
      
  2. Functional enrichment and annotation

    • Fetch GO, EC, and keyword annotations for a protein set, then aggregate counts for enrichment analysis.
    • Example:
      curl -sS "http://localhost:8080/annotations/P31946" | jq .
      
  3. Taxonomy-aware filtering

    • Limit searches and sequence retrievals to a specific taxid or lineage (e.g., bacteria-only databases).
    • Example search:
      curl -sS "http://localhost:8080/search?q=kinase&taxid=9606" | jq .
      
  4. Cross-reference mapping for multi-omics

    • Retrieve links to PDB, Ensembl, and RefSeq to crosswalk protein identifers across datasets.
    • Example:
      curl -sS "http://localhost:8080/xref/P31946" | jq .
      
  5. Integration with model-driven tools

    • Use MCP metadata and standardized payloads to feed context into downstream ML models or annotation pipelines that expect MCP-compatible inputs.

Tips for Developers

  • Use the cache when running bulk queries to avoid hitting UniProt rate limits; tune CACHE_TTL_SECONDS according to update frequency needs.
  • Normalize incoming accession inputs (trim spaces, uppercase) before requesting to avoid errors.
  • When integrating with orchestration systems (Kubernetes, Airflow), wire the /health endpoint for readiness probes and expose /metrics for monitoring.
  • For reproducible analyses, snapshot cache files alongside your workflow inputs so sequence/annotation sets are versioned.

For the latest code, issues, and contribution guidelines, see the project repository: https://github.com/QuentinCody/uniprot-mcp-server.

Tags:search