Skip to main content
Glama
pymol-cursor-mcp

pymol-cursor-mcp

by truong128

pymol-cursor-mcp

Steuern Sie PyMOL aus Cursor über das Model Context Protocol (MCP). Beschreiben Sie Strukturen und Stile in einfacher Sprache; der Assistent ruft PyMOL über XML‑RPC auf (run_command, run_python, pymol_get).

Dieses Projekt bündelt und dokumentiert einen Cursor-First-Workflow. Der gleiche MCP-Server funktioniert auch mit Claude Code, falls Sie dieses CLI bevorzugen.

Inspiration durch das Original: nagarh/pymol-claude-code (PyMOL + MCP für Claude Code). Dieses Repository erweitert diesen Ansatz um eine portable Cursor-Konfiguration, Prüfungen, Skripte und Installationsanleitungen.


Architektur (animiert)

Der gleiche Diagrammstil wie beim ursprünglichen flow.svg, aktualisiert für Cursor (cyanfarbener Knoten). Verwendet SVG/CSS-Animation (animateMotion, Keyframes). Falls Ihre Markdown-Vorschau statisch aussieht, öffnen Sie flow.svg direkt auf GitHub, um die vollständige Animation zu sehen.

Related MCP server: MikroTik Cursor MCP

Was Sie erhalten

Komponente

Zweck

pymol_mcp_server.py

MCP-Server (stdio) → PyMOL XML‑RPC

.cursor/mcp.json

Registriert den pymol MCP-Server unter Verwendung von ${workspaceFolder}

.cursor/rules/*.mdc

Agenten-Hinweise für die Nutzung von PyMOL-Tools

scripts/start_pymol_for_mcp.sh

Startet PyMOL mit -R (macOS/Linux)

verify_stack.py

Integritätsprüfung: venv + MCP-Import + RPC zu PyMOL

examples/restore_pocket_labels.pml

Beispiel-PyMOL-Skript (Beschriftungen / Tasche)

flow.svg

Animiertes Architekturdiagramm (gleicher Stil wie im ursprünglichen Repository)


Schnellinstallation

git clone https://github.com/truong128/pymol-cursor-mcp.git
cd pymol-cursor-mcp

python3 -m venv venv
source venv/bin/activate          # Windows: venv\Scripts\activate
pip install -U pip
pip install -r requirements.txt
deactivate

Installieren Sie PyMOL (conda‑forge empfohlen) und starten Sie dann RPC:

conda activate pymol_mcp          # your env with pymol-open-source
pymol -R

Oder: ./scripts/start_pymol_for_mcp.sh (nach chmod +x).

In Cursor: Ordner öffnen → dieses Repository → Einstellungen → MCP → bestätigen, dass pymol verbunden ist → Cursor bei Bedarf neu starten.

python3 verify_stack.py

Sollte Folgendes ausgeben: OK: MCP import + PyMOL RPC at http://localhost:9123

Vollständige Schritt-für-Schritt-Anleitung: INSTALL.md


Tägliche Nutzung

  1. Terminal: pymol -R oder VS Code/Cursor Task: „PyMOL: start with XML-RPC“.

  2. Cursor: Chat / Agent mit geöffnetem Ordner verwenden.

  3. Prompt: z. B. „Fetch 1hvr, cartoon on protein, sticks on ligand.“


Zusammenfassung der Änderungen gegenüber dem „Claude Code only“-Original

Thema

Hier

IDE

Cursor primär; .cursor/mcp.json, Regeln, Tasks

RPC URL

PYMOL_RPC_URL Umgebungsvariable (Standard http://localhost:9123)

Pfade

${workspaceFolder} — überall klonbar

Windows

.cursor/mcp.json.windows.example

Überprüfung

verify_stack.py

PyMOL-Start

scripts/start_pymol_for_mcp.sh + Task ausführen


Fehlerbehebung

  • MCP getrennt: Siehe Cursor Ausgabe → MCP-Protokolle; venv neu erstellen; Repository-Wurzel als Arbeitsbereich erneut öffnen.

  • PyMOL-Fehler / fehlende .dylib: Installieren Sie PyMOL von conda-forge in eine dedizierte Umgebung (siehe INSTALL.md).

  • Remote/HPC: Führen Sie MCP dort aus, wo Ihr Editor läuft; tunneln Sie RPC (PYMOL_RPC_URL, SSH -R) — Details in INSTALL.md.


Credits

  • PyMOL MCP-Idee und ursprünglicher Server: pymol-claude-code — Hemant Nagar.

  • Paketierung und Cursor-fokussierte Dokumentation: truong128.

Lizenz

MIT — siehe LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables control of VMD2 for molecular dynamics analysis through natural language, allowing users to load structures, set representations, measure distances, compute RMSD, and render images without Tcl scripting.
      8
      -
    • A
      license
      C
      quality
      B
      maintenance
      A Model Context Protocol server that lets you drive PyMOL with natural language, enabling structure loading, analytical views, measurements, and protein exploration through AI assistants.
      135
      17
      MIT