Logotipo de co-pymol

co-pymol

Comunidad
soo-jeongkim

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

Editorsoo-jeongkim
Repositorioco-pymol
IdiomaPython
Forks
3
Estrellas
44
Herramientas disponibles
0
Tipo de transportestdio, streamable-http
Categorías
LicenciaMIT
Enlaces
  • Conecta herramientas a flujos de trabajo con IA

    co-pymol ofrece funciones MCP que pueden usar los clientes y agentes de IA compatibles.

  • 0 herramientas disponibles

    Explora a continuación las acciones que se pueden invocar, con sus nombres y descripciones cuando el servidor los proporcione.

  • Configuración lista para copiar

    Usa los ejemplos de instalación para configurar este servidor en tu cliente MCP preferido.

  • Indicadores de interés en el código abierto

    44 estrellas y 3 forks en el repositorio enlazado.

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.

Instalación

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

Usa el MCP de co-pymol con varios modelos de IA

TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que, una vez conectado co-pymol, puedes usarlo con distintos modelos de IA en TypingMind sin tener que configurarlo por separado para cada modelo. Puedes ejecutar MCP localmente en tu dispositivo o conectarte a la URL de un servidor MCP remoto.

Opción 1: Usa el conector local

Usa esta opción si el servidor MCP necesita acceder a archivos locales, aplicaciones o recursos privados de tu ordenador.

1

Abre los ajustes de MCP

En TypingMind, ve a Ajustes, luego a Ajustes avanzados y a Model Context Protocol, y elige Configurar conector.

  1. Abre TypingMind en tu navegador.
  2. Haz clic en el icono de Ajustes.
  3. Ve a Ajustes avanzados.
  4. Abre la sección Model Context Protocol.
  5. Haz clic en Configurar conector y elige Este dispositivo.
Pantalla de configuración del conector MCP de TypingMind con «Este dispositivo» seleccionado
2

Ejecuta el comando del conector

Elige Este dispositivo, copia el comando de TypingMind y ejecútalo en Terminal. Mantén el proceso en ejecución mientras uses MCP.

  1. Copia el comando de configuración que muestra TypingMind.
  2. Abre Terminal en macOS o Windows Terminal en Windows.
  3. Pega y ejecuta el comando.
  4. Acepta la instalación del paquete si Terminal te pide confirmación para continuar.
  5. Mantén el proceso en ejecución en la ventana de Terminal mientras uses las herramientas MCP.
3

Añade co-pymol como servidor

Cuando el estado del conector sea «Listo», haz clic en «Edita servidores» y pega la configuración del servidor MCP.

  1. Espera hasta que el estado del conector indique «Listo».
  2. Haz clic en Edita servidores.
  3. Pega la configuración del servidor MCP de co-pymol.
  4. Guarda la lista de servidores.
  5. Actualiza para comprobar que el conector sigue listo.
Ajustes de MCP de TypingMind con un servidor activo y el botón «Edita servidores»
{
  "mcpServers": {
    "co-pymol": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Úsala con distintos modelos

Guarda la lista de servidores, abre Plugins, activa las herramientas MCP de co-pymol y selecciona cualquier modelo de IA compatible en TypingMind para usar las herramientas en el chat o asignárselas a un agente de IA.

  1. Abre la página Plugins en TypingMind.
  2. Activa las herramientas MCP de co-pymol.
  3. Inicia un chat y elige el modelo de IA que quieras usar.
  4. Usa las herramientas MCP en el chat o asígnalas a un agente de IA.
  5. Cambia a otro modelo de IA cuando lo necesites sin volver a conectar MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar co-pymol para ayudarme con esta tarea?
co-pymol
Claro. Lo he leído.
Esto he encontrado usando co-pymol.

Opción 2: Añade la URL de un servidor MCP

Usa esta opción si co-pymol ya está alojado en un servidor remoto o si tu equipo quiere un conector compartido al que puedan acceder varios usuarios.

1

Abre Conectores MCP

En TypingMind, ve a Plugins, abre Conectores MCP y elige Añadir URL.

  1. Abre TypingMind en tu navegador.
  2. Ve a Plugins.
  3. Abre Conectores MCP.
  4. Haz clic en Añadir URL.
Formulario de TypingMind para añadir la URL de un servidor MCP personalizado
2

Pega la URL del servidor

Introduce la URL del servidor MCP facilitada por el proveedor en el campo URL del servidor. Añade un nombre de conexión, una descripción, un icono, cabeceras HTTP personalizadas o la configuración del cliente OAuth si el servidor los requiere.

  1. Pega la URL del servidor MCP facilitada por el proveedor en el campo URL del servidor.
  2. Introduce un nombre para la conexión de co-pymol.
  3. Añade una descripción y un icono si quieres que sea más fácil de identificar.
  4. Añade cabeceras HTTP personalizadas o los datos del cliente OAuth si el servidor requiere autenticación.
3

Crea la conexión

Haz clic en Crear conexión, vuelve a la lista de plugins y comprueba que la nueva conexión MCP esté activa.

  1. Haz clic en Crear conexión.
  2. Vuelve a la lista de conectores MCP.
  3. Comprueba que la conexión de co-pymol aparezca como activa.
  4. Actualiza la lista de plugins si la conexión no aparece de inmediato.
4

Cambia de modelo sin volver a conectar

Inicia un chat con tu modelo preferido, activa las herramientas de co-pymol desde Plugins y cambia de modelo cuando lo necesites. La conexión MCP seguirá disponible en el espacio de trabajo de TypingMind.

  1. Inicia un nuevo chat en TypingMind.
  2. Selecciona el modelo de IA que quieras usar.
  3. Activa las herramientas de co-pymol desde Plugins.
  4. Pide al modelo que use la herramienta cuando sea necesario.
  5. Cambia a otro modelo de IA y reutiliza la misma conexión MCP.
Chat de TypingMind que usa herramientas MCP activadas con un modelo de IA seleccionado
¿Puedes usar co-pymol para ayudarme con esta tarea?
co-pymol
Claro. Lo he leído.
Esto he encontrado usando co-pymol.

Preguntas frecuentes

¿Para qué sirve el servidor MCP co-pymol?

co-pymol es un servidor MCP que permite a los clientes de IA compatibles conectarse a herramientas y contexto externos. En TypingMind, basta con añadir este servidor MCP una vez para que sus herramientas estén disponibles en tu espacio de trabajo de IA.

¿Puedo usar el servidor MCP co-pymol con varios modelos de IA en TypingMind?

Sí. TypingMind conecta las herramientas MCP a nivel del espacio de trabajo, por lo que puedes usar co-pymol con distintos modelos de IA, como Claude, ChatGPT, Gemini u otros que hayas configurado en TypingMind, sin configurar el servidor MCP por separado para cada modelo.

¿Por qué usar el conector MCP de co-pymol con TypingMind?

TypingMind es una de las mejores interfaces de chat con LLM porque reúne varios modelos de IA, prompts, plugins, agentes de IA, claves de API y herramientas MCP en un solo espacio de trabajo. Con co-pymol conectado, puedes usar sus herramientas MCP con tus modelos preferidos y mantener organizado tu flujo de trabajo de chat en TypingMind.

¿Cómo conecto el servidor MCP co-pymol a TypingMind?

Puedes conectar co-pymol en TypingMind con el conector MCP local o añadiendo la URL de un servidor MCP remoto. Usa el conector local cuando el servidor necesite acceder a archivos, aplicaciones o recursos privados de tu dispositivo, y una URL de servidor cuando el servidor MCP esté alojado de forma remota.

¿Qué herramientas ofrece el servidor MCP co-pymol en TypingMind?

co-pymol ofrece funciones MCP que puedes activar desde la página Plugins de TypingMind y usar en el chat o asignar a agentes de IA.

¿Tengo que compartir mis claves de API con TypingMind para usar el servidor MCP co-pymol?

No. TypingMind prioriza el funcionamiento local y te permite mantener el control de tus proveedores de modelos, claves de API, prompts y configuración MCP. Si co-pymol requiere autenticación, añade las cabeceras, los ajustes de OAuth o la configuración local necesarios para ese servidor MCP al crear la conexión.

Servidores MCP relacionados

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇