Generate software diagrams from natural language, code, ASCII, images, Mermaid.
MCP server for AI Diagram Maker β generate beautiful software engineering diagrams directly inside Cursor, Claude Desktop, Claude Code, or any MCP-compatible AI agent.
Use our hosted MCP server β nothing to install. Add the config below to your MCP client (see step 3).
{
"mcpServers": {
"ai-diagram-maker": {
"url": "https://mcp.aidiagrammaker.com/mcp",
"headers": {
"X-ADM-API-Key": "<your api key>"
}
}
}
}Replace <your api key> with your API key from step 1.
Run the MCP server locally. Nothing to install permanently β npx runs it on demand.
The command below is a standalone example to test the server works with any MCP-compatible client:
ADM_API_KEY=your_api_key npx ai-diagram-maker-mcp@latestUse the hosted MCP server on Railway with your API key sent in the X-ADM-API-Key header. Add to ~/.cursor/mcp.json or Settings β MCP:
{
"mcpServers": {
"ai-diagram-maker": {
"url": "https://mcp.aidiagrammaker.com/mcp",
"headers": {
"X-ADM-API-Key": "your_api_key_here"
}
}
}
}Replace your_api_key_here with your AI Diagram Maker API key. No environment variables are required for this setup.
To run the server locally instead, use:
{
"mcpServers": {
"ai-diagram-maker": {
"command": "npx",
"args": ["-y", "ai-diagram-maker-mcp"],
"env": {
"ADM_API_KEY": "your_api_key_here"
}
}
}
}To enable debug logging (request params and API payload), add "ADM_DEBUG": "1" to the env object. View output in Cursor β Output panel, then select the MCP or ai-diagram-maker channel so you see the serverβs stderr logs.
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"ai-diagram-maker": {
"command": "npx",
"args": ["-y", "ai-diagram-maker-mcp"],
"env": {
"ADM_API_KEY": "your_api_key_here"
}
}
}
}claude mcp add ai-diagram-maker \
--command "npx" \
--args "-y,ai-diagram-maker-mcp" \
--env ADM_API_KEY=your_api_key_hereA hosted instance runs at https://mcp.aidiagrammaker.com/mcp. Configure your MCP client with the server URL and pass the API key in request headers (not as an env var):
X-ADM-API-Key: <api_key> (recommended), orAuthorization: Bearer <api_key>See the Cursor remote config above for a ready-to-use example.
To run your own HTTP server locally:
npx ai-diagram-maker-mcp --transport httpThe server listens on $PORT (or 3001). Send the API key in every request to /mcp via the headers above.
| Variable | Required | Default | Description |
|---|---|---|---|
ADM_API_KEY | Yes (stdio only) | β | Your AI Diagram Maker API key (used only for stdio transport) |
ADM_BASE_URL | No | https://app.aidiagrammaker.com | Override for local/staging API; also used as the base for diagram URLs in tool responses |
ADM_DEBUG | No | β | Set to 1, true, or yes to log request parameters from the AI agent and the request payload sent to the AI Diagram Maker API. Logs go to stderr. |
generate_diagram_from_textGenerate a diagram from a natural language description.
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Natural language description of the diagram |
diagramType | enum | No | flowchart, sequence, erd, system_architecture, network_architecture, uml, mindmap, workflow |
prompt | string | No | Additional styling/layout instruction |
Example prompts:
generate_diagram_from_jsonConvert a JSON structure into a diagram (great for API responses, database schemas, config files).
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | JSON string to visualise |
prompt | string | No | How to interpret the JSON |
diagramType | enum | No | Preferred diagram type |
generate_diagram_from_asciiConvert ASCII art into a polished diagram.
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Raw ASCII art diagram |
prompt | string | No | Rendering instructions |
diagramType | enum | No | Preferred diagram type |
generate_diagram_from_imageConvert a whiteboard photo, screenshot, or any image into a clean diagram.
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Public image URL or base64 data URI |
prompt | string | No | What to extract or how to render |
diagramType | enum | No | Preferred output diagram type |
generate_diagram_from_mermaidConvert a Mermaid diagram definition to D2 and return a PNG image.
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Mermaid diagram source (e.g. flowchart, sequenceDiagram, erDiagram) |
prompt | string | No | Optional layout or styling instruction |
diagramType | enum | No | Preferred diagram type for the converted output |
The AI agent will automatically select the right tool when you use phrases like:
adm ...ai diagram maker ...create a diagram of ...show me a flowchart / sequence diagram / ERD / architecture ...visualise / draw / diagram ...Use these steps to clone the repo, build locally, and run the MCP server with Node.
git clone https://github.com/erajasekar/ai-diagram-maker-mcp.git
cd ai-diagram-maker-mcpnpm installIf you change the AI Diagram Maker OpenAPI spec or config, regenerate the client:
npm run generatenpm run buildThis compiles TypeScript and builds the MCP app UI into dist/. The server entrypoint is dist/index.js.
stdio (default) β for use with Cursor, Claude Desktop, etc.:
ADM_API_KEY=your_api_key node dist/index.jsOr use the npm script:
ADM_API_KEY=your_api_key npm startHTTP transport β for remote clients or testing:
ADM_API_KEY=your_api_key node dist/index.js --transport httpOr:
ADM_API_KEY=your_api_key npm run start:httpThe HTTP server listens on $PORT (default 3001). Send the API key in request headers: X-ADM-API-Key or Authorization: Bearer <key>.
Point Cursor at your built server via Settings β MCP (or ~/.cursor/mcp.json):
{
"mcpServers": {
"ai-diagram-maker": {
"command": "node",
"args": ["/absolute/path/to/ai-diagram-maker-mcp/dist/index.js"],
"env": {
"ADM_API_KEY": "your_api_key_here"
}
}
}
}Replace /absolute/path/to/ai-diagram-maker-mcp with the actual path to your cloned repo. After changing the config, restart Cursor or reload the MCP servers.
Add "ADM_DEBUG": "1" to env to see request logs in Cursor β Output (MCP channel).
MIT