Skip to main content
Glama
pansapiens

uniprot-unipressed-mcp

by pansapiens

UniProt MCP Server

An MCP (Model Context Protocol) server that provides tools for querying the UniProt protein database using the unipressed Python library.

Features

  • Search proteins using standard the UniProt query syntax across UniProtKB, UniParc, or UniRef databases

  • Fetch specific entries by accession ID

  • Pagination for large result sets

  • Field selection to control returned data

  • JSON format responses by default - responses are returned in JSON format, with TOON format available as an option

Related MCP server: UniProt MCP Server

Installation

uv sync

This will create a virtual environment and install all dependencies.

Development installation

uv sync --extra dev

This installs the package with development dependencies (pytest, etc.).

Usage

Running the server

uvx uniprot-unipressed-mcp

Or from a git repository:

uvx --from git+https://github.com/pansapiens/uniprot-unipressed-mcp uniprot-mcp

Alternative example: with the FastMCP CLI and HTTP transport

fastmcp run src/uniprot_mcp/server.py:mcp --transport http --port 8007

Configuring with MCP clients

Claude Code

Add the server using the Claude Code CLI:

claude mcp add uniprot-unipressed-mcp -- uvx git+https://github.com/pansapiens/uniprot-unipressed-mcp

Other MCP clients

Or manually add to your MCP configuration (Claude Code, Cursor, etc.):

{
  "mcpServers": {
    "uniprot-unipressed-mcp": {
      "command": "uvx",
      "args": ["git+https://github.com/pansapiens/uniprot-unipressed-mcp"]
    }
  }
}

Response Format

Tool responses are returned in JSON format by default. To receive TOON format responses instead, use the response_format parameter with value "toon":

# JSON format (default)
result = uniprot_search(query="gene:BRCA1")

# TOON format
result = uniprot_search(query="gene:BRCA1", response_format="toon")

Tools

Search the UniProt protein database using query syntax.

Parameters:

Parameter

Type

Required

Default

Description

query

string

Yes

-

UniProt query string

database

string

No

"uniprotkb"

Database to search: uniprotkb, uniparc, uniref

limit

integer

No

10

Results per page (1-100)

fields

list[string]

No

None

Return fields to include

cursor

string

No

None

Pagination cursor from previous result

response_format

string

No

"json"

Response format: "json" (default) or "toon"

Example queries:

gene:BRCA1                              # Search by gene name
organism_id:9606                        # Human proteins (NCBI taxonomy ID)
(gene:BRCA*) AND (organism_id:10090)    # Mouse BRCA genes with wildcard
length:[500 TO 700]                     # Proteins of specific length range
keyword:kinase                          # By UniProt keyword
family:serpin                           # By protein family
ec:3.2.1.23                             # By enzyme classification
reviewed:true                           # Only Swiss-Prot reviewed entries

Response:

By default, responses are returned in JSON format. When response_format="toon" is specified, responses are returned in TOON format (a compact string):

JSON format (default):

{
  "results": [...],
  "total": 1234,
  "nextCursor": "eyJvZmZzZXQiOiAxMH0="
}

TOON format:

results[10]:
  - entryType: UniProtKB reviewed (Swiss-Prot)
    primaryAccession: P38398
    secondaryAccessions[7]: E9PFZ0,O15129,Q1RMC1,Q3LRJ0,Q3LRJ6,Q6IN79,Q7KYU9
    uniProtkbId: BRCA1_HUMAN
    ...etc...

uniprot_fetch

Fetch specific protein entries by their UniProt accession IDs.

Parameters:

Parameter

Type

Required

Default

Description

ids

list[string]

Yes

-

UniProt accession IDs to fetch

database

string

No

"uniprotkb"

Database to fetch from

fields

list[string]

No

None

Return fields to include

response_format

string

No

"json"

Response format: "json" (default) or "toon"

Example:

uniprot_fetch(ids=["P62988", "A0A0C5B5G6"])

Response:

By default, responses are returned in JSON format. When response_format="toon" is specified, responses are returned in TOON format (a compact string):

JSON format (default):

{
  "results": [...],
  "found": 2,
  "requested": 2
}

TOON format:

results[10]:
  - entryType: UniProtKB reviewed (Swiss-Prot)
    primaryAccession: P38398
    secondaryAccessions[7]: E9PFZ0,O15129,Q1RMC1,Q3LRJ0,Q3LRJ6,Q6IN79,Q7KYU9
    uniProtkbId: BRCA1_HUMAN
    ...etc...

Pagination

The server uses cursor-based pagination for search results. When more results are available, the response includes a nextCursor field. Pass this cursor in subsequent requests to retrieve the next page:

# First request
result1 = uniprot_search(query="organism_id:9606", limit=10)

# Get next page using cursor
if "nextCursor" in result1:
    result2 = uniprot_search(
        query="organism_id:9606",
        limit=10,
        cursor=result1["nextCursor"]
    )

Databases

Database

Description

uniprotkb

UniProt Knowledgebase - curated protein sequences and annotations

uniparc

UniProt Archive - comprehensive protein sequence archive

uniref

UniProt Reference Clusters - clustered protein sequences

Return Fields

Common return fields include:

  • accession - UniProt accession number

  • id - Entry name

  • gene_names - Gene names

  • protein_name - Protein names

  • organism_name - Source organism

  • organism_id - NCBI taxonomy ID

  • length - Sequence length

  • mass - Molecular mass

  • sequence - Amino acid sequence

  • cc_function - Function annotation

  • cc_subcellular_location - Subcellular location

See the UniProt return fields documentation for the complete list.

Development

Using a local copy of the repository

{
  "mcpServers": {
    "uniprot-unipressed-mcp": {
      "command": "uv",
      "args": ["--directory", "/path/to/uniprot-unipressed-mcp", "run", "-m", "uniprot_mcp.server"]
    }
  }
}

Testing using the MCP Inspector

npx @modelcontextprotocol/inspector uv --directory $(pwd) run -m uniprot_mcp.server

Running tests

uv run pytest

This runs all unit tests. Integration tests (which require network access to the UniProt API) are skipped by default.

Running integration tests

Integration tests can be enabled using an environment variable:

RUN_INTEGRATION_TESTS=1 uv run pytest

Or run only integration tests:

RUN_INTEGRATION_TESTS=1 uv run pytest -m integration

Running tests with coverage

uv run pytest --cov=uniprot_mcp

To include integration tests in coverage:

RUN_INTEGRATION_TESTS=1 uv run pytest --cov=uniprot_mcp

Resources

Licence

MIT

Available Tools

2 tools
uniprot_fetchA

Fetch specific protein entries by their UniProt accession IDs.

Args: ids: List of UniProt accession IDs to fetch. Examples: - ["P62988"] - Single protein - ["A0A0C5B5G6", "A0A1B0GTW7"] - Multiple proteins

database: UniProt database to fetch from. One of: uniprotkb (default), uniparc, uniref

fields: Optional list of return fields to include. If not specified, all fields
    are returned. Available return fields (see https://www.uniprot.org/help/return_fields):
    
    Names & Taxonomy:
    - accession, id, gene_names, gene_primary, gene_synonym, gene_oln, gene_orf
    - organism_name, organism_id, protein_name, xref_proteomes
    - lineage, lineage_ids, virus_hosts
    
    Sequences:
    - cc_alternative_products, ft_var_seq, cc_sc_epred, fragment, encoded_in
    - length, mass, cc_mass_spectrometry, ft_variant, ft_non_cons, ft_non_std
    - ft_non_ter, cc_polymorphism, cc_rna_editing, sequence, cc_sequence_caution
    - ft_conflict, ft_unsure, sequence_version
    
    Function:
    - absorption, ft_act_site, cc_activity_regulation, ft_binding, cc_catalytic_activity
    - cc_cofactor, ft_dna_bind, ec, cc_function, kinetics, cc_pathway
    - ph_dependence, redox_potential, rhea, ft_site, temp_dependence
    
    Miscellaneous:
    - annotation_score, cc_caution, comment_count, feature_count, keywordid, keyword
    - cc_miscellaneous, protein_existence, reviewed, tools, uniparc_id
    
    Interaction:
    - cc_interaction, cc_subunit
    
    Expression:
    - cc_developmental_stage, cc_induction, cc_tissue_specificity
    
    Gene Ontology (GO):
    - go_p, go_c, go, go_f, go_id
    
    Pathology & Biotech:
    - cc_allergen, cc_biotechnology, cc_disruption_phenotype, cc_disease
    - ft_mutagen, cc_pharmaceutical, cc_toxic_dose
    
    Subcellular location:
    - ft_intramem, cc_subcellular_location, ft_topo_dom, ft_transmem
    
    PTM / Processing:
    - ft_chain, ft_crosslnk, ft_disulfid, ft_carbohyd, ft_init_met, ft_lipid
    - ft_mod_res, ft_peptide, cc_ptm, ft_propep, ft_signal, ft_transit
    
    Structure:
    - structure_3d, ft_strand, ft_helix, ft_turn
    
    Publications:
    - lit_pubmed_id
    
    Date:
    - date_created, date_modified, date_sequence_modified, version
    
    Family & Domains:
    - ft_coiled, ft_compbias, cc_domain, ft_domain, ft_motif, protein_families
    - ft_region, ft_repeat, ft_zn_fing
    
    Cross-references:
    - See https://www.uniprot.org/help/return_fields for cross-reference fields

response_format: Response format. One of: 'json' (default) or 'toon'.
    - 'json': Returns response in JSON format
    - 'toon': Returns response in TOON format

Returns: When response_format='json': JSON object with: - results: Array of fetched protein entries - found: Number of entries successfully retrieved - requested: Number of IDs that were requested

When response_format='toon': TOON-formatted string with:
- results: Array of fetched protein entries
- found: Number of entries successfully retrieved
- requested: Number of IDs that were requested
ParametersJSON Schema
NameRequiredDescriptionDefault
idsYes
databaseNouniprotkb
fieldsNo
response_formatNojson

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description lacks disclosure of behavioral traits such as rate limits, authentication requirements, or error handling for missing IDs. It only describes the return format but not edge cases or limitations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Args, Returns), but it is overly verbose due to the exhaustive list of fields. This could be shortened or referenced externally for better conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of annotations and an output schema, the description provides adequate information about parameters and return format. However, it lacks details on error handling, performance considerations, or rate limits, leaving some gaps for a complete understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description fully compensates by providing detailed parameter explanations, including examples, defaults, allowed values (enum for database and response_format), and an extensive list of available fields with categories.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Fetch specific protein entries by their UniProt accession IDs,' which is a specific verb+resource combination. It clearly differentiates from the sibling tool 'uniprot_search' by focusing on fetching by ID rather than searching.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly specify when to use this tool versus alternatives. While the sibling name implies search vs. fetch, there is no guidance on when to choose one over the other or any conditions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.9/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: uniprot_fetch retrieves specific entries by IDs, while uniprot_search performs complex queries. There is no overlap in functionality.

Naming Consistency5/5

Both tool names follow a consistent verb_noun pattern with snake_case (uniprot_fetch, uniprot_search), making them predictable and easy to understand.

Tool Count3/5

With only 2 tools, the server is very thin for the vast UniProt domain. While fetch and search are core operations, the lack of other tools (e.g., for updates or batch operations) makes it feel limited.

Completeness3/5

The server covers basic retrieval operations (fetch by ID and search) but lacks any write or update functionality. For a read-only interface this might be acceptable, but tools for batch processing or data submission are missing.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that enables language models to fetch protein information from the UniProt database, including protein details, sequences, functions, and structures.
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    A Model Context Protocol server providing programmatic access to 3D protein structural data from RCSB PDB, PDBe, and UniProt, enabling search, retrieval, comparison, and analysis of protein structures.
    269
    5
    Apache 2.0
  • A
    license
    A
    quality
    A
    maintenance
    An MCP server that grounds protein research in the UniProt SPARQL endpoint, providing tools for querying proteins, sequences, variants, diseases, and more via intent-named tools and raw SPARQL.
    15
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pansapiens/uniprot-unipressed-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server