archdiagram

archdiagram

MCP server for generating architecture diagrams with official vendor icons from natural language descriptions. Provides tools to validate specs, render diagrams, search icon catalog, and list available services.

Category
Visit Server

README

archdiagram

CI License: MIT Python 3.11+

Turn an architecture description into an editable diagram whose nodes are the official vendor service icons (Azure App Service, AKS, Key Vault, S3, GKE, ...) - not a flowchart of labelled boxes.

A coding agent (Cursor, Claude Code, Codex) translates a natural-language architecture into a small JSON spec; the deterministic Python core renders that spec to:

Format Best for Vendor icons Editable after import
.pdf Lucidchart visual fidelity, handoff, printing baked in, always render no (Lucid embeds as image)
.drawio editing in draw.io / diagrams.net native stencils or embedded yes
.vsdx Visio / Lucid editable import embedded PNG glyphs yes

Lucid note: Lucid does not map draw.io's named vendor stencils or its img/lib/... icon references, so those render blank on import. .drawio/.vsdx therefore embed icons (--drawio-mode portable) to maximise render success, and the PDF is the reliable icons-always-render deliverable for Lucid.

Gallery

Rendered from the specs in examples/ - same engine, real vendor icons.

Azure AWS GCP
Azure AI Foundry AWS GCP

Design constraints

  • Core engine = pure Python stdlib. No graphviz, no browser, no third-party Python deps. Spec validation is hand-rolled (no jsonschema). .vsdx is written with zipfile + xml.
  • Python 3.11+. Tests use stdlib unittest.
  • Optional, isolated, non-stdlib deps:
    • mcp SDK - only inside mcp_server/.
    • Node + @resvg/resvg-js - rasterise icons to PNG; used by .vsdx (embedded glyphs) and .pdf. If absent, .vsdx falls back to labelled boxes and .pdf errors with an install hint.
    • Node + pdfkit + svg-to-pdfkit - SVG -> PDF for .pdf.
  • Vendor icons are not committed. Fetch them with tools/download_icons.py.

Quick start

# 1. (optional) fetch vendor icons into the local cache
python -m tools.download_icons --vendors azure,aws,gcp,kubernetes

# 2. (optional) install the Node rasterise/pdf bridge
cd node && npm install && cd ..

# 3. render a spec
python -m archdiagram.cli render examples/sample_spec.json --format pdf    -o out/arch.pdf
python -m archdiagram.cli render examples/sample_spec.json --format drawio -o out/arch.drawio --drawio-mode portable
python -m archdiagram.cli render examples/sample_spec.json --format vsdx   -o out/arch.vsdx

Spec format

{
  "title": "Web platform",
  "direction": "LR",
  "groups": [{ "id": "app", "label": "Application tier", "vendor": "azure" }],
  "nodes": [
    { "id": "web", "service": "azure.app_service", "label": "Web App", "group": "app" },
    { "id": "aks", "service": "azure.aks",         "label": "AKS",     "group": "app" },
    { "id": "kv",  "service": "azure.key_vault",   "label": "Key Vault" }
  ],
  "edges": [
    { "source": "web", "target": "aks", "label": "http" },
    { "source": "aks", "target": "kv" }
  ]
}

service is "<vendor>.<service_key>". Unknown services degrade gracefully to a labelled box.

Layout

Node positions are computed by a deterministic, hand-rolled layered layout (no graphviz). Provide explicit x/y on a node to override the computed position.

Use from an AI agent

This repo is built to be driven by agentic AI tools (Cursor, Claude Code/Desktop, Codex, ...) straight from Git. Pick either path:

1. As a skill

Clone the repo and point your agent at skill/SKILL.md. It teaches the agent the spec schema, catalog lookup, and render commands so it can go from a natural-language architecture to rendered files. See also AGENTS.md.

git clone https://github.com/bharathgnana/archdiagram.git
cd archdiagram && python -m tools.download_icons

2. As an MCP server

pip install "archdiagram[mcp]"
python -m mcp_server.server          # stdio transport

Exposes validate_spec, render_diagram, search_catalog, and list_catalog tools. A sample client config is in examples/mcp.json (drop it into .cursor/mcp.json or claude_desktop_config.json).

Repository layout

archdiagram/        pure-Python core (spec, layout, catalog, emitters)
mcp_server/         optional MCP server (only place the `mcp` SDK is used)
node/               optional Node bridge (resvg rasterise + svg->pdf)
tools/              icon downloader + icon source map
skill/              SKILL.md for agentic AI tools
examples/           sample specs + mcp.json
tests/              stdlib unittest suite

Tests

python -m unittest discover -s tests

Contributing

Anyone can clone, install (pip install -e .), and use it. To propose changes, fork and open a pull request - see CONTRIBUTING.md for the dev setup and workflow.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured