Skip to main content
Glama

cloudcraft-mcp

CI License: MIT Python 3.10+

Cloudcraft.co 的模型上下文协议 (MCP) 服务器 — 可从 Claude Desktop 和其他 MCP 客户端列出、读取、导出和构建云架构蓝图。

功能

向 MCP 主机公开了九个工具:

工具

描述

whoami

返回已配置密钥的 Cloudcraft 用户资料。

list_blueprints

列出账户中的所有蓝图。

get_blueprint

获取蓝图的完整节点/边 JSON。

create_blueprint

从 JSON 有效负载创建新蓝图。

update_blueprint

替换现有蓝图的有效负载。

delete_blueprint

删除蓝图(不可逆)。

export_blueprint_image

将蓝图渲染为磁盘上的 PNG / SVG / PDF / mxgraph。

list_aws_accounts

列出用于实时扫描快照的已连接 AWS 账户。

snapshot_aws

对一个 AWS 服务进行实时扫描快照。

Related MCP server: AWS MCP Server

要求

安装

克隆仓库并让 uv 在首次运行时解析依赖项 — 无需显式安装步骤。

git clone https://github.com/hypark5540/cloudcraft-mcp.git
cd cloudcraft-mcp
export CLOUDCRAFT_API_KEY='your-key-here'
uv run cloudcraft-mcp   # smoke test — Ctrl+C to exit

Claude Desktop 集成

编辑 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) 或您平台上的等效文件:

{
  "mcpServers": {
    "cloudcraft": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/cloudcraft-mcp",
        "run",
        "cloudcraft-mcp"
      ],
      "env": {
        "CLOUDCRAFT_API_KEY": "your-key-here"
      }
    }
  }
}

重启 Claude Desktop。开发者选项卡应显示 cloudcraft 已连接。

环境变量

名称

必需

默认

用途

CLOUDCRAFT_API_KEY

是

—

API 密钥 (Bearer)。在 Cloudcraft 用户设置中生成。

CLOUDCRAFT_BASE_URL

否

https://api.cloudcraft.co

用于代理或未来 API 版本的覆盖。

CLOUDCRAFT_LOG_LEVEL

否

WARNING

Stderr 日志详细程度 (DEBUG / INFO / WARNING / ERROR)。

使用示例 (在 Claude 中)

服务器连接后,您可以询问 Claude 诸如:

“列出我的 Cloudcraft 蓝图并总结每个蓝图代表的内容。”

“将蓝图 f0086b32-... 导出为 PNG 并保存到我的桌面。”

“使用我刚刚设计的架构创建一个名为 'Prod 2026' 的新 Cloudcraft 蓝图。”

“为我已连接的 AWS 账户对 ap-northeast-2 中的 EC2 实例进行快照。”

蓝图有效负载格式

create_blueprint / update_blueprint 接受完整的 Cloudcraft data 对象。一个最小的有效负载:

{
  "grid": "infinite",
  "projection": "isometric",
  "theme": {"base": "light"},
  "version": 6,
  "nodes": [
    {"id": "...", "type": "ec2", "mapPos": [3, 3], "region": "ap-northeast-2",
     "instanceType": "m7g", "instanceSize": "large", "platform": "linux"},
    {"id": "...", "type": "s3",  "mapPos": [1, 8], "region": "ap-northeast-2",
     "volumeType": "Standard", "dataGb": 100}
  ],
  "edges": [
    {"from": "...ec2-id...", "to": "...s3-id...", "type": "edge",
     "width": 2, "dashed": false, "endCap": "arrow"}
  ],
  "groups": [], "surfaces": [], "text": [], "icons": [],
  "connectors": [], "images": [], "disabledLayers": [],
  "shareDocs": false
}

有关完整的节点类型目录和服务特定字段,请参阅 Cloudcraft 的 API 文档。

开发

uv sync --extra dev
uv run pytest            # unit tests (no network)
uv run ruff check .      # lint
uv run mypy src          # type check

测试使用 respx 模拟 HTTP 层,因此不需要 API 密钥。

项目布局

cloudcraft-mcp/
├── src/cloudcraft_mcp/
│   ├── __init__.py
│   ├── __main__.py         # python -m cloudcraft_mcp
│   ├── server.py           # MCP tool definitions (FastMCP)
│   ├── client.py           # CloudcraftClient — async httpx wrapper
│   ├── types.py            # TypedDicts for blueprint payloads
│   └── py.typed
├── tests/
│   └── test_client.py
├── server.py               # back-compat shim -> cloudcraft_mcp.server:main
├── pyproject.toml
├── LICENSE
└── README.md

设计说明

  • 传输/逻辑分离。 client.py 是一个简单的异步 HTTP 客户端,您可以在脚本或 CLI 工具中导入它,而无需引入 MCP 运行时。server.py 仅负责 MCP 工具接口。

  • Bearer 令牌认证。 Cloudcraft 的 API 需要 Authorization: Bearer <key> (而不是 Apikey)。客户端会自动设置此项。

  • 进程参数中无密钥。 API 密钥从 CLOUDCRAFT_API_KEY 读取;切勿在命令行上传递它。

  • 错误处理。 非 2xx 响应会引发保留状态和主体的 CloudcraftError,并在 MCP 边界处重新包装为 RuntimeError,以便 Claude 能看到可读的消息。

安全性

  • API 密钥授予对您 Cloudcraft 账户的完全读/写权限。请将其视为机密并定期轮换。

  • delete_blueprint 是不可逆的 — 当要求 Claude 删除时,请明确指定目标 ID。

  • 对于读取密集型设置,请创建一个具有只读范围的专用 Cloudcraft 用户(如果/当 Cloudcraft 添加范围密钥时),并将该密钥用于 MCP。

贡献

欢迎在 https://github.com/hypark5540/cloudcraft-mcp 提交问题和 PR。提交前请运行 ruff、mypy 和 pytest。

许可证

MIT — 参见 LICENSE。

相关

Available Tools

13 tools
create_blueprintB

Create a new Cloudcraft blueprint.

Args: name: Display name for the new blueprint. data: Full blueprint payload (nodes, edges, groups, surfaces, text, icons, connectors, theme, projection, etc.). See README for a minimal example.

Returns the created blueprint metadata including the assigned id.

Inputs: data (required), name (required). Returns: object

delete_blueprintA
Destructive

Delete a Cloudcraft blueprint after exact-id confirmation.

Args: blueprint_id: Blueprint UUID. confirm_blueprint_id: Repeat the exact UUID to acknowledge the irreversible operation.

Inputs: blueprint_id (required), confirm_blueprint_id (required). Returns: object

export_blueprint_budgetA
Destructive

Export a blueprint's cost estimate (budget) to a CSV or XLSX file on disk.

Same write sandbox as :func:export_blueprint_image.

Args: blueprint_id: Blueprint UUID. format: csv or xlsx. Default csv. output_path: Absolute path under the export directory. Default: <export_dir>/cloudcraft_<uuid>_budget.<ext>. currency: ISO 4217 code — USD (default), AUD, CHF, EUR, GBP, HKD, JPY, NOK, NZD, SEK, ZAR. period: h hourly, d daily, w weekly, m monthly (default), y yearly. rate: effective (default, includes upfront fees) or stated. overwrite: Set True to replace an existing file.

Returns: {"path": <saved_path>, "bytes": <size>, "format": <fmt>}

Inputs: blueprint_id (required), rate, format, period, +3 more. Returns: object

export_blueprint_imageA
Destructive

Render a Cloudcraft blueprint to an image file on disk.

Writes are restricted to CLOUDCRAFT_EXPORT_DIR (default: system temp directory). Set CLOUDCRAFT_EXPORT_DIR=/path/to/dir in the MCP server environment to allow saving under a different directory.

Args: blueprint_id: Blueprint UUID. format: One of png, svg, pdf, mxgraph. Default png. output_path: Absolute path to save to, must resolve under the export directory. Default: <export_dir>/cloudcraft_<uuid>.<ext>. scale: Optional PNG render scale (e.g. 1.0, 2.0). PNG only. transparent: PNG transparent background (bool). PNG only. overwrite: Set True to replace an existing file at output_path. Default False — existing files are preserved.

Returns: {"path": <saved_path>, "bytes": <size>, "format": <fmt>}

Inputs: blueprint_id (required), scale, format, overwrite, +2 more. Returns: object

get_blueprintA
Read-only

Fetch the full blueprint payload (nodes, edges, groups, layout).

Args: blueprint_id: Blueprint UUID from :func:list_blueprints.

Inputs: blueprint_id (required). Returns: object

list_aws_accountsA
Read-only

List AWS accounts registered with Cloudcraft for live-scan snapshots.

Inputs: no named parameters. Returns: object

list_azure_accountsA
Read-only

List Azure accounts registered with Cloudcraft for live-scan snapshots.

Inputs: no named parameters. Returns: object

list_blueprintsA
Read-only

List every Cloudcraft blueprint (diagram) in the authenticated account.

Returns a compact summary per blueprint (id, name, tags, updatedAt). Use :func:get_blueprint afterwards to pull the full node / edge JSON.

Inputs: no named parameters. Returns: object

list_teamsB
Read-only

List the teams linked to the Cloudcraft account (id, name, members).

Inputs: no named parameters. Returns: object

snapshot_awsB
Idempotent

Scan one AWS region into a blueprint JSON via Cloudcraft live-scan.

Inputs: region (required), account_id (required), filter, exclude. Returns: object

snapshot_azureC
Idempotent

Scan one Azure region into a blueprint JSON via Cloudcraft live-scan.

Inputs: region (required), account_id (required), filter, exclude. Returns: object

update_blueprintA
DestructiveIdempotent

Replace the full data payload of an existing blueprint.

Args: blueprint_id: Blueprint UUID. data: Full blueprint payload (same shape as :func:create_blueprint).

Inputs: data (required), blueprint_id (required). Returns: object

whoamiA
Read-only

Return the Cloudcraft user profile for the current API key.

Useful as a sanity check after configuring a new key.

Inputs: no named parameters. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 13 tools

    Disambiguation5/5

    Each tool maps to a distinct resource/action pair: team/profile read, blueprint CRUD, two clearly separated export formats (image vs budget), and account listing vs region snapshots. The only near-overlap, export_blueprint_image vs export_blueprint_budget, is made unambiguous by explicit format and output descriptions.

    Naming Consistency4/5

    Almost everything follows a clean verb_noun snake_case pattern (list_*, get_*, create_*, update_*, delete_*, export_*, snapshot_*). The lone deviation is `whoami`, which breaks the pattern but is idiomatic and unambiguous.

    Tool Count5/5

    13 tools is well within the ideal 3-15 range and each earns its place: 5 blueprint CRUD tools, 2 exports, 2 account listers, 2 snapshotters, plus team/profile reads. No filler tools.

    Completeness4/5

    Blueprint lifecycle is fully covered (list/get/create/update/delete plus image and budget export), and both AWS and Azure snapshot paths exist. Minor gaps: no account-level get/registration tools, no team management, and update_blueprint replaces the whole payload so rename/metadata edits are awkward — all workaroundable.

    Maintenance

    ActivityMaintained
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables Claude to interact with core AWS services like S3, EC2, RDS, and CloudWatch, along with a generic SDK wrapper for any AWS operation. It also supports cost monitoring and optional vector store capabilities for document ingestion and search.
      10
      3
      -
    • A
      license
      B
      quality
      D
      maintenance
      Enables Claude Desktop to interact with 57 AWS services using over 200 tools and local machine profiles. It supports multi-profile configurations and features a read-only safe mode by default to manage infrastructure like EC2, S3, and Lambda securely.
      100
      BSD 3-Clause
    • A
      license
      A
      quality
      D
      maintenance
      Enables browsing S3 buckets and objects, and generating secure presigned URLs for downloads and uploads, through natural language commands in MCP clients like Claude Desktop.
      3
      4
      MIT