Skip to content

mcp_server

MCP server for protein-quest.

Can be run with:

# for development
fastmcp dev src/protein_quest/mcp_server.py
# or from inspector
npx @modelcontextprotocol/inspector
# tranport type: stdio
# comand: protein-quest
# arguments: mcp

# or with server and inspector
protein-quest mcp --transport streamable-http
# in another shell
npx @modelcontextprotocol/inspector
# transport type: streamable http
# URL: http://127.0.0.1:8000/mcp

# or with copilot in VS code
# ctrl + shift + p
# mcp: add server...
# Choose STDIO
# command: uv run protein-quest mcp
# id: protein-quest
# Prompt: What are the PDBe structures for `A8MT69` uniprot accession?

Examples:

For search pdb use `A8MT69` as input.

alphafold_confidence_filter(file, query, filtered_dir)

Take a mmcif/PDB file and filter it based on confidence (plDDT) scores.

If passes filter writes file to filtered_dir with residues above confidence threshold.

candidate_structures(species='Human', cellular_location='nucleus', confidence=90, min_residues=100, max_residues=200)

Prompt to find candidate structures.

Parameters:

Name Type Description Default
species str

The species to search for (default: "Human").

'Human'
cellular_location str

The cellular location to search for (default: "nucleus").

'nucleus'
confidence int

The confidence threshold for AlphaFold structures (default: 90).

90
min_residues int

Minimum number of high confidence residues (default: 100).

100
max_residues int

Maximum number of high confidence residues (default: 200).

200

Returns:

Type Description
str

A prompt string to find candidate structures.

extract_single_chain_from_structure(input_file, chain2keep, output_dir, out_chain='A')

Extract a single chain from a mmCIF/pdb file and write to a new file.

Parameters:

Name Type Description Default
input_file Path

Path to the input mmCIF/pdb file.

required
chain2keep str

The chain to keep.

required
output_dir Path

Directory to save the output file.

required
out_chain str

The chain identifier for the output file.

'A'

Returns:

Type Description
Path | None

Path to the output mmCIF/pdb file or None if not created.

fetch_alphafold_structures(uniprot_accs, save_dir)

Fetch the AlphaFold summary and mmcif file for given UniProt accessions.

Parameters:

Name Type Description Default
uniprot_accs set[str]

A set of UniProt accessions.

required
save_dir Path

The directory to save the fetched files.

required

Returns:

Type Description
list[AlphaFoldEntry]

A list of AlphaFold entries.

fetch_structures_from_pdbe(ids, save_dir)

Fetch PDB structures as mmCIF files from PDBe and save them to the specified directory.

list_structure_files(path)

List structure files (.pdb, .pdb.gz, .cif, .cif.gz) in the specified directory.

search_alphafolds(uniprot_accs, limit=100)

Search for AlphaFold entries in UniProtKB accessions.

search_pdb(uniprot_accs, limit=100)

Search PDBe structures for given uniprot accessions.

search_uniprot(uniprot_query, limit=100)

Search UniProt for proteins matching the given query.