Skip to main content
Glama
jonathan6620

PyMOL-MCP

by jonathan6620

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PYMOL_MCP_HISTORYNoDirectory for session history files, or 'off' to disable. Default is ~/.pymol-mcp/. Set to a custom path or 'off'.
PYMOL_MCP_LOG_LEVELNoLog level for the MCP server. Set to 'INFO' or 'DEBUG' to enable logging. Default is no logging.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
parse_and_executeA

Executes a single PyMOL command given in literal PyMOL syntax.

NOT a natural-language interface. user_input is matched against a fixed table of command patterns; anything else is rejected rather than guessed at. Translate the user's request into PyMOL syntax yourself, then call this once per command. Use list_commands to look up exact syntax.

instance is the port of the PyMOL to drive. Leave it unset when only one is running. With several running an unset instance is an error rather than a guess, since driving the window the user is not watching looks exactly like the command doing nothing. Call list_instances to see the choices.

Translating requests: "Load PDB 1UBQ and show it as cartoon" -> parse_and_execute("fetch 1ubq") -> parse_and_execute("as cartoon, 1ubq") "Colour chain A red" -> "color red, chain A" "Show sticks for residues 1-50" -> "show sticks, resi 1-50" "Open /data/model.pdb" -> "load /data/model.pdb" "Select the binding site" -> "select site, byres (polymer within 5 of ligand)"

Common mistakes:

  • Multiple commands in one call. "fetch 1ubq and show cartoon" fails; the whole string is read as one filename/code.

  • load for a PDB ID. load takes a file path; use fetch for a 4-character accession code like 1ubq.

  • Selections as prose. Write show cartoon, chain A, not show cartoon for chain A -- the selection is a second argument after a comma.

  • Conversational filler. "please show cartoon" does not match; send "show cartoon".

Selections use full PyMOL algebra (chain A and resi 1-50, not solvent, byres (... within 5 of ...)). Commas separate arguments, so a selection containing a comma must be rewritten with + (resi 1+2+3).

Returns PyMOL's output, or a message describing the parse/execution failure.

list_instancesA

Lists the running PyMOL instances and what each has loaded.

Each PyMOL claims its own port, so several can run at once. Pass a port as instance to parse_and_execute to drive that specific one. Use this when a command reports the choice is ambiguous, or when the user refers to a particular window.

The loaded object names are what distinguish one window from another; a port number on its own identifies nothing to a human.

list_commandsA

Lists the PyMOL commands parse_and_execute accepts.

Without filter, returns every command name with a one-line description. With filter (a substring matched against names and descriptions), returns full detail for the matches: the exact regex the input must satisfy, plus each parameter's name, whether it is required, its default, and its allowed values. Use it to confirm syntax before calling parse_and_execute.

Examples: filter="color" for the colouring commands, filter="cartoon" for cartoon-related ones, filter="fetch" for the exact fetch signature.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/jonathan6620/pymol-mcp'

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