Integration
MCP Server
Integrate awsdac into Claude, Cursor, VS Code, and any MCP-compatible AI assistant to generate AWS architecture diagrams directly from chat.
The MCP (Model Context Protocol) server exposes diagram generation tools to AI assistants. Once configured, you can ask your AI to create AWS architecture diagrams in natural language — it writes the DAC YAML, calls the tool, and returns the PNG directly in chat.
Recommended: install via npm
npm installs the correct pre-built binary automatically. No Go toolchain required.
Install — npm (all platforms)
npm install -g awsdac-mcp-server
Install — Go install
go install github.com/fernandofatech/diagram-as-code/cmd/awsdac-mcp-server@latest
Claude Desktop — claude_desktop_config.json
{
"mcpServers": {
"awsdac": {
"command": "awsdac-mcp-server",
"args": []
}
}
}Where is claude_desktop_config.json?
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json — Windows: %APPDATA%\Claude\claude_desktop_config.json
Claude Code (CLI) — .claude/mcp.json
{
"mcpServers": {
"awsdac": {
"command": "awsdac-mcp-server",
"args": []
}
}
}Cursor — .cursor/mcp.json
{
"mcpServers": {
"awsdac": {
"command": "awsdac-mcp-server",
"args": []
}
}
}VS Code — settings.json
{
"mcp": {
"servers": {
"awsdac": {
"type": "stdio",
"command": "awsdac-mcp-server",
"args": []
}
}
}
}Custom log file path (optional)
{
"mcpServers": {
"awsdac": {
"command": "awsdac-mcp-server",
"args": ["--log-file", "/tmp/awsdac-mcp.log"]
}
}
}Available MCP tools
| Tool | Description | Returns |
|---|---|---|
| getDiagramAsCodeFormat | Returns the full DAC YAML format spec, resource types, and examples. Call this first. | Text documentation |
| generateDiagram | Generates a PNG diagram from DAC YAML. Returns a base64-encoded image inline in chat. | base64 PNG image |
| generateDiagramToFile | Generates a PNG diagram and saves it to a file path on disk. Use this in clients that do not render images inline (e.g. Amazon Q). | File path confirmation |
Workflow: call getDiagramAsCodeFormat first
Always call getDiagramAsCodeFormat before generateDiagram. This gives the AI the complete format specification so it generates valid YAML.
Example prompts
# Inline PNG (Claude Desktop, Cursor, Claude Code) Create an AWS architecture diagram with: - one VPC in us-east-1 - two public subnets - an internet-facing ALB - two EC2 instances behind the ALB - an Internet Gateway Return the PNG diagram. # Save to file (Amazon Q, file-based workflows) Generate a diagram of a serverless architecture with API Gateway, Lambda, and DynamoDB. Save it to ~/Desktop/serverless.png
Supported clients
- Claude Desktop — returns PNG inline in chat (generateDiagram)
- Claude Code CLI — returns PNG inline in terminal
- Cursor — returns PNG inline in chat
- VS Code (Copilot with MCP support) — returns PNG inline
- Amazon Q — use generateDiagramToFile to save PNG to disk
- Any MCP-compatible client using stdio transport