Skip to main content

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

Metadata

Release files for pymol-agent-bridge 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymol-agent-bridge 1.0.0
File Size Uploaded
pymol_agent_bridge-1.0.0.tar.gz 15.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pymol-agent-bridge 1.0.0
File Interpreter ABI Platform
pymol_agent_bridge-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.5 kB

Release files / pymol_agent_bridge-1.0.0.tar.gz

Download URL pymol_agent_bridge-1.0.0.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
badbca2bd55ebf9e5e7d8f62e18715c729a80399050dc2f965b56fe21e422903
BLAKE2b-256 checksum
How to use checksums
018567b7f4c5e7ae41ea8ed16da264230961ceb074b12eb1ea24f73ff51104bc
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / pymol_agent_bridge-1.0.0-py3-none-any.whl

Download URL pymol_agent_bridge-1.0.0-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
965db7739b69cf53d00f81123c95034c93e164644a00baea8d541d09bb16aaf7
BLAKE2b-256 checksum
How to use checksums
ebf579e5b225a96f73098cf75464b03e176033fa082255f392054ab90f163a37
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page