vmd-mcp
Drive VMD headlessly from any MCP client to analyze structures and trajectories, and ray-trace publication-quality images with no display.
README
<div align="center">
🔬 vmd-mcp
Drive VMD headlessly from any MCP client.
Analyse structures & trajectories (RMSD, radius of gyration, SASA, atom selections) and ray-trace publication-quality images with no display — all through the Model Context Protocol.
</div>
Why
VMD is the standard tool for molecular visualisation and trajectory analysis, but its power
lives behind a GUI and a Tcl console. vmd-mcp runs VMD in text mode, turns the common
analyses and rendering into clean MCP tools, and parses the results back into structured data —
so an LLM agent can measure an RMSD curve or render a labelled cartoon without a display,
without you writing a line of Tcl.
Features
- Headless analysis — molecule summaries, atom-selection counts, per-frame RMSD (with optional least-squares fit), radius of gyration, and SASA.
- Headless rendering — ray-traces images with VMD's built-in Tachyon and saves PNG, no X11 / display required. Choose representation, coloring, frame, and resolution.
- Hybrid tool design — typed helpers for common jobs plus a generic
run_tclescape hatch that runs any VMD Tcl and returns your@@VMDMCP@@-tagged results. - Robust in non-interactive sessions — works around VMD's
-eofexit/stdin anddisplay resizequirks that otherwise break headless runs (see How it works). - Zero-config discovery — finds VMD on
PATHor in macOS.appbundles (override withVMD_BIN).
Tools
| Category | Tool | Purpose |
|---|---|---|
| Introspect | vmd_info |
VMD version + resolved launcher path |
molecule_info |
Atoms, frames, protein/water/chain/residue counts | |
count_atoms |
Count atoms matching a VMD selection | |
| Analyse | radius_of_gyration |
Per-frame R_gyr + min/max/mean |
rmsd |
Per-frame RMSD vs a reference frame (optional alignment) | |
sasa |
Per-frame solvent-accessible surface area | |
| Render | render_image |
Headless Tachyon ray-trace → PNG |
| Escape hatch | run_tcl |
Any VMD Tcl script (with marker parsing) |
Requirements
- VMD installed and runnable (GUI build is fine; it is used in
-dispdev textmode). - Python ≥ 3.10.
- PNG conversion: macOS
sips(built in) or ImageMagick. Without either, renders are saved as.tga. - An MCP client (e.g. Claude Code or Claude Desktop).
Install & run
# Run straight from GitHub with uv — no global install needed
uvx --from git+https://github.com/Alierkn/vmd-mcp vmd-mcp
<details> <summary>Alternative: pip / pipx</summary>
pipx install git+https://github.com/Alierkn/vmd-mcp
# or
pip install git+https://github.com/Alierkn/vmd-mcp
vmd-mcp # starts the stdio server
</details>
Connect it to your MCP client
Claude Code
claude mcp add vmd --scope user -- \
uvx --from git+https://github.com/Alierkn/vmd-mcp vmd-mcp
Check: claude mcp list → vmd: … ✔ Connected.
Claude Desktop
{
"mcpServers": {
"vmd": {
"command": "uvx",
"args": ["--from", "git+https://github.com/Alierkn/vmd-mcp", "vmd-mcp"],
"env": { "VMD_BIN": "/Applications/VMD2b1.app/Contents/MacOS/startup.command" }
}
}
}
Configuration
| Env var | Default | Meaning |
|---|---|---|
VMD_BIN |
auto (PATH, then macOS .app) |
Path to the VMD launcher |
VMD_MCP_ROOT |
~/vmd-mcp/output |
Where rendered images / scratch are written |
Example prompts
"Load
bpti.pdb, tell me how many residues and chains it has, then render a Structure-colored NewCartoon at 1200×900 and save it asbpti.png."
"For
topol.tpr+md.xtc, compute the CA-RMSD over the trajectory aligned to frame 0, and report min / max / mean."
How it works
Each tool generates a small Tcl script and runs vmd -dispdev text -e script.tcl. Results are
emitted with a @@VMDMCP@@ key=value marker that the server parses into structured data.
Two headless-specific gotchas are handled for you:
-eofexit+ non-tty stdin would make VMD exit before a long render finishes — so the server relies on a trailingquitandstdin=DEVNULLinstead.display resizeis unreliable without a real display — so render resolution is set via the-size W Hcommand-line flag.
Images are ray-traced with render TachyonInternal (built-in, no external renderer needed) and
converted TGA → PNG via sips/ImageMagick when available.
Development
git clone https://github.com/Alierkn/vmd-mcp && cd vmd-mcp
uv sync --extra dev
uv run pytest # VMD-dependent tests auto-skip if VMD is absent
uv run ruff check .
See CONTRIBUTING.md.
Related
- gromacs-mcp — companion MCP server that runs GROMACS simulations. Pair them: simulate with GROMACS, then analyse & visualise with VMD.
License
MIT © Ali Erkan Ocaklı
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.