home / mcp / diagrams mcp server

Diagrams MCP Server

MCP server for generating infrastructure and architecture diagrams as code using the Python diagrams library.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "apetta-diagrams-mcp": {
      "command": "uvx",
      "args": [
        "diagrams-mcp"
      ]
    }
  }
}

You can generate infrastructure and architecture diagrams as code with the Diagrams MCP Server. It lets you compose diagrams using a Python-based diagrams library through MCP-aware commands, supporting multiple output formats and advanced styling while validating your diagram specifications before generation.

How to use

Interact with the Diagrams MCP Server through an MCP client to generate infrastructure, architecture, and flowchart diagrams. You can drive it with either a local development setup or a cloud/hosted MCP endpoint. Use the available tools to create diagrams, add custom icons, validate your spec, and preview the results before exporting to formats like PNG, PDF, or DOT.

How to install

Prerequisites: ensure you have the required runtime and tooling for MCP servers. You will typically need the MCP client tooling and a way to run the MCP server in either STDIO (local) or HTTP (remote) mode.

If you plan to run a published local setup via MCP tooling, configure and run the server as shown in the example below. This assumes you are using the MCP client to connect to a stdio server named diagrams.

{ 
  "mcpServers": {
    "diagrams": {
      "command": "uvx",
      "args": ["diagrams-mcp"]
    }
  }
}

Additional configuration and usage notes

If you are installing for local development, you can also point the MCP client at a local runnable instance with a directory path to the diagrams-mcp project and the appropriate run command, as shown here.

{
  "mcpServers": {
    "diagrams:local": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/diagrams-mcp",
        "run",
        "diagrams-mcp"
      ]
    }
  }
}

Usage prompts and tool names

Once connected, you can use prompts like those below to map to the available MCP tools. The primary tools support full diagrams, custom icons, and flowcharts.

- Create an AWS 3-tier web application diagram with Route53, ELB, EC2 instances, and RDS - Generate a Kubernetes microservices architecture with ingress, services, and pods - Build a flowchart for a CI/CD pipeline with decision points - Create a diagram using a custom icon from my company logo URL - Show me all available AWS compute nodes

Discovery & validation tools

Use discovery to search for nodes and validation to perform a dry-run before generating diagrams.

- list_available_nodes - validate_diagram_spec

Available tools

create_diagram

Generates full infrastructure/architecture diagrams with all providers using the Diagrams MCP Server.

create_diagram_with_custom_icons

Creates diagrams that include custom icons from URLs or local files.

create_flowchart

Generates flowcharts with 24 process shapes for decision trees and workflows.

list_available_nodes

Search 500+ nodes by provider, category, or keyword to find diagram elements.

validate_diagram_spec

Performs a dry-run validation of your diagram specification before generation.