MCP Integration
Draw ToDiagram diagrams in Claude, ChatGPT, Cursor, VS Code and other AI apps with the Model Context Protocol
The ToDiagram MCP server lets AI apps draw diagrams right in the chat. Ask Claude, ChatGPT, Cursor, Codex, VS Code or another MCP app for an architecture map, a flowchart or a diagram of your data, and it appears in the conversation. Save the ones you want to keep to your ToDiagram account, where you can edit them.
Model Context Protocol (MCP) is an open protocol that connects AI apps to outside tools. The ToDiagram server is hosted, so there is nothing to install and no API key to set: you add one URL to your app and sign in.
Connect
Add the server to your app with this URL:
https://mcp.todiagram.com/mcpPick your app for its steps. Each one asks you to sign in to ToDiagram once.
Claude on the web, Claude Desktop and the mobile apps.
Open Customize, then Connectors. Select Add, then Add custom connector.
Name it ToDiagram and use this URL:
https://mcp.todiagram.com/mcpIf it asks for an OAuth client, keep Use Claude's published identity.
Select Add, then Connect, and sign in to ToDiagram.
Sign In
The first time, your app opens ToDiagram in your browser. Sign in, or create a free account, and you see exactly what the app is asking for before you select Allow.
Your app will be able to
- Draw diagrams in your chats
- Save the diagrams you ask it to, as new private documents
- Find, open, update and delete your documents when you ask
- Share a document with a public link or with people you name, when you ask
It can't
- See your password
Try It
Ask in your own words. A few to start with; select one to copy it.
The diagram is drawn in the conversation. Ask again to change it, or ask to save it and you get a link that opens it in the editor.
What It Draws
Your assistant picks the tool. The diagrams are drawn by the same engine as the editor, so what you see in the chat is what opens there.
System diagrams
Architecture, platform and repository overviews, with an icon on each service.
generateSystemDiagramCode diagrams
Classes, types and components as nodes with their fields.
generateCodeDiagramData diagrams
JSON, YAML, CSV and XML, laid out as a diagram you can read.
generateDataDiagramMermaid
Flowcharts, ER diagrams and sequence diagrams from Mermaid text.
generateMermaidDiagramTools
| Tool | What it does |
|---|---|
generateSystemDiagram | Architecture, platform and repository overviews with grouped, icon-first nodes |
generateCodeDiagram | Classes, types and components with key-value rows, icons and nested groups |
generateDataDiagram | Turns JSON, YAML, CSV, XML or JSON Lines data into a diagram |
compareData | Compares two versions of the same data and marks what was added, changed and removed |
generateMermaidDiagram | Mermaid flowchart (or graph), erDiagram and sequenceDiagram |
searchIcons | Finds icon names to use on nodes |
saveDiagram | Saves a diagram as a private document in your account and returns a link to the editor. Given a URL instead, saves a document that shows what the URL serves each time it opens |
exportDiagramImage | Returns a diagram as a PNG image, for apps that don't show diagrams in the chat |
listDiagrams | Lists your documents and the ones shared with you, and searches their names and content |
openDiagram | Opens one of your documents in the chat |
updateDiagram | Changes a document's content or name |
shareDiagram | Makes a document public, or private again |
inviteToDiagram | Shares a document with people by email, as viewers or editors |
deleteDiagram | Deletes one of your documents |
The drawing tools show the diagram in the chat and save nothing. If a diagram has duplicate node ids, or edges that point at ids that don't exist, the tool returns a numbered list of problems so the assistant can fix them and try again. A diagram too large to show in the chat is left to the editor: the assistant offers to save it so you can open it there.
Plans
Drawing in the chat works on every plan. A saved diagram counts toward your plan's documents, as it does in the editor.
| Free | Pro | |
|---|---|---|
| Diagrams drawn in the chat | Yes | Yes |
| Saved diagrams | 3 | 200 |
| Diagrams over the free plan's size limit | No | Yes |
Connected Apps
In the editor, open the menu at the top left and choose Account. The MCP Server tab lists the apps you've connected. Disconnect signs an app out; a chat that's already open can keep drawing for up to an hour.
Privacy
Diagrams are drawn on the fly. Only the ones you save are stored, and they stay private unless you share them. To draw icons and images, the server fetches them from Iconify and from the image URLs in the diagram. A document saved from a URL is fetched from that URL.
Agent Skills
For AI coding agents that support skills, the ToDiagram diagram skill adds diagramming know-how to your agent:
npx skills add todiagram/skills --skill diagramTroubleshooting
- Claude: the Free plan allows one custom connector. On Team and Enterprise, an owner adds it in Organization settings.
- ChatGPT: custom MCP servers need a Pro, Business, Enterprise or Edu plan, and in a workspace an admin may have to add it. On Pro, ChatGPT can draw diagrams but not save them.
- Cursor: keep the
CLIENT_IDline from the setup. - Antigravity: the IDE needs version 2.6.0 or later to sign in.
- Another app: it has to support CIMD, a way for apps to introduce themselves when you sign in. Gemini CLI doesn't support it yet. If your app can only run local servers, see the legacy local server.
- Read the error: the tool names the problem, for example an edge that points at a node id that doesn't exist, and draws nothing until it's fixed
- Mermaid: ToDiagram renders flowcharts (or graphs), ER diagrams and sequence diagrams. Start with one of those on its own line
- Data: make sure JSON, YAML, CSV, XML or JSON Lines is valid
- "Too many diagrams were drawn for this user in the last minute": wait a minute and try again
Legacy Local Server (npm)
The npm package @todiagram/todiagram-mcp is legacy: it keeps working but gets no new features. Use it only if your app can't connect to a remote MCP server. Versions before 1.3.0 stop working on January 31, 2027.
The local server runs on your computer through npx and uses an API key instead of signing in. It creates a private document for every diagram and returns a link to the editor, rather than drawing it in the chat. It follows the REST API's limits.
- Create an API key: in the editor, open the menu at the top left, choose Account, open the API Keys tab and click Create API Key.
- Add the server to your app. Most MCP apps keep their servers in a JSON file in this format (VS Code's
mcp.jsonnames the top-level keyserversinstead ofmcpServers):
{
"mcpServers": {
"todiagram": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@todiagram/todiagram-mcp@latest"],
"env": {
"TODIAGRAM_API_KEY": "your-api-key"
}
}
}
}In Claude Code:
claude mcp add --scope user todiagram -e TODIAGRAM_API_KEY=your-api-key -- npx -y @todiagram/todiagram-mcp@latestIt needs Node.js 18 or later. If a tool says TODIAGRAM_API_KEY is missing, rejected or contains a hidden character, copy the key again from Account > API Keys, update your app's config and restart the app.
Moving to the hosted server: remove the todiagram entry that runs npx from your app's config, connect the hosted server, and delete the API key in Account > API Keys if nothing else uses it.