云架构分析工具

一款用于项目云架构分析、建议和生成相关文档的工具,可作为AI编码工具的MCP服务器或独立CLI使用。

  • by bmdietrich
  • TypeScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 bmdietrich/agent-cloud-architect

使用说明

云架构师

任何项目的云架构分析、建议和工件。作为一个 MCP服务器 用于AI驱动的编码工具(Claude Code、Cursor、Windsurf)或作为 独立CLI.

扫描您的项目,检测您的堆栈,并为AWS、GCP或Azure提供架构建议、图表、决策记录和部署比较。

安装

npm install -g github:bmdietrich/agent-cloud-architect

用法

命令行界面

# Analyze a project and get architecture recommendations
cloud-architect analyze --provider aws --dir /path/to/project

# Generate a Mermaid architecture diagram
cloud-architect diagram --provider gcp --style mermaid

# Review against well-architected framework
cloud-architect review --provider azure --checklist security reliability cost

# Compare deployment options
cloud-architect compare --provider aws --options ecs-fargate eks lambda

# Generate an Architecture Decision Record
cloud-architect adr "Use Fargate for backend services" --context "Migrating from EC2"

# Ask a question using the agentic loop (requires ANTHROPIC_API_KEY)
cloud-architect ask "What's the best way to handle background jobs?" --provider aws

所有命令都接受:

  • -p, --provider <aws|gcp|azure> --云提供商(默认值: aws)
  • -d, --dir <path> --要分析的项目目录(默认:cwd)

MCP服务器

添加到您的项目 .mcp.json:

{
  "mcpServers": {
    "cloud-architect": {
      "command": "npx",
      "args": ["-y", "github:bmdietrich/agent-cloud-architect"],
      "env": {
        "PROJECT_DIR": ".",
        "CLOUD_PROVIDER": "aws"
      }
    }
  }
}

或者通过Claude Code CLI注册:

claude mcp add cloud-architect \
  -e PROJECT_DIR=. \
  -e CLOUD_PROVIDER=aws \
  -- npx -y github:bmdietrich/agent-cloud-architect

工具

工具 说明
analyze_project 扫描项目结构,检测堆栈,推荐云架构
generate_adr 生成包含上下文、选项和权衡的架构决策记录
architecture_diagram 绘制目标架构的美人鱼图或D2图
review_architecture 根据架构良好的框架支柱(安全性、可靠性、成本等)进行审查
compare_deployments 通过权衡分析比较部署选项(例如,ECS、EKS和Lambda)

运作原理

项目扫描仪

上下文扫描程序检测到:

  • 语言 --JavaScript、TypeScript、Python、Go、Rust、Java、Kotlin
  • 框架 --React、Next.js、Express、NestJS、FastAPI、Django、Spring等
  • 数据库 --MongoDB、PostgreSQL、MySQL、Redis、DynamoDB、RabbitMQ、Kafka
  • 基础设施 --Terraform、无服务器框架、CDK、CloudFormation
  • 容器 --Dockerfiles、Docker Compose、Kubernetes清单
  • CI/CD --GitHub Actions、GitLab CI、Jenkins、CircleCI、CodeBuild
  • 服务 --使用类型推断检测monorepos中的单个服务(前端、后端、worker、lambda)

提供者参数化

这 cloudProvider 设置将塑造所有输出——服务名称、架构模式和推荐映射到目标提供者:

概念 AWS GCP Azure
无服务器容器 Fargate 云运行 容器应用
FaaS Lambda 云函数 Azure函数
容器编排 ECS/EKS GKE AKS
文档数据库 文档数据库 Firestore Cosmos数据库
缓存 ElastiCache 内存存储 适用于Redis的Azure缓存
队列 SQS 发布/订阅 服务总线

MCP模式与CLI模式

MCP模式 --主机AI(Claude、Cursor等)是推理层。工具返回结构化分析,人工智能解释并应用它。不需要API密钥。

CLI模式 --工具直接运行并返回markdown输出。这 ask 命令和 --agent flag使用Claude的代理循环来提供交互式分析(需要 ANTHROPIC_API_KEY).

环境变量

变量 必填 描述
PROJECT_DIR MCP模式 要分析的项目目录
CLOUD_PROVIDER 没有 aws, gcp,或 azure (默认值: aws)
ANTHROPIC_API_KEY CLI代理模式 必需 ask 命令和 --agent 旗帜

发展

git clone github:bmdietrich/agent-cloud-architect
cd cloud-architect
npm install
npm run dev          # watch mode
npm run build        # one-time build

许可证

麻省理工学院