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
Examples:
- What are the PDBe structures for
A8MT69
uniprot accession?
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 structure (mmCIF or pdb) file and write to a new file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_file
|
Path
|
Path to the input structure (mmCIF or 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
|
Path to the output structure (mmCIF or pdb) file |
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_emdb_volumes(emdb_ids, save_dir)
async
fetch_pdbe_structures(pdb_ids, save_dir)
async
Fetch the PDBe structures for given PDB IDs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pdb_ids
|
set[str]
|
A set of PDB IDs. |
required |
save_dir
|
Path
|
The directory to save the fetched files. |
required |
Returns:
Type | Description |
---|---|
Mapping[str, Path]
|
A mapping of PDB ID to the path of the fetched structure file. |
list_structure_files(path)
List structure files (.pdb, .pdb.gz, .cif, .cif.gz, .bcif) 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.
uniprot_accessions_of_structure_file(file)
Extract UniProt accessions from structure file.