Pymol Claude MCPのロゴ

Pymol Claude MCP

コミュニティ
stavasol96-arch

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

公開者stavasol96-arch
リポジトリPymol-Claude-MCP
言語Python
フォーク
12
スター
65
利用可能なツール
0
通信方式stdio
リンク
  • ツールをAIワークフローに接続

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

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

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

  • コピーして使える設定

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

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

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

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)

Pymol Claude MCPのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Pymol Claude MCPに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

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

Pymol Claude MCPをサーバーとして追加

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

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

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

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

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

よくある質問

Pymol Claude MCP MCPサーバーは何に使いますか?

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

TypingMindでPymol Claude MCP MCPを複数のAIモデルと併用できますか?

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

TypingMindでPymol Claude MCP MCPを使うメリットは何ですか?

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

Pymol Claude MCP MCPをTypingMindに接続するにはどうすればよいですか?

Pymol Claude MCPはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでPymol Claude MCP MCPのどのようなツールを利用できますか?

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

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

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

関連するMCPサーバー

すべて見る

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

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