Logo co-pymol

co-pymol

Cộng đồng
soo-jeongkim

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

Nhà phát hànhsoo-jeongkim
Kho mãco-pymol
Ngôn ngữPython
Bản fork
3
Sao
44
Công cụ có sẵn
0
Phương thức truyền tảistdio, streamable-http
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    co-pymol cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    44 sao và 3 bản fork từ kho mã được liên kết.

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.

Cài đặt

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

Dùng MCP co-pymol với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối co-pymol, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. Bạn có thể chạy MCP ngay trên thiết bị của mình hoặc kết nối qua URL của máy chủ MCP từ xa.

Cách 1: Dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm co-pymol làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của co-pymol.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "co-pymol": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của co-pymol, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của co-pymol.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng co-pymol giúp tôi làm việc này không?
co-pymol
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng co-pymol.

Cách 2: Thêm URL máy chủ MCP

Dùng cách này khi co-pymol đã được lưu trữ từ xa hoặc nhóm của bạn muốn có một trình kết nối dùng chung cho nhiều người dùng.

1

Mở mục Trình kết nối MCP

Trong TypingMind, vào Plugin, mở mục Trình kết nối MCP, rồi chọn Thêm URL.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Vào mục Plugin.
  3. Mở mục Trình kết nối MCP.
  4. Nhấp vào Thêm URL.
Biểu mẫu Thêm URL máy chủ MCP tùy chỉnh của TypingMind
2

Dán URL máy chủ

Nhập URL máy chủ MCP do nhà cung cấp cung cấp vào trường URL máy chủ. Thêm tên kết nối, mô tả, biểu tượng, header HTTP tùy chỉnh hoặc cài đặt ứng dụng khách OAuth nếu máy chủ yêu cầu.

  1. Dán URL máy chủ MCP do nhà cung cấp cung cấp vào trường URL máy chủ.
  2. Nhập tên kết nối cho co-pymol.
  3. Thêm mô tả và biểu tượng nếu bạn muốn dễ nhận biết kết nối hơn.
  4. Thêm header HTTP tùy chỉnh hoặc thông tin ứng dụng khách OAuth nếu máy chủ yêu cầu xác thực.
3

Tạo kết nối

Nhấp vào Tạo kết nối, sau đó quay lại danh sách Plugin và xác nhận kết nối MCP mới đang hoạt động.

  1. Nhấp vào Tạo kết nối.
  2. Quay lại danh sách trình kết nối MCP.
  3. Xác nhận kết nối co-pymol hiển thị trạng thái đang hoạt động.
  4. Làm mới danh sách plugin nếu kết nối chưa xuất hiện ngay.
4

Đổi mô hình mà không cần kết nối lại

Bắt đầu cuộc trò chuyện với mô hình bạn thích, bật các công cụ của co-pymol trong mục Plugin và chuyển sang mô hình khác khi cần. Kết nối MCP vẫn sẵn dùng trong không gian làm việc TypingMind.

  1. Bắt đầu cuộc trò chuyện mới trong TypingMind.
  2. Chọn mô hình AI bạn muốn dùng.
  3. Bật các công cụ của co-pymol trong mục Plugin.
  4. Yêu cầu mô hình dùng công cụ khi cần.
  5. Chuyển sang mô hình AI khác và dùng lại cùng kết nối MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng co-pymol giúp tôi làm việc này không?
co-pymol
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng co-pymol.

Câu hỏi thường gặp

Máy chủ MCP co-pymol dùng để làm gì?

co-pymol là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP co-pymol với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng co-pymol với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP co-pymol với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối co-pymol, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP co-pymol với TypingMind?

Bạn có thể kết nối co-pymol trong TypingMind bằng trình kết nối MCP cục bộ hoặc bằng cách thêm URL máy chủ MCP từ xa. Dùng trình kết nối cục bộ khi máy chủ cần truy cập tệp, ứng dụng hoặc tài nguyên riêng trên thiết bị của bạn; dùng URL máy chủ khi máy chủ MCP được lưu trữ từ xa.

MCP co-pymol cung cấp những công cụ nào trong TypingMind?

co-pymol cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP co-pymol không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu co-pymol yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇