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ı
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。