MolDraw Docs

Connect AI agents to MolDraw desktop

Short answer: In the MolDraw desktop app, open Settings, then AI agents. Turn on Allow AI agents and click Add next to Claude Desktop, Cursor, Claude Code or Codex. Restart that app. It can now read and edit the structure open in MolDraw, and you can undo every change.

Last updated · By the MolDraw team at LabCanvas

View .mdSection PDF

What it does#

The desktop app has a local connector for AI apps that speak MCP (Model Context Protocol). An agent in Claude Desktop, Cursor, Claude Code or Codex can then work on your canvas while you watch:

  • Read the structure you have open, as SMILES or a molfile.
  • Draw a structure from a name, SMILES or molfile, or replace the canvas.
  • Turn a name into a structure. MolDraw uses its local OPSIN model when it is installed, else PubChem.
  • Predict a ¹H or ¹³C NMR spectrum. MolDraw uses its local model when it is installed, else the online predictor.
  • Export a PNG or SVG picture.
  • List and open your designs, or open a structure file from disk.
  • Run any editor tool, such as Clean up, add hydrogens or color rings.

Each change shows on the canvas at once and is one step in Undo. Press Ctrl+Z to take it back.

Turn it on#

  1. Open the MolDraw desktop app.
  2. Click Settings (gear icon), then AI agents.
  3. Turn on Allow AI agents.
  4. Under Add MolDraw to an AI app, click Add next to your AI app.
  5. Restart that AI app.
  6. Ask it to do something, for example "Draw caffeine in MolDraw".
  7. The first time an app connects, MolDraw asks you to allow it. Click Allow.

Keep MolDraw open while you work. If it is closed, the AI app starts it the first time it needs it.

Supported AI apps#

App What the Add button does Manual setup
Claude Desktop Adds a moldraw entry to claude_desktop_config.json Paste the JSON snippet from Settings
Cursor Adds a moldraw entry to ~/.cursor/mcp.json (all projects) Paste the JSON snippet
Claude Code Adds a moldraw entry for all projects (user scope) Run the claude mcp add moldraw ... command shown in Settings
Codex CLI and Codex IDE extension (OpenAI) Adds [mcp_servers.moldraw] to ~/.codex/config.toml Run codex mcp add moldraw ... or paste the TOML snippet
ChatGPT Not available locally See below

Click the arrow next to an app to see the exact snippet and a Copy button. Use it if you prefer to edit the file yourself.

Note

MolDraw copies each config file before it changes it. The copy sits next to the file and ends in .moldraw-backup- and a date. MolDraw only changes its own moldraw entry and keeps all your other servers and settings.

ChatGPT#

ChatGPT only connects to online MCP servers. It cannot start a program on your computer, so it cannot reach the drawing open in the desktop app. You can add the hosted MolDraw server https://mcp.moldraw.com/mcp as a custom connector in ChatGPT developer mode and sign in with your MolDraw account. That connector works on MolDraw cloud documents, not on your local canvas. See Connect AI agents with MCP. To work on your local canvas with OpenAI models, use Codex.

Privacy and safety#

  • The connector only listens on your own computer. Other computers on your network cannot reach it.
  • Each install has a secret key that only your user account can read. An AI app needs it to connect.
  • MolDraw asks you once for each new AI app. Click Remove access under Allowed apps to take that back.
  • Turn off Allow AI agents to stop all connections.
  • Your drawing goes to the AI app you connected. Name lookups and NMR use the internet only when no local model is installed.

Tips#

  • Status in Settings shows which AI apps are connected and how many requests they sent.
  • If the AI app says MolDraw is not running, open MolDraw and ask again.
  • If it says the connector is off, turn on Allow AI agents.
  • After you move or reinstall MolDraw, click Update next to each AI app.

Questions and answers

Do I need a MolDraw account?

No. The local connector works without an account. Online name lookup and NMR work without one too.

Does it work offline?

Yes for drawing, reading, export and editor tools. Name lookup and NMR need internet unless the local models are installed.

Can the AI app change my drawing without me knowing?

Every change shows on the canvas at once, and a note names the app that made it. Each change is one Undo step.

Why does the AI app not see MolDraw after I click Add?

Restart the AI app. Claude Desktop and Cursor read their MCP settings when they start.

Does it work with the web editor?

No. A browser tab cannot run a local connector, so it is part of the desktop app. On the web, use the hosted MolDraw MCP server instead.