Pymol Claude MCP logo

Pymol Claude MCP

Community
stavasol96-arch

MCP server that connects Claude Code to a live PyMOL session over XML-RPC

Publisherstavasol96-arch
RepositoryPymol-Claude-MCP
LanguagePython
Forks
12
Stars
65
Available tools
0
Transport typestdio
Links
  • Connect tools to AI workflows

    Pymol Claude MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    65 stars and 12 forks from the linked repository.

Pymol-Claude-MCP

An MCP server that lets Claude Code drive a live PyMOL session — fetch structures, build selections, adjust representations and coloring, measure distances — by talking to PyMOL's built-in XML-RPC server.

How it works

PyMOL ships with an XML-RPC server (enabled via pymol -R) that exposes its command API on localhost:9123. pymol_server.py wraps that in three MCP tools so Claude can call them like any other tool:

ToolPurpose
pymol_commandRun one PyMOL command, exactly as you'd type it at the PyMOL prompt
pymol_scriptRun a block of Python inside PyMOL's embedded interpreter (loops, cmd.* calls, etc.)
pymol_queryCall any PyMOL XML-RPC method directly and get the return value back (for read-only lookups like atom counts or chain lists)

Claude decides which tool fits the request and supplies the PyMOL command or code itself — this server is just the transport layer.

Prerequisites

  • PyMOL (with XML-RPC support — the open-source build includes it)
  • Claude Code: npm install -g @anthropic-ai/claude-code
  • Python 3.10+

Setup

1. Clone this repo and install dependencies

bash
git clone https://github.com/<your-username>/Pymol-Claude-MCP
cd Pymol-Claude-MCP
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

2. Make PyMOL start its RPC server automatically (optional but recommended)

By default you'd need to launch PyMOL from a terminal with pymol -R every time. Instead, symlink autostart/pymolrc.py to ~/.pymolrc.py — a script PyMOL runs on every launch — so RPC starts silently whether you open PyMOL from the command line, Spotlight, or the Dock:

bash
ln -sf "$(pwd)/autostart/pymolrc.py" ~/.pymolrc.py

From now on, just open PyMOL normally. It listens for the MCP server on port 9123 (override with PYMOL_RPC_PORT).

If you'd rather not touch ~/.pymolrc.py, start it manually instead each time: pymol -R.

3. Register the server with Claude Code

bash
claude mcp add pymol $(pwd)/venv/bin/python3 $(pwd)/pymol_server.py
claude mcp list

You should see:

pymol: .../venv/bin/python3 .../pymol_server.py - ✓ Connected

4. Launch Claude Code

bash
claude

PyMOL must already be running (with RPC active — automatic if you did step 2, otherwise via pymol -R) before Claude Code starts, or the server will fail to connect.

Using a different port

If 9123 is taken, start PyMOL's RPC server on another port and point the MCP server at it:

bash
pymol -cq -d "rpc_launch(port=49123)"
bash
claude mcp add pymol $(pwd)/venv/bin/python3 $(pwd)/pymol_server.py -- --port 49123

(or set PYMOL_RPC_PORT=49123 in the environment instead of passing --port)

Remote setup (PyMOL local, Claude Code on a remote host)

If PyMOL runs on your own machine but Claude Code runs elsewhere (e.g. an HPC login node), open an SSH reverse tunnel so the remote host can reach your local PyMOL's RPC port:

bash
ssh -R 9123:localhost:9123 <user>@<remote-host>

Then follow the same setup steps on the remote host, pointing claude mcp add at a Python environment there.

Example prompts

  • "Fetch 1hho and show it as a cartoon"
  • "Remove waters and switch to surface representation"
  • "Select everything within 4 Å of the ligand"
  • "Color helices salmon and the ligand yellow"
  • "How many chains are in this structure?"

Auto-approving tool calls

By default, Claude Code confirms before each PyMOL tool call. To skip that, add to ~/.claude/settings.json:

json
{
  "permissions": {
    "allow": ["mcp__pymol__*"]
  }
}

Note that pymol_script executes arbitrary Python inside the PyMOL process — treat auto-approval the same way you would for any tool that runs unrestricted code locally.

Troubleshooting

zsh: command not found: pymol

  • The macOS .app build of PyMOL doesn't put pymol on your PATH. Either use the full path — /Applications/PyMOL.app/Contents/bin/pymol -R — or add that directory to your PATH.

MCP server shows failed

  • Confirm PyMOL is running with RPC active (automatic with autostart/pymolrc.py, or via -R)
  • Confirm the port matches between PyMOL and the --port/PYMOL_RPC_PORT value
  • Restart Claude Code after changing the port

Connection refused

  • PyMOL must be started before Claude Code connects to the MCP server
  • If using the SSH tunnel setup, confirm the tunnel is still open (Ctrl+C closes it)

Use Pymol Claude MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Pymol Claude MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Pymol Claude MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Pymol Claude MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "pymol-claude-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Pymol Claude MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Pymol Claude MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Pymol Claude MCP to help me with this task?
Pymol Claude MCP
Sure. I read it.
Here is what I found using Pymol Claude MCP.

Frequently asked questions

What is the Pymol Claude MCP MCP server used for?

Pymol Claude MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Pymol Claude MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Pymol Claude MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Pymol Claude MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Pymol Claude MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Pymol Claude MCP MCP to TypingMind?

Pymol Claude MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Pymol Claude MCP MCP provide in TypingMind?

Pymol Claude MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Pymol Claude MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Pymol Claude MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇