live-chemdraw-mcp

live-chemdraw-mcp

Connects AI assistants to a live ChemDraw window on Windows via COM automation, enabling drawing, editing, and organizing chemical structures directly in the open document. Supports structure insert/export, scope tables, shorthand groups, figure layout, chemistry QC, publication tools, annotations, polymer brackets, and TLC plates.

Category
访问服务器

README

live-chemdraw-mcp

Tests

MCP server that connects AI assistants to a live ChemDraw window on Windows via COM automation — draw, edit, and organize structures directly in the document you have open.

Capabilities:

  • Insert & export — SMILES, name, molfile, InChI, CDXML; export as an image, structure text, or straight to the clipboard
  • Substrate-scope tables — build a whole scope figure in one call, sized for journal columns, with labels/yields placed under each structure
  • Shorthand groups — detect and contract functional groups inline (chemdraw_contract_group: Ph, TES, Boc, Ts... ~40 groups, SMARTS-matched via RDKit), or contract/expand a whole structure to a single label, including a one-call bulk expand across the whole document
  • Figure layoutchemdraw_describe_canvas gives one semantic read of a whole page (structures, captions matched to their owners, panel boxes, overlap/overflow violations); chemdraw_arrange_in_region fits structures into a panel box in one call, captions riding along, nothing ever rescaled; chemdraw_get_layout/chemdraw_move_objects for raw-geometry plans with automatic collateral-movement detection
  • Chemistry QC — read/set stereochemistry (wedge/hash, "and1"/"or1" enhanced-stereo grouping), duplicate detection, valence warnings, IUPAC naming, HRMS text generation
  • Publication tools — journal style presets, reaction schemes, and derivative-library enumeration with RDKit-computed properties
  • Annotations — mechanism/reaction arrows (chemdraw_make_arrow: solid/ hollow/angle heads, single-barb "fishhook" electron-pushing arrows, crossed-out "no-go" pathway markers, dipole markers) and symbols (chemdraw_make_symbol: racemic/absolute/relative stereo-descriptor labels; lone pairs/radicals/daggers also place but currently render at a tiny, apparently unscalable default size — see the tool's own docstring). Isotope labeling (chemdraw_edit_atom(..., isotope=13, ...)) survives export as real isotope notation, not just a ChemDraw-display label. Limitation: arrows/symbols are free-floating — moving a nearby structure with chemdraw_move_objects/chemdraw_transform will NOT carry them along, the same class of gap already documented for captions below. Curved/arc arrows and true double-object ⇌ equilibrium-arrow pairs aren't supported yet — both were probed live and need more COM investigation before a design commitment (see docs/com_typelib/)
  • Polymer repeat-unit brackets (chemdraw_make_bracket: square/curly/ round glyph, SRU/monomer/copolymer/crosslink/... usage with ChemDraw's own auto-generated abbreviation label — "n"/"mon"/"xl"/etc.) wraps a structure (or an explicit rectangle) with an opening + closing bracket pair. Limitations, confirmed live, not solved: RepeatCount/SRULabel/ ComponentOrder cannot be set via COM at all (both get and put reliably raise); the pair's mirrored orientation ("[...]" vs two identically- oriented marks) is unreliable once a second bracket exists in one automation session — always check the exported image; brackets are purely decorative (not bound to real atom/bond membership despite ChemDraw exposing InsideAtoms/ContainedAtoms/CrossingBonds properties — confirmed these don't reflect true geometry) and share the same free-floating/doesn't-move-with-the-structure limitation as arrows/ symbols above
  • TLC plates (chemdraw_make_tlc_plate: rectangular plate outline with labeled Rf-spot lanes for reaction-monitoring figures) — a spot's vertical position is driven entirely by its rf (0-1) property, which ChemDraw itself interpolates between the plate's origin/solvent-front lines (confirmed live via measured screenshot pixel positions, within ~1% of the expected fraction) — no manual position math needed. Supports show_rf (auto "Rf = 0.NN" label), filled/bold/dashed (a hollow dashed-outline circle is visually confirmed distinct from a solid dot), and an experimental tail (comet-tail smear) whose visual effect could not be confirmed at available screenshot resolution. Hard limit, confirmed live and enforced by the tool (raises before any COM call): a single lane can hold at most 2 spots — ChemDraw's own AddSpot is a silent no-op past that, with no error at all. Same free-floating/ doesn't-move-with-the-structure limitation as arrows/symbols/brackets above.

This README covers setup and usage — not a per-tool reference (each tool's exact parameters, return shape, and usage notes live in its own docstring, visible to any MCP client via its tool listing) and not internal architecture or ChemDraw-COM implementation notes (see AGENTS.md for those — useful reading whenever you're looking at the source, whether you're debugging something, curious how it works, or extending it, not only for the last one).

Built and validated against ChemDraw 26 (Revvity) on Windows 11 / Python 3.14.

This is an independent, unofficial project. It is not affiliated with, endorsed by, or supported by Revvity or PerkinElmer. "ChemDraw" is a trademark of its respective owner; it's referenced here only to describe compatibility. You'll need your own licensed copy of ChemDraw to use this.

Setup

cd live-chemdraw-mcp
python -m venv .venv
.venv\Scripts\python -m pip install pywin32 rdkit "mcp[cli]" pytest

Register in %APPDATA%\Claude\claude_desktop_config.json (replace C:\\path\\to\\live-chemdraw-mcp with wherever you cloned it):

"mcpServers": {
  "chemdraw": {
    "command": "C:\\path\\to\\live-chemdraw-mcp\\.venv\\Scripts\\python.exe",
    "args": ["C:\\path\\to\\live-chemdraw-mcp\\server.py"]
  }
}

Restart the Claude desktop app. No ChemDraw-side installation is needed — the server attaches to a running ChemDraw (or launches one) over COM.

Testing

  • .venv\Scripts\python -m pytest — unit tests for the pure logic, all running against fakes/fixtures with no live ChemDraw required: layout math, style presets, HRMS text, dedup, numbering, diff, RDKit enumeration, CDXML parsing/graph-building, substructure/SMARTS matching, canvas/caption classification, reagent-text subscript formatting, and bond-splitting, plus connector-internals coverage for the COM worker's timeout/nudge state machine and targets.py's target-resolution and stale-cache-retry logic.
  • .venv\Scripts\python test_smoke_visual.py — live smoke test; drives a visible ChemDraw window end to end. Watch it run.

Development

Package layout, and the ChemDraw COM quirks this connector was built around (COM crash traps, silent no-ops, timing/caching gotchas) — see AGENTS.md whenever you're looking at the source, not only if you're extending it. None of it matters if you're just talking to the server through Claude (that's what the rest of this README covers), but it's the fastest way to understand why the code is shaped the way it is if you're reading it for any reason.

Troubleshooting

  • In-progress canvas text edit / text tool left active — puts ChemDraw's UI thread in a modal loop that blocks COM. The connector auto-recovers: on a timeout it posts an Escape to ChemDraw's focused control via Win32 (com/nudge.py, a channel separate from the blocked COM one) and retries, so a stray edit no longer wedges the session. Only if that fails do you see the "not responding" error below.
  • "ChemDraw is not responding to automation" — a modal dialog is open (or an edit the auto-nudge couldn't clear); dismiss the dialog or press Escape / click empty canvas, then retry.
  • "ChemDraw stopped responding during this operation" — ChemDraw crashed and was relaunched; recover unsaved work from the automatic backups at %LOCALAPPDATA%\chemdraw-mcp\backups.
  • Tools report structure ids like claude-a1b2c3d4; if one "no longer exists," the structure was deleted/rebuilt — ask Claude to call chemdraw_get_document_state to re-inventory the page.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选