Create infrastructure and architecture diagrams via MCP
Project description
MCP Diagrams ๐จ
Create beautiful infrastructure and architecture diagrams through Model Context Protocol (MCP) with Claude. Build cloud architectures, network diagrams, and system designs using simple commands.
๐ Features
- 20+ Cloud Providers: AWS, Azure, GCP, Kubernetes, Alibaba Cloud, and more
- 2000+ Services: Comprehensive icon library for all major cloud services
- Session Management: Maintain diagram state across multiple operations
- Smart Layouts: Automatic arrangement with customizable directions
- Production Ready: Rate limiting, validation, metrics, and health monitoring
- Format Support: PNG, SVG, PDF, and DOT output formats
Quick Start
Installation
Using uv (Recommended)
uv pip install mcp-diagrams
Using pip
pip install mcp-diagrams
From source
git clone https://github.com/vrknetha/mcp-diagrams.git
cd mcp-diagrams
uv pip install -e .
Running the Server
# Using uv
uv run mcp-diagrams
# Using Python directly
python -m mcp_diagrams
# With custom output directory
MCP_DIAGRAMS_OUTPUT_DIR=~/my-diagrams uv run mcp-diagrams
Configuration
Claude Desktop
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Option 1: Using uvx (Recommended)
{
"mcpServers": {
"mcp-diagrams": {
"command": "uvx",
"args": ["mcp-diagrams"],
"env": {
"MCP_DIAGRAMS_OUTPUT_DIR": "/Users/your-username/Documents/diagrams"
}
}
}
}
Option 2: Using Python directly
{
"mcpServers": {
"mcp-diagrams": {
"command": "python",
"args": ["-m", "mcp_diagrams"],
"env": {
"MCP_DIAGRAMS_OUTPUT_DIR": "/Users/your-username/Documents/diagrams"
}
}
}
}
Cursor
Add to your Cursor settings:
{
"mcp.servers": {
"mcp-diagrams": {
"command": "python",
"args": ["-m", "mcp_diagrams"],
"env": {
"MCP_DIAGRAMS_OUTPUT_DIR": "./diagrams"
}
}
}
}
๐ Usage Examples in Claude Desktop
Once configured, use natural language to create diagrams:
Basic Web Architecture
You: "Create an AWS web architecture diagram with a load balancer, two web servers, and a PostgreSQL database"
Claude: Creates the diagram with proper AWS icons and connections
Kubernetes Cluster
You: "Create a Kubernetes cluster diagram showing an ingress controller, service, deployment, and pods with proper connections"
Claude: Generates a K8s architecture with all components properly connected
Complex Microservices (Using Bulk Operations v1.1.0)
You: "Create a microservices architecture with:
- Frontend cluster with 2 web apps
- Backend cluster with 2 API servers
- Data layer with PostgreSQL and Redis
- Connect web apps to APIs, and APIs to both database and cache"
Claude: Uses bulk operations to create the entire architecture 8-10x faster than before
Real-World Examples
E-commerce Platform: "Create an e-commerce architecture with CloudFlare CDN, AWS ALB, 3 EC2 web servers, ECS containers for microservices, RDS for main database, ElastiCache for sessions, and S3 for static assets"
Data Pipeline: "Design a data pipeline with Kinesis for streaming, Lambda for processing, EMR for analytics, Redshift for data warehouse, and QuickSight for visualization"
Multi-Cloud Setup: "Show a multi-cloud architecture with AWS EC2 instances, Azure Functions, GCP BigQuery, connected via VPN"
๐ ๏ธ Available Tools
Session Management
create_diagram()- Initialize a new diagram sessionlist_sessions()- List all active sessionsget_session_state()- Get complete session detailsdelete_session()- Clean up a sessionget_session_ttl_info()- Session expiry information
Node Operations
add_node()- Add a single nodeadd_nodes_bulk()- Add multiple nodes at once (up to 100)edit_node()- NEW v1.4.0: Edit node properties (label, cluster, icon)edit_nodes_bulk()- NEW v1.4.0: Edit multiple nodes at onceremove_node()- Remove a nodelist_nodes()- List all nodes in session
Connections
connect_nodes()- Create a connection between nodesconnect_nodes_bulk()- Create multiple connections at onceedit_connection()- NEW v1.4.0: Edit connection properties (label, style, color)edit_connections_bulk()- NEW v1.4.0: Edit multiple connections at once
Clustering
create_cluster()- Create a logical groupingcreate_clusters_bulk()- Create multiple clusters at onceedit_cluster()- NEW v1.4.0: Edit cluster properties (label, parent)edit_clusters_bulk()- NEW v1.4.0: Edit multiple clusters at onceadd_to_cluster()- Add nodes to a clusternest_cluster()- Create hierarchical clusters
Discovery
list_providers()- See all 20 available providerslist_categories()- List categories for a providerlist_services()- List services in a categorysearch_services()- Search across all providerssearch_services_bulk()- NEW: Search multiple terms at onceget_services_by_categories()- NEW: Get services for multiple categories
Rendering
render_diagram()- Generate the final diagram
Monitoring
get_health_status()- Server health checkget_metrics()- Performance metrics
Validation
validate_architecture()- v1.2.0: Check diagram for best practices and issues- Validates proper cluster boundaries
- Detects architectural anti-patterns
- Identifies single points of failure
- Ensures proper service placement
validate_icon()- NEW v1.3.0: Check if an icon exists and get fallback suggestions- Validates provider/service combinations
- Provides intelligent fallback suggestions
- Returns confidence levels for alternatives
๐ Supported Providers
| Provider | Services | Description |
|---|---|---|
| aws | 550+ | Amazon Web Services |
| azure | 232+ | Microsoft Azure |
| gcp | 109+ | Google Cloud Platform |
| alibabacloud | 131+ | Alibaba Cloud |
| k8s | 69+ | Kubernetes |
| onprem | 206+ | On-premises/Traditional |
| oci | 152+ | Oracle Cloud |
| ibm | 180+ | IBM Cloud |
| programming | 81+ | Languages & Frameworks |
| saas | 37+ | Software as a Service |
And 10 more providers! Use list_providers() to see all.
๐๏ธ Architecture
mcp-diagrams/
โโโ src/
โ โโโ mcp_diagrams/
โ โ โโโ __init__.py
โ โ โโโ server.py # Main MCP server
โ โ โโโ diagram_builder.py # Diagram generation
โ โ โโโ session_manager.py # Session state
โ โ โโโ provider_registry.py # Service discovery
โ โ โโโ models.py # Data models
โ โ โโโ utils.py # Utilities
โ โโโ ...
โโโ tests/ # Test suite
โโโ examples/ # Example diagrams
โโโ docs/ # Documentation
๐งช Development
Setup Development Environment
# Clone repository
git clone https://github.com/vrknetha/mcp-diagrams.git
cd mcp-diagrams
# Create virtual environment with uv
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install in development mode
uv pip install -e ".[dev]"
Run Tests
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=mcp_diagrams
# Run specific test file
uv run pytest tests/test_session_manager.py
Code Quality
# Format code
uv run black src/ tests/
# Lint
uv run ruff src/ tests/
# Type checking
uv run mypy src/
๐ฆ Publishing to PyPI
First Time Setup
- Create account on PyPI
- Create API token: Account Settings โ API tokens
- Save token securely
Build and Upload
# Install build tools
uv pip install build twine
# Build distribution
python -m build
# Upload to TestPyPI first (recommended)
python -m twine upload --repository testpypi dist/*
# Upload to PyPI
python -m twine upload dist/*
Using GitHub Actions (Automated)
See .github/workflows/publish.yml for automated releases on tags.
๐ค Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Diagrams - The amazing Python library powering our diagrams
- MCP - Model Context Protocol specification
- FastMCP - Fast MCP implementation for Python
๐ Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: vrknetha@gmail.com
๐บ๏ธ Roadmap
- Web UI for diagram preview
- Export to Terraform/CloudFormation
- Real-time collaboration
- Custom icon support
- Diagram templates library
- Cost estimation integration
Made with โค๏ธ by the MCP Diagrams Team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_diagrams-1.5.1.tar.gz.
File metadata
- Download URL: mcp_diagrams-1.5.1.tar.gz
- Upload date:
- Size: 62.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0881711534f5f0e91f4a192d9e7ce5c4b9645b4f37b0fdc7f25119fee62a056
|
|
| MD5 |
506cecd28418ca4c6e52c5aab2f3fd9b
|
|
| BLAKE2b-256 |
67f32cbfc9d126db12442843094646f238870d7af78649f4ba4f1134bb354433
|
File details
Details for the file mcp_diagrams-1.5.1-py3-none-any.whl.
File metadata
- Download URL: mcp_diagrams-1.5.1-py3-none-any.whl
- Upload date:
- Size: 63.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62ed183c9b68fa0a1241be7496ff88d9b49033bf6bc70b55b9997267816870bc
|
|
| MD5 |
3c405ea547cf5a67ff9083c119b52358
|
|
| BLAKE2b-256 |
2a2ec9bcb28dec5a7c04d32736eb2cb4b13698c0be43b621c2b612a8cd43fb55
|