co-pymolのロゴ

co-pymol

コミュニティ
soo-jeongkim

PyMOL plugin - drive PyMOL from Claude Code, Cursor, or any MCP client.

公開者soo-jeongkim
リポジトリco-pymol
言語Python
フォーク
3
スター
44
利用可能なツール
0
通信方式stdio, streamable-http
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    co-pymolは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには44件のスターと3件のフォークがあります。

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 .py of 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

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

bash
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:

bash
# 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 — they do not install Codex, Cursor, or Claude Code themselves. All are safe to re-run.

The client setup is global, so pymol is available from every session and there is no need to cd into this repo. It uses the recommended bundled stdio proxy (co-pymol proxy), which forwards to PyMOL and survives PyMOL quitting/restarting. After one successful connection, tool calls made while PyMOL is down return a clear message. On a cold start, the tools appear when PyMOL first connects.

Codex supports local stdio and Streamable HTTP servers, not co-pymol's SSE endpoint, so Codex must use the proxy. Cursor and Claude Code can use direct SSE instead, but their connections drop whenever PyMOL restarts. To switch after normal setup, use:

bash
# Claude Code: replace its user-scoped proxy entry with the direct SSE URL
claude mcp remove pymol --scope user
claude mcp add --transport sse --scope user pymol http://127.0.0.1:8766/sse

For Cursor, edit only its pymol entry in ~/.cursor/mcp.json, preserving any other servers:

json
{
  "mcpServers": {
    "pymol": {
      "url": "http://127.0.0.1:8766/sse"
    }
  }
}

The --host and --port options on setup commands change where the client-side proxy connects; they do not change the address started by the automatic PyMOL hook, which is currently fixed at 127.0.0.1:8766. Leave those options off for the normal installation.

3. Restart PyMOL and your selected client

The PyMOL console should print:

co-pymol: MCP server running on http://127.0.0.1:8766/sse

If you don't see that line, ~/.pymolrc.py isn't being loaded. The file must be in your home directory (echo $HOME to check), and you need a full PyMOL quit + relaunch, not just a window close.

By default the server binds 127.0.0.1:8766 (loopback), so PyMOL and the MCP client must run on the same machine. The proxy supports starting the client before PyMOL; that reverse-order flow requires Cursor 3.12.17 or newer.

Confirm the selected client has the entry: run codex mcp list or claude mcp list, or open Cursor Settings → MCP. Codex's MCP configuration is shared by the ChatGPT desktop app, Codex CLI, and Codex IDE extension on the same host. See the official Codex MCP documentation.

4. Confirm the agent is talking to PyMOL

Ask the agent something like "are you connected to PyMOL? what version is loaded?" — if it calls a pymol tool (e.g. get_version) and reports a real answer, you're wired up. If it cannot see any pymol tools, re-check step 2 and make sure you opened a new client session after setup.

Upgrading

Already have an older version? How you update depends on how you installed it:

  • Editable install (pip install -e ., the recipe above) — git pull updates the source immediately, but re-run the install when dependencies or package metadata change. Do that once for the 0.2.0 upgrade.
  • Non-editable install — git pull, then re-run <pymol-python> -m pip install --user -e . to pick up the new code and switch to an editable install.
  • Installed back when it was pylot — uninstall pylot, remove its line from ~/.pymolrc.py, then do a fresh install.

For 0.2.0, pull the code and re-run:

bash
/Applications/PyMOL.app/Contents/bin/python -m pip install --user -e .

Then re-run the setup command from step 2 for the client you use. If its entry still points at the older -m co_pymol.proxy, it won't start.

The full step-by-step, including how to tell which kind of install you have, is in the "Upgrading an existing install" section of AGENTS.md — or just point your coding agent at that file.

Experimenting!

  1. Open PyMOL (the MCP server auto-starts).
  2. Open Codex, Claude Code (claude in a terminal), or Cursor with MCP enabled.
  3. Talk to it:
    • "Load all CIF files in <dir>, sorted by ipTM"
    • "Color by pLDDT, then render a ray-traced PNG"
    • "Align model_0 onto model_1; what's the RMSD?"
    • "Look at ~/scripts/my_pymol_helpers.py — apply the publication-style view to all objects"

Want sample data? Click here to download a few sample CIF files (AF3 predictions, antibodies, multi-domain proteins) to play with.

Uninstalling

Reverses the install steps. There's no uninstall subcommand, so remove the client entry and the two startup-hook lines as described below.

1. Unwire your MCP client

Codex:

bash
codex mcp remove pymol

Cursor: edit ~/.cursor/mcp.json and delete the "pymol" entry under mcpServers (leave any other servers intact). Quit Cursor (Cmd+Q) and reopen.

Claude Code:

bash
claude mcp remove pymol --scope user

2. Remove the PyMOL startup hook

Delete these two lines from ~/.pymolrc.py:

text
# co-pymol: auto-start MCP server on PyMOL launch
from co_pymol import __init_plugin__; __init_plugin__()

If that was the only thing in the file, you can delete ~/.pymolrc.py entirely.

3. Uninstall the package

bash
/Applications/PyMOL.app/Contents/bin/python -m pip uninstall co-pymol

4. Restart PyMOL

A full quit + relaunch. The MCP server running on... line should be gone. The plugin keeps no caches or logs of its own, so nothing else is left behind. (The cloned repo is yours to rm -rf whenever.)

Notes

  • run() security — executes arbitrary Python locally with full imports, file I/O, and PyMOL access. Only connect trusted MCP clients, and keep the server on loopback unless you have separately secured the network path.
  • Dev setup (optional) — install .[dev] into PyMOL's Python, then run tests with that same interpreter. See AGENTS.md and .pre-commit-config.yaml.

インストール

TypingMind
{
  "mcpServers": {
    "co-pymol": {
      "command": "/Applications/PyMOL.app/Contents/bin/python",
      "args": [
        "-m",
        "co_pymol",
        "proxy"
      ]
    }
  }
}

co-pymolのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度co-pymolに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 お使いのデバイス上でMCPをローカル実行することも、リモートMCPサーバーのURLに接続することもできます。

方法1:ローカルコネクタを使用

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

co-pymolをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. co-pymolのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "co-pymol": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてco-pymolのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. co-pymolのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
co-pymolを使ってこのタスクを手伝ってもらえますか?
co-pymol
はい、読みました。
co-pymolで調べた結果をお伝えします。

方法2:MCPサーバーのURLを追加

co-pymolがすでにリモートでホストされている場合や、チームの複数のユーザーで1つのコネクタを共有したい場合は、この方法を使います。

1

MCPコネクタを開く

TypingMindで「プラグイン」に移動し、「MCPコネクタ」を開いて「URLを追加」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 「プラグイン」に移動してください。
  3. 「MCPコネクタ」を開いてください。
  4. 「URLを追加」をクリックします。
TypingMindの「カスタムMCPサーバーURLを追加」フォーム
2

サーバーURLを貼り付け

「サーバーURL」欄にプロバイダーから提供されたMCPサーバーのURLを入力してください。サーバーで必要とされる場合は、接続名、説明、アイコン、カスタムHTTPヘッダー、OAuthクライアント設定を追加してください。

  1. 「サーバーURL」欄にプロバイダーから提供されたMCPサーバーのURLを貼り付けてください。
  2. co-pymolの接続名を入力してください。
  3. 接続を識別しやすくするには、説明とアイコンを追加してください。
  4. サーバーで認証が必要な場合は、カスタムHTTPヘッダーまたはOAuthクライアントの詳細情報を追加してください。
3

接続を作成

「接続を作成」をクリックし、プラグイン一覧に戻って、新しいMCP接続が有効になっていることを確認してください。

  1. 「接続を作成」をクリックします。
  2. MCPコネクタの一覧に戻ってください。
  3. co-pymolの接続が「有効」と表示されていることを確認してください。
  4. 接続がすぐに表示されない場合は、プラグイン一覧を更新してください。
4

再接続せずにモデルを切り替え

お好みのモデルでチャットを開始し、「プラグイン」でco-pymolのツールを有効にしてください。必要に応じて別のモデルに切り替えられます。MCP接続は、TypingMindのワークスペースで引き続き利用できます。

  1. TypingMindで新しいチャットを開始してください。
  2. 使用するAIモデルを選択してください。
  3. 「プラグイン」でco-pymolのツールを有効にしてください。
  4. 必要に応じて、ツールを使うようモデルに依頼してください。
  5. 別のAIモデルに切り替えて、同じMCP接続を再利用してください。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
co-pymolを使ってこのタスクを手伝ってもらえますか?
co-pymol
はい、読みました。
co-pymolで調べた結果をお伝えします。

よくある質問

co-pymol MCPサーバーは何に使いますか?

co-pymolは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでco-pymol MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでco-pymolを利用できます。

TypingMindでco-pymol MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。co-pymolを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

co-pymol MCPをTypingMindに接続するにはどうすればよいですか?

co-pymolは、ローカルMCPコネクタを使うか、リモートMCPサーバーのURLを追加することでTypingMindに接続できます。サーバーがデバイス上のファイル、アプリ、プライベートリソースにアクセスする必要がある場合はローカルコネクタを、MCPサーバーがリモートでホストされている場合はサーバーURLを使用してください。

TypingMindでco-pymol MCPのどのようなツールを利用できますか?

co-pymolはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

co-pymol MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。co-pymolで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇