概览
What is PyMOL-MCP?
PyMOL-MCP connects PyMOL to Claude AI through the Model Context Protocol (MCP), enabling Claude to directly interact with and control PyMOL. This integration allows for conversational structural biology, molecular visualization, and analysis through natural language.
How to use PyMOL-MCP?
Clone the repository, create a Python 3.10+ virtual environment, install the mcp package, add the server configuration to Claude Desktop’s claude_desktop_config.json, and install the included PyMOL socket plugin via PyMOL’s Plugin Manager. Start the plugin’s “Listening” mode in PyMOL, then use Claude Desktop; a hammer icon in the tools section gives access to PyMOL commands.
Key features of PyMOL-MCP
- Two-way socket-based communication between Claude and PyMOL
- Natural language parsing for PyMOL commands
- Molecular visualization control (representations, colors, views)
- Structural analysis (measurements, alignments)
- Remote Python code execution inside PyMOL
Use cases of PyMOL-MCP
- Load a PDB file and display it as a cartoon
- Color a protein by secondary structure
- Highlight active site residues with stick representation
- Align two structures and show their differences
- Calculate the distance between two residues and save a high-resolution image
FAQ from PyMOL-MCP
What are the prerequisites?
PyMOL, Claude for Desktop, Python 3.10 or newer, Git, and the UV package manager (for environment setup).
How does the connection between Claude and PyMOL work?
A socket-based server runs inside PyMOL via the included plugin, listening on port 9876. Claude talks to that server through MCP, requiring both applications to be running on the same machine.
What can I do with natural language commands?
You can load structures, change representations and colors, run alignments, measure distances, execute arbitrary Python code in PyMOL, and save views as images.
The plugin isn’t appearing or Claude won’t connect?
Ensure the PyMOL plugin is listening before attempting a connection from Claude. Restart PyMOL to refresh the plugin list, and verify the Python path and script paths in claude_desktop_config.json are correct.
What transport and auth does PyMOL-MCP use?
It uses a local TCP socket on port 127.0.0.1:9876. There is no authentication; the connection is local and requires PyMOL and Claude to be on the same machine.