MCP云图
  
MCP服务器,将Terraform计划更改可视化为具有官方AWS、Azure和GCP图标的云架构图。
特性
- 从Terraform计划JSON生成图表(不需要云凭据)
- 带有官方提供商图标的多云支持
- 具有依赖关系的分层架构视图
- 交互式HTML,可点击资源显示配置详细信息
- 颜色编码更改:绿色(创建)、红色(删除)、橙色(更新)、紫色(替换)
截图
安装
先决条件: Python 3.10+、Graphviz、Node.js 18+
# Install Graphviz
# Ubuntu/Debian: sudo apt-get install graphviz
# macOS: brew install graphviz
# Windows: winget install --id Graphviz.Graphviz (add bin to PATH)
# Clone and install
git clone https://github.com/aviveldan/cloud-diagram-mcp.git
cd cloud-diagram-mcp
pip install -r requirements.txt
# Build React UI
cd ui && npm install && npm run build && cd ..用法
MCP服务器
添加到您的MCP客户端配置中(例如,Claude Desktop):
{
"mcpServers": {
"cloud-diagram": {
"command": "python3",
"args": ["-m", "cloud_diagram_mcp.server"],
"cwd": "/path/to/cloud-diagram-mcp"
}
}
}地形平面图
terraform plan -out=tfplan
terraform show -json tfplan > plan.json使用MCP visualize_tf_diff 使用JSON作为输入的工具:
{
"plan": "
"
}命令行
python3 test_mcp.py # Test MCP tools
python3 generate_documentation_diagrams.py # Generate example diagrams支持的资源
AWS: EC2、VPC、RDS、S3、ELB、Lambda、IAM、ElastiCache、Route53、CloudFront、NAT网关等\ Azure: 虚拟机、虚拟网络、SQL数据库、存储帐户、托管标识等\ GCP: 计算引擎、VPC、云SQL、云存储、GKE等
发展
# Build UI
cd ui && npm install && npm run build
# Run Python tests (requires Graphviz)
python3 test_mcp.py
# Run Playwright UI tests
cd ui
npm run build
python create-test-harness.py
python create-test-harness-architecture.py
npm test有关完整的测试文档,请参阅 测试.md.
持续集成
所有测试都会通过GitHub Actions在每个pull请求上自动运行。看 .github/workflows/test.yml 完整的CI配置。
有关完整的CI/CD文档,包括发布过程和工作流,请参阅 CI_CD.md.
CI/CD
此存储库包括全面的CI/CD工作流:
- 测试 (
.github/workflows/test.yml):对所有PR运行Python和Playwright测试,并推送到main - 发布 (
.github/workflows/release.yml):推送新版本标记时自动发布到PyPI - Dependabot (
.github/dependabot.yml):每周自动更新依赖关系
创建发布
- 更新版本
cloud_diagram_mcp/__init__.py - 更新
CHANGELOG.md使用新版本和更改 - 提交更改
- 创建并推送版本标签:
git tag v2.1.0
git push origin v2.1.0- 发布工作流将自动:
- 构建包 - 创建带有发布说明的GitHub版本 - 发布到PyPI
贡献
我们欢迎捐款!请参阅 贡献.md 了解如何为这个项目做出贡献的指导方针。
许可证
麻省理工学院
