Логотип 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
Посилання
  • Підключайте інструменти до робочих процесів із ШІ

    co-pymol надає можливості 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"
      ]
    }
  }
}

Використовуйте MCP co-pymol з різними моделями ШІ

TypingMind підключає інструменти MCP на рівні робочого простору, тож після підключення co-pymol ви можете використовувати їх із різними моделями ШІ в TypingMind, а не налаштовувати окремо для кожної моделі. Ви можете запустити MCP локально на своєму пристрої або підключитися до віддаленого сервера MCP за URL.

Варіант 1: використовуйте локальний конектор

Виберіть цей варіант, якщо серверу MCP потрібен доступ до локальних файлів, програм або приватних ресурсів на вашому комп’ютері.

1

Відкрийте налаштування MCP

У TypingMind перейдіть до розділу «Налаштування», відкрийте «Розширені налаштування», потім «Протокол контексту моделі» й виберіть «Параметри конектора».

  1. Відкрийте TypingMind у браузері.
  2. Натисніть значок налаштувань.
  3. Перейдіть до розділу «Розширені налаштування».
  4. Відкрийте розділ «Протокол контексту моделі».
  5. Натисніть «Параметри конектора» й виберіть «Цей пристрій».
Екран налаштування конектора MCP у TypingMind з вибраним варіантом «Цей пристрій»
2

Виконайте команду конектора

Виберіть «Цей пристрій», скопіюйте команду з TypingMind і виконайте її в терміналі. Не зупиняйте процес, поки користуєтеся MCP.

  1. Скопіюйте команду налаштування, показану в TypingMind.
  2. Відкрийте «Термінал» у macOS або Windows Terminal у Windows.
  3. Вставте й виконайте команду.
  4. Підтвердьте встановлення пакета, якщо термінал запитає дозволу продовжити.
  5. Не закривайте вікно термінала й не зупиняйте процес, поки користуєтеся інструментами MCP.
3

Додайте co-pymol як сервер

Коли статус конектора зміниться на «Готово», натисніть «Змінити сервери» та вставте конфігурацію сервера MCP.

  1. Зачекайте, доки статус конектора зміниться на «Готово».
  2. Натисніть «Змінити сервери».
  3. Вставте конфігурацію сервера MCP co-pymol.
  4. Збережіть список серверів.
  5. Оновіть дані, щоб переконатися, що конектор досі готовий до роботи.
Налаштування MCP у TypingMind з активним сервером і кнопкою «Змінити сервери»
{
  "mcpServers": {
    "co-pymol": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Використовуйте підключення з різними моделями

Збережіть список серверів, відкрийте «Плагіни», увімкніть інструменти MCP для co-pymol, а потім виберіть будь-яку підтримувану модель ШІ в TypingMind і використовуйте інструменти в чаті або призначте їх агенту ШІ.

  1. Відкрийте сторінку «Плагіни» в TypingMind.
  2. Увімкніть інструменти MCP для co-pymol.
  3. Почніть чат і виберіть модель ШІ, яку хочете використовувати.
  4. Використовуйте інструменти MCP у чаті або призначте їх агенту ШІ.
  5. За потреби перемикайтеся на іншу модель ШІ без повторного підключення MCP.
Чат TypingMind із використанням увімкнених інструментів MCP і вибраної моделі ШІ
Допоможете з цим завданням через co-pymol?
co-pymol
Звісно. Я це прочитав.
Ось що я знайшов за допомогою co-pymol.

Варіант 2: додайте URL сервера MCP

Виберіть цей варіант, якщо co-pymol уже розміщено віддалено або вашій команді потрібен один спільний конектор для кількох користувачів.

1

Відкрийте конектори MCP

У TypingMind перейдіть до розділу «Плагіни», відкрийте «Конектори MCP» і виберіть «Додати URL».

  1. Відкрийте TypingMind у браузері.
  2. Перейдіть до розділу «Плагіни».
  3. Відкрийте конектори MCP.
  4. Натисніть «Додати URL».
Форма «Додати URL власного сервера MCP» у TypingMind
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. Виберіть модель ШІ, яку хочете використовувати.
  3. Увімкніть інструменти co-pymol у розділі «Плагіни».
  4. За потреби попросіть модель скористатися інструментом.
  5. Перемкніться на іншу модель ШІ й використовуйте те саме підключення MCP.
Чат TypingMind із використанням увімкнених інструментів MCP і вибраної моделі ШІ
Допоможете з цим завданням через co-pymol?
co-pymol
Звісно. Я це прочитав.
Ось що я знайшов за допомогою co-pymol.

Поширені запитання

Для чого використовується сервер MCP co-pymol?

co-pymol — це сервер MCP, який дає змогу сумісним клієнтам ШІ підключатися до зовнішніх інструментів і контексту. У TypingMind ви можете додати цей сервер MCP один раз і зробити його інструменти доступними у своєму робочому просторі ШІ.

Чи можу я використовувати MCP co-pymol з кількома моделями ШІ в TypingMind?

Так. TypingMind підключає інструменти MCP на рівні робочого простору, тому ви можете використовувати co-pymol з різними моделями ШІ, як-от Claude, ChatGPT, Gemini або іншими моделями, які ви налаштували в TypingMind, без окремого налаштування сервера MCP для кожної моделі.

Навіщо використовувати MCP co-pymol із TypingMind?

TypingMind — один із найкращих інтерфейсів для чату з великими мовними моделями, адже він об’єднує різні моделі ШІ, промпти, плагіни, агентів ШІ, ключі API та інструменти MCP в одному робочому просторі. Підключивши co-pymol, ви зможете використовувати його інструменти MCP з вибраними моделями та впорядковано працювати з чатами в TypingMind.

Як підключити MCP co-pymol до TypingMind?

co-pymol можна підключити в TypingMind через локальний конектор MCP або додавши URL віддаленого сервера MCP. Використовуйте локальний конектор, коли серверу потрібен доступ до файлів, застосунків або приватних ресурсів на вашому пристрої, а URL сервера — коли сервер MCP розміщено віддалено.

Які інструменти надає MCP co-pymol у TypingMind?

co-pymol надає можливості MCP, які можна ввімкнути на сторінці «Плагіни» в TypingMind і використовувати в чаті або призначати агентам ШІ.

Чи потрібно передавати свої ключі API в TypingMind, щоб використовувати MCP co-pymol?

Ні. TypingMind орієнтований насамперед на локальну роботу й дає змогу зберігати контроль над постачальниками моделей, ключами API, промптами та конфігурацією MCP. Якщо co-pymol потребує автентифікації, під час створення підключення додайте потрібні заголовки, налаштування OAuth або локальну конфігурацію для цього сервера MCP.

Схожі сервери MCP

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇