Skip to main content

Lightweight bridge connecting coding agents to PyMOL via TCP socket

Project description

pymol-agent-bridge

A lightweight bridge that lets coding agents control PyMOL. Works with any agent that has a terminal — Claude Code, Cursor, Codex, or anything else.

Why

PyMOL is powerful but complex. Coding agents make it accessible: you describe what you want in plain language and the agent handles the PyMOL commands. Because agents work in your terminal alongside your code, they can tie together structure analysis, literature, data pipelines, and visualization in ways that a standalone tool can't — fetching structures from databases, annotating functional sites from literature, labeling residues with predictions, or sanity-checking de novo protein designs.

This bridge connects your agent to a running PyMOL instance. That's all it does. No new UI, no LLM layer, no wrapper around PyMOL's functionality — just a pipe between your agent's terminal and PyMOL's Python API.

How it works

Setup installs a small plugin into your .pymolrc that opens a TCP socket listener inside PyMOL. When your agent needs to interact with PyMOL, it sends Python commands through this socket via a simple CLI. The commands execute against PyMOL's standard cmd.* API, and results come back over the same connection. One socket, one port (9880), zero runtime dependencies.

Install

pip install pymol-agent-bridge
pymol-agent-bridge setup

Setup will find your PyMOL installation (or help you install it), configure the bridge plugin in your .pymolrc, and create a stable wrapper script at ~/.pymol-agent-bridge/bin/pymol-agent-bridge.

Usage

After setup, open your coding agent and start working:

"Load the structure 1UBQ and color it by secondary structure"

"Fetch 6LU7, highlight the active site residues, and render a high-res image"

"Compare the binding pockets of these two kinase structures"

The agent launches PyMOL if needed, sends commands through the bridge, and shows you the results. You don't need to learn any CLI commands — the agent knows how to use the bridge.

Features

  • Zero dependencies — Pure Python standard library. Nothing to install beyond the bridge itself.
  • Cross-platform — macOS, Linux, and Windows.
  • Persistent session — PyMOL stays running between commands. State is preserved.
  • JSON output — Structured output mode for programmatic use.
  • Stable paths — Wrapper script with baked Python path survives environment changes.
  • Agent-agnostic — Works with any coding agent that can run shell commands.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymol_agent_bridge-1.0.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymol_agent_bridge-1.0.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file pymol_agent_bridge-1.0.0.tar.gz.

File metadata

  • Download URL: pymol_agent_bridge-1.0.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pymol_agent_bridge-1.0.0.tar.gz
Algorithm Hash digest
SHA256 badbca2bd55ebf9e5e7d8f62e18715c729a80399050dc2f965b56fe21e422903
MD5 d4fec87633f02b2474ba1c716060707a
BLAKE2b-256 018567b7f4c5e7ae41ea8ed16da264230961ceb074b12eb1ea24f73ff51104bc

See more details on using hashes here.

File details

Details for the file pymol_agent_bridge-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pymol_agent_bridge-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pymol_agent_bridge-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 965db7739b69cf53d00f81123c95034c93e164644a00baea8d541d09bb16aaf7
MD5 9ad5acb24dbdafe63a3c4d864fd14797
BLAKE2b-256 ebf579e5b225a96f73098cf75464b03e176033fa082255f392054ab90f163a37

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page