Getting Started
Azure Diagram MCP Server is a Model Context Protocol (MCP) server that generates professional diagrams using the Python diagrams package DSL — with first-class support for Azure architecture diagrams.
Generate Azure architecture diagrams, sequence diagrams, flow charts, class diagrams, Kubernetes diagrams, and more — all from natural language via your AI assistant.
Step 1 — Install Prerequisites
- Python 3.12+ — Install via python.org or
uv python install 3.12 - uv (recommended) — Install from Astral
- Graphviz (required) — Install from graphviz.org or via your package manager:
brew install graphvizsudo apt-get install graphvizchoco install graphvizGraphviz is required
Without Graphviz installed, the MCP server will fail to start. Verify it's installed by running dot -V.
Step 2 — Verify Installation
Run the server to confirm your environment is set up correctly:
uvx microsoft.azure-diagram-mcp-serverYou should see a message confirming the server is installed and ready. The server is an MCP stdio server — it's designed to be launched by an MCP client, not run directly. If it fails to install, check that Graphviz is installed (dot -V).
Step 3 — Connect to Your AI Host
Pick one of the methods below to register the server with your AI host.
VS Code
Add to your VS Code settings.json:
{
"mcp": {
"servers": {
"azure-diagram": {
"command": "uvx",
"args": ["microsoft.azure-diagram-mcp-server"]
}
}
}
}Copilot CLI
Start a Copilot CLI session:
shcopilotInside the session, run the slash command:
/mcp addFill in the form (use Tab to move between fields):
Field Value Name azure-diagramType LocalCommand uvx microsoft.azure-diagram-mcp-serverPress Ctrl+S to save.
Verify with
/mcp show azure-diagram— status should show ✓ Connected.
Manual config
The config is saved to ~/.copilot/mcp-config.json. You can also edit that file directly:
{
"servers": {
"azure-diagram": {
"type": "local",
"command": "uvx microsoft.azure-diagram-mcp-server",
"tools": ["*"]
}
}
}Your First Diagram
Once configured, ask your AI assistant to generate a diagram. For example:
"Create an Azure architecture diagram with an Application Gateway routing traffic to an App Service and Azure Functions, both connecting to a Cosmos DB database."
The server will generate and execute the Python code to produce a professional diagram image.
Available MCP Tools
| Tool | Description |
|---|---|
generate_diagram | Generate a diagram from Python code using the diagrams DSL |
get_diagram_examples | Get example code for different diagram types |
list_icons | Discover available icons by provider and service |
Next Steps
- Installation — Explore all installation methods including Docker
- Examples — See example diagrams and code