PyMOL-MCP logo

PyMOL-MCP

Community
vrtejus

PyMOL-MCP connects PyMOL to Claude AI through the Model Context Protocol (MCP), enabling Claude to directly interact with and control PyMOL. This powerful integration allows for conversational…

Publishervrtejus
Repositorypymol-mcp
LanguagePython
Forks
14
Stars
68
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    PyMOL-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

    68 stars and 14 forks from the linked repository.

PyMOL-MCP: Integrating PyMOL with Claude AI

PyMOL-MCP connects PyMOL to Claude AI through the Model Context Protocol (MCP), enabling Claude to directly interact with and control PyMOL. This powerful integration allows for conversational structural biology, molecular visualization, and analysis through natural language.

https://github.com/user-attachments/assets/687f43dc-d45e-477e-ac2b-7438e175cb36

Features

  • Two-way communication: Connect Claude AI to PyMOL through a socket-based server
  • Intelligent command parsing: Natural language processing for PyMOL commands
  • Molecular visualization control: Manipulate representations, colors, and views
  • Structural analysis: Perform measurements, alignments, and other analyses
  • Code execution: Run arbitrary Python code in PyMOL from Claude

Installation Guide

Prerequisites

  • PyMOL installed on your system
  • Claude for Desktop
  • Python 3.10 or newer
  • Git

Step 1: Install the UV Package Manager

On macOS:

bash
brew install uv

On Windows:

bash
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
set Path=C:\Users\[YourUsername]\.local\bin;%Path%

For other platforms, visit the UV installation guide.

Step 2: Clone the Repository

bash
git clone https://github.com/vrtejus/pymol-mcp
cd pymol-mcp

Step 3: Set Up the Environment

Create and activate a Python virtual environment:

bash
python -m venv venv

On macOS/Linux:

bash
source venv/bin/activate

On Windows:

bash
venv\Scripts\activate

Step 4: Install Dependencies

With the virtual environment activated:

bash
pip install mcp

Step 5: Configure Claude Desktop

  1. Open Claude Desktop
  2. Go to Claude > Settings > Developer > Edit Config
  3. This will open the claude_desktop_config.json file
  4. Add the MCP server configuration:
json
{
  "mcpServers": {
    "pymol": {
      "command": "[Full path to your venv python]",
      "args": ["[Full path to pymol_mcp_server.py]"]
    }
  }
}

For example:

json
{
  "mcpServers": {
    "pymol": {
      "command": "/Users/username/pymol-mcp/venv/bin/python",
      "args": ["/Users/username/pymol-mcp/pymol_mcp_server.py"]
    }
  }
}

Note: Use the actual full paths on your system. On Windows, use forward slashes (/) instead of backslashes.

Step 6: Install the PyMOL Plugin

  1. Open PyMOL
  2. Go to Plugin → Plugin Manager
  3. Click on "Install New Plugin" tab
  4. Select "Choose file..." and navigate to the cloned repository
  5. Select the pymol-mcp-socket-plugin/__init__.py file
  6. Click "Open" and follow the prompts to install the plugin

Usage

Starting the Connection

  1. In PyMOL:

    • Go to Plugin → PyMOL MCP Socket Plugin
    • Click "Start Listening"
    • The status should change to "Listening on port 9876"
  2. In Claude Desktop:

    • You should see a hammer icon in the tools section when chatting
    • Click it to access the PyMOL tools

Example Commands

Here are some examples of what you can ask Claude to do:

  • "Load PDB 1UBQ and display it as cartoon"
  • "Color the protein by secondary structure"
  • "Highlight the active site residues with sticks representation"
  • "Align two structures and show their differences"
  • "Calculate the distance between these two residues"
  • "Save this view as a high-resolution image"

Troubleshooting

  • Connection issues: Make sure the PyMOL plugin is listening before attempting to connect from Claude
  • Command errors: Check the PyMOL output window for any error messages
  • Plugin not appearing: Restart PyMOL and check that the plugin was correctly installed
  • Claude not connecting: Verify the paths in your Claude configuration file are correct

Limitations & Notes

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "vrtejus-pymol-mcp": {
      "command": "",
      "args": []
    }
  }
}

Use PyMOL-MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once PyMOL-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-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-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": {
    "vrtejus-pymol-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-rosetta"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the PyMOL-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-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-MCP to help me with this task?
PyMOL-MCP
Sure. I read it.
Here is what I found using PyMOL-MCP.

Frequently asked questions

What is the PyMOL-MCP MCP server used for?

PyMOL-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-MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use PyMOL-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-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-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-MCP MCP to TypingMind?

PyMOL-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-MCP MCP provide in TypingMind?

PyMOL-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-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-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 👇