
PyMOL 插件——从 Claude Code、光标或任何 MCP 客户端驱动 PyMOL。
概览
用通俗易懂的英语驱动PyMOL——无论是Codex、Claude Code、Cursor,还是你的手机。 是一个 PyMOL 插件,将 PyMOL 变成 MCP 服务器,因此你可以从任何 MCP 客户端(Codex、Claude Code、Cursor)用英文驱动,而无需手动输入 PyMOL 命令。启动时,它会在 PyMOL 自有的 Python 进程中启动一个基于官方 MCP Python SDK 构建的 MCP 服务器,将 pymol.cmd API 作为工具开放,因此你可以: - 通过代理窗口通过 gemmi 支持的度量层解析 mmCIF,而非手动操作 - (pLDDT / ipTM / pTM / PAE),通过解析 mmCIF 的 Agent 窗口进行解析 - 指向代理的自定义 PyMOL 预设/分析函数.py,并通过支持远程会话的 MCP 客户端正常使用它们 Codex / Claude Code / Cursor 中的示例会话: - (普通桌面安装——插件安装在 PyMOL 自带的 Python,而非你的系统 Python)- — Codex、Claude Code 或 Cursor 3.12.17 或更新版本。
概述(AI 翻译)
用通俗英语驱动PyMOL——来源于Codex、Claude Code、光标或你的手机。
co-pymol 是一个 PyMOL 插件,将 PyMOL 变成 MCP 服务器,因此你可以从任何 MCP 客户端(Codex、Claude Code、Cursor)用英文驱动,而无需手动输入 PyMOL 命令。启动时,它会在 PyMOL 自有的 Python 进程中启动一个基于官方 MCP Python SDK 构建的 MCP 服务器,将 pymol.cmd API 作为工具开放,因此你可以:
- 用代理自动分析和可视化,而不是手动操作
- 通过由gemmi支持的度量层读取代理窗口中的置信度值(pLDDT / ipTM / pTM / PAE),解析mmCIF
- 插入你自己的助手 — 指向一个自定义PyMOL预设/分析函数的
.py,并请求其使用它们 - 照常在SSHFS安装的集群路径上工作
- 通过支持远程会话的MCP客户端远程控制手机
Codex 演示版
https://github.com/user-attachments/assets/bbbdbe32-bc59-4446-9bd1-3e4860af022e
Codex / Claude Code / Cursor 中的示例会话:
要求
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
co-pymol
Drive PyMOL in plain English — from Codex, Claude Code, Cursor, or your phone.
co-pymol is a PyMOL plugin that turns PyMOL into an MCP server, so you can drive it in English from any MCP client (Codex, Claude Code, Cursor) instead of typing PyMOL commands by hand. On startup it spins up an MCP server — built on the official MCP Python SDK — inside PyMOL’s own Python process, exposing the pymol.cmd API as tools, so you can:
- Automate analysis and visualisation with an agent instead of doing it by hand
- Read confidence values (pLDDT / ipTM / pTM / PAE) on an agent’s window via a gemmi-backed metrics layer that parses mmCIF
- Drop in your own helpers — point the agent at a
.pyof custom PyMOL presets / analysis functions and ask it to use them - Work over SSHFS-mounted cluster paths as usual
- Remote-control from your phone through an MCP client that supports remote sessions
Codex demo
https://github.com/user-attachments/assets/bbbdbe32-bc59-4446-9bd1-3e4860af022e
An example session in Codex / Claude Code / Cursor:
> Load all the CIF files in /path/to/dir/w/predicted/structures/
[all the structures visible on PyMOL window]
Loaded all structures, sorted by mean pLDDT.
> Which one has the worst ipTM?
model_3 — ipTM 0.41 (others are 0.7+).
> Show me the low-confidence loops on structure_500.
[renders cartoon on PyMOL window, residues 142–168 highlighted, mean pLDDT 38]
Requirements
- PyMOL (a normal desktop install — the plugin installs into PyMOL’s bundled Python, not your system Python)
- An MCP client — Codex, Claude Code, or Cursor 3.12.17 or newer. Older Cursor versions may not refresh the tool list when PyMOL starts after Cursor.
- macOS — that’s all I’ve tested on :/ Linux / conda / non-standard installs should work in principle (the recipe is just “install into PyMOL’s bundled Python”) but these haven’t been tested.
Installing
If you prefer to have a coding agent (Claude Code, Cursor, Codex, etc.) do the install for you, point it at AGENTS.md — it’s the same recipe written for an agent to execute.
1. Clone and install
git clone https://github.com/soo-jeongkim/co-pymol.git
cd co-pymol
/Applications/PyMOL.app/Contents/bin/python -m pip install --user -e .
2. Set up the MCP client you use
Choose exactly one:
# Codex
/Applications/PyMOL.app/Contents/bin/python -m co_pymol setup codex
# Cursor
/Applications/PyMOL.app/Contents/bin/python -m co_pymol setup cursor
# Claude Code
/Applications/PyMOL.app/Contents/bin/python -m co_pymol setup claude
Each command installs the shared PyMOL startup hook and configures only the
selected client. The other clients do not need to be installed. The Codex and
Claude choices require their existing CLI on PATH; the Cursor choice writes
~/.cursor/mcp.json directly. These commands configure co-pymol for a client —
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"pymol": {
"url": "http://127.0.0.1:8766/sse"
}
}
}