cloudwright-mcp
Cloudwright
Describe a cloud architecture in English. Get Terraform, costs, and a compliance check.
pip install 'cloudwright-ai[cli]'
export ANTHROPIC_API_KEY=sk-ant-...
cloudwright design "HIPAA healthcare API on AWS with Postgres and Redis"Cloudwright takes a one-line description of a cloud system and produces a structured architecture spec, a per-component cost breakdown, a compliance report, and ready-to-apply Terraform, Pulumi (TypeScript or Python), or CloudFormation. It works across AWS, GCP, Azure, and Databricks. Version 1.4 adds live AWS import (cloudwright import-live), the Pulumi exporter, two-stage prompting with first-class network boundaries, and a drop-in GitHub Action that posts arch-diff plus cost-delta on every infra PR.
Try it - What's new in v1.4 - Docs - MCP server
What you get
Architecture spec (typed YAML, version-controlled, the single source of truth)
Cost breakdown across AWS, GCP, Azure, Databricks (multi-region, per-component, four pricing tiers)
Compliance report covering HIPAA, SOC 2, PCI-DSS, FedRAMP Moderate, GDPR, and Well-Architected
Terraform and CloudFormation export with safe defaults (encryption, IMDSv2, locked-down S3, sensible RDS settings)
Diagrams in ASCII, Mermaid, D2, and a fully editable web canvas
MCP server for AI agents (Claude Desktop, Cursor, Cline, and any MCP-compatible client)
Related MCP server: Strata MCP Server
Quickstart
cloudwright design "HIPAA healthcare API on AWS with Postgres and Redis"
cloudwright cost spec.yaml --workload-profile medium
cloudwright validate spec.yaml --compliance hipaa,soc2
cloudwright export spec.yaml --format terraform -o ./infra
cloudwright chat --web # browser canvas at http://localhost:8765All commands except design, modify, chat, and adr work fully offline. Set ANTHROPIC_API_KEY (preferred) or OPENAI_API_KEY to enable the LLM-powered ones. Drop --json on any command for machine-readable output.
Smart Canvas + Module Catalog (v1.2)
The web diagram is a fully editable architecture canvas. Edits (add, drag, connect, edit fields, delete) are deterministic frontend mutations, so they are instant, free, and reproducible. They do not call the LLM.
A left-side Catalog drawer has three tabs:
Resources - the full catalog for the active provider, served by
/api/catalog/services(case-insensitive?provider=).Modules - approved multi-resource patterns from
/api/modules. Bundled: AWS Three-Tier Web, AWS Serverless API, AWS Data Lake, GCP Serverless API, Azure Three-Tier Web.Standards - runs
POST /api/canvas/validateand surfaces orphan connections, partial modules, unapproved modules, naming-prefix violations, and missing required tags.
When a module instance is intact, the Terraform exporter emits a single module "<id>" block with the catalog's pinned source and version. Modified modules fall back to per-component resource rendering. Mixed specs work: catalog modules render as modules, ad-hoc resources as resources, side by side.
cloudwright chat --web
# Open http://localhost:8765, use the Catalog drawer, then Export -> TerraformMCP server (Claude / Cursor / Cline)
Expose Cloudwright as Model Context Protocol tools so AI agents can design, cost, validate, and export architectures directly. 18 tools across 6 groups (design, cost, validate, analyze, export, session).
pip install cloudwright-ai-mcp
cloudwright mcp # all tools, stdio
cloudwright mcp --tools design,cost # subset
cloudwright mcp --transport sse # SSE for HTTP clientsclaude_desktop_config.json (same shape works for Cursor and Cline):
{
"mcpServers": {
"cloudwright": {
"command": "cloudwright",
"args": ["mcp"]
}
}
}Analysis
cloudwright lint (10 anti-pattern checks), cloudwright score (5-dimension quality grade), cloudwright analyze (blast radius and SPOF), cloudwright drift <spec> <tfstate> (design vs deployed), cloudwright policy --rules policy.yaml (policy-as-code with 9 built-in checks), and cloudwright security (security anti-patterns; also scans exported Terraform HCL). Every command supports --json. See docs/ and the examples/ directory for end-to-end samples.
Python API
from cloudwright import ArchSpec
from cloudwright.cost import CostEngine
from cloudwright.validator import Validator
from cloudwright.exporter import export_spec
spec = ArchSpec.from_file("spec.yaml")
priced = CostEngine().estimate(spec, workload_profile="medium")
results = Validator().validate(spec, compliance=["hipaa", "pci-dss"])
hcl = export_spec(spec, "terraform", output_dir="./infra")What's new in v1.4.0
Pulumi exporter (TypeScript + Python).
cloudwright export spec.yaml --format pulumi-ts -o ./infrawrites a complete Pulumi TypeScript project (index.ts,Pulumi.yaml,package.json,tsconfig.json).--format pulumi-pythonwrites the Python equivalent. AWS, GCP, and Azure coverage matches the Terraform exporter, with the same safe-by-default posture (S3 public-access block + AES256 + versioning, RDS encryption + 7-day backups + deletion protection, EC2 IMDSv2, DynamoDB SSE + PITR, CloudFront TLSv1.2_2021, CloudTrail log-file validation). Aliasespulumi-typescriptandpulumi-pyalso work.Live AWS import.
cloudwright import-live --provider aws --region us-east-1 [--profile NAME] [--services ec2,rds,s3] [-o spec.yaml]walksboto3 describe-*calls (EC2, VPC + subnets + security groups, RDS, S3, Lambda, ECS, EKS, DynamoDB, ALB / NLB, CloudFront, SQS, API Gateway, CloudTrail) and produces an ArchSpec from running infrastructure. Captures security posture (S3 encryption + versioning + public-access-block, RDS multi-AZ + backup retention, EC2 IMDSv2, SG ingress 0.0.0.0/0). Best-effort connection inference: ALB to EC2 via target groups, CloudFront to S3 via origin domains. Per-service permission denials are non-fatal. Optional dep:pip install 'cloudwright-ai[live-import]'.Two-stage prompting plus boundary-aware spec.
Architect.design()now runs Stage 1 (free-text architectural reasoning via Sonnet) followed by Stage 2 (strict JSON projection via Haiku). Stage 2 is told the canonical service keys, allowed connection kinds (sync_request | async_event | stream | replication | batch), and boundary kinds (VPC / subnet / security_group / availability_zone / region / account), so it projects faithfully without redesigning. VPCs, subnets, and SGs are now first-class in the LLM contract. Per-stage usage (stage1,stage2,total_cost_usd,two_stage: true) is exposed on/api/design,/api/modify, and their streaming variants. Single-shot path retained as fallback (Architect(two_stage=False)).Workload-aware safe defaults. Pre-v1.4,
_post_validateforcedencryption=true,multi_az=true,backup=true,auto_scaling=true, andcount=2onto every spec, masking Stage 1 reasoning. v1.4 makes these conditional onspec.metadata.workload_profile:sandbox,dev,test,demo,pockeep the LLM's chosen values;production,medium,large,enterpriseget safe defaults forced. Compliance frameworks (HIPAA, PCI-DSS, SOC 2, GDPR, FedRAMP, HITRUST, ISO 27001) always force encryption + HA regardless of profile.GitHub Action for PR previews. Drop-in workflow posts an idempotent comment with architecture diff (added / removed / changed components), monthly cost delta (head vs. base, with annual rollup), and per-framework compliance changes whenever a PR touches
*.tf,*.tfstate,cloudwright.yaml, orspec.yaml. Reusable composite action at.github/actions/cloudwright-pr-comment/. Seedocs/github-action.md.Refreshed Smart Canvas demo GIF (
examples/cloudwright-smart-canvas-demo.gif) showing prompt to diagram to catalog drawer to add resource to side-panel edit to cost recomputation against the current UI. Reproducible viapython scripts/record_smart_canvas.py.Cancel-safe streaming via
AsyncAnthropicandAsyncOpenAI.chat/streamanddesign/streamnow use native async clients instead of athreading.Thread+asyncio.Queuebridge. When a client disconnects mid-stream,CancelledErrorpropagates into the SDK'sasync withblock and closes the upstream HTTPX connection, so the LLM call stops billing tokens at disconnect rather than at completion. Eliminates orphan threads and queue-full data loss. Syncsend_stream/generate_streampaths are preserved for the CLI; only the web routers switched.
What's new in v1.3.0
Safe-by-default Terraform. S3 public-access blocks, RDS
storage_encryptedanddeletion_protection, EC2 IMDSv2, security-group ingress restricted to listed CIDRs.HCL injection-safe escaping. All Terraform exporters (AWS, GCP, Azure, Databricks) escape user-supplied config values before interpolation.
Per-model LLM pricing. Haiku (fast classifier) and Sonnet (designer) billed at their respective rates instead of a single hardcoded rate.
Anthropic prompt caching. Roughly 70-80% input-token savings on chat follow-ups, with measurable latency improvement.
Atomic SessionStore writes. No more session corruption on SIGKILL or disk full mid-write.
Constant-time API key comparison. Web API auth is now timing-attack hardened.
FedRAMP region allowlist.
us-east-1is no longer flagged as FedRAMP-authorized; the validator now matches the actual GovCloud / FedRAMP-authorized region set.Health and version endpoints.
/healthreturns version, configured model, and catalog status. New/api/version.Request correlation IDs. Every web request gets an
X-Request-Id, plumbed through router logs.--debugflag works. Used to be a silent no-op; now prints prompts, timing, and token counts.cloudwright chat --webpinned to port 8765 to match docs and MCP/Slack integrations.Cost in design responses.
/api/designand/api/modifynow return cost in the response payload.Swagger UI gated.
/docsis off in production by default; setCLOUDWRIGHT_DOCS_ENABLED=trueto expose it.
Compatibility
Python 3.12+
LLM providers: Anthropic (Claude Sonnet, Haiku) and OpenAI (GPT-5+ family). Auto-detected from env.
Clouds: AWS, GCP, Azure, Databricks. 112 service keys total.
Install variants:
cloudwright-ai[cli],cloudwright-ai[web],cloudwright-ai-mcp.
Contributing, license, changelog
Contributing guide: CONTRIBUTING.md
License: MIT - see LICENSE
Full release history: CHANGELOG.md
Available Tools
19 toolsanalyze_blast_radiusA
Analyze blast radius and dependency structure of an architecture.
For each component (or just one, if component_id is set): returns direct
dependents, transitive dependents, blast-radius size, SPOF status, and
tier position. Use this to reason about failure modes — 'if component X
dies, what else breaks?'
When to use: You have a spec and want to understand coupling and failure
domains before production. Complementary to score_architecture (which
gives a summary grade) and lint_architecture (which flags specific
anti-patterns).
Behavior: Pure graph computation — no LLM, no network. Read-only. Does not touch cloud resources.
Inputs: spec_json (required), component_id.
catalog_searchA
Search the cloud instance catalog by provider, specs, or text query.
Returns matching instance types with instance family, vCPU / memory / storage, hourly on-demand price, region availability, and architecture (x86 / arm). All filters combine with AND semantics.
When to use: Right-sizing workloads, finding the cheapest instance that meets a hardware bar, or discovering equivalents across families.
Behavior: Pure lookup from the bundled SQLite catalog — no LLM, no
network. Prices reflect catalog snapshot date (see refresh CLI command
to update).
Inputs: provider, query, vcpus, memory_gb, +1 more. Returns: result
chat_create_sessionA
Create a new stateful architecture-design conversation session.
Returns {'session_id': <12-char hex>}. The session_id is the handle
for subsequent chat_send / chat_delete_session calls.
When to use: Multi-turn architecture design where each turn depends on
the prior one (e.g. 'design it', 'now add a cache', 'now move to GCP').
For single-shot design use design_architecture; for one-shot edits
of an existing spec use modify_architecture.
Behavior: Writes a new session file to the session store (persisted on
disk). Does not call the LLM — the first LLM call happens on the first
chat_send. Constraints are frozen at session creation and apply to
every turn.
Inputs: provider, budget_monthly, compliance.
chat_delete_sessionA
Delete a conversation session.
Returns {'deleted': True} on success or {'error': ...} if the session
did not exist. Destructive: the session's conversation history and any
uncommitted spec are lost. There is no undo.
When to use: Clean-up after a completed design, or abandoning a dead-end conversation. Does not affect any deployed infrastructure — cloudwright never deploys anything.
Behavior: Removes the session file from the session store. No LLM, no network.
Inputs: session_id (required).
chat_list_sessionsA
List all saved conversation sessions.
Returns a list of session metadata: session_id, creation timestamp, last-activity timestamp, cumulative token usage, and whether the session currently owns a spec.
When to use: Resuming prior work, cleaning up abandoned sessions, or auditing session token spend.
Behavior: Pure disk read — no LLM, no network. Read-only.
Inputs: no named parameters. Returns: result
chat_sendA
Send a message to an existing conversation session and get a response.
Returns {'response': str, 'spec': dict|None, 'usage': dict, 'cumulative_usage': dict}.
spec is populated when the turn produced or modified an ArchSpec.
usage reports LLM token counts for this turn; cumulative_usage totals
across the whole session.
When to use: Every turn after chat_create_session. For zero-state
single-shot calls use design_architecture / modify_architecture
instead.
Behavior: Calls an LLM — incurs API costs proportional to the conversation history length (history grows each turn). Persists updated session state back to the session store.
Inputs: session_id (required), message (required).
compare_provider_costsA
Compare the monthly cost totals of an architecture across cloud providers.
Returns one numeric cost summary per provider (monthly total, per-component breakdown, currency). Use this for cost-focused provider selection.
When to use vs compare_providers: This tool returns only cost numbers.
compare_providers returns full alternative architectures (components,
connections, tiers). If you want both the re-drawn architecture and its
bill, call compare_providers first, then estimate_cost on each returned
spec — or call both in parallel.
Behavior: Pure computation — no LLM, no network, no API costs. Uses the
same offline catalog as estimate_cost. Does not deploy.
Inputs: spec_json (required), providers (required). Returns: result
compare_providersA
Compare an architecture's service mapping across cloud providers.
Returns one translated ArchSpec per target provider, showing which services the original would become on each. Use this to understand architectural portability and equivalent services.
When to use vs compare_provider_costs: This tool returns full
alternative architectures (with components, connections, tiers).
compare_provider_costs returns only numeric cost totals per
provider — use that when you only care about the bill, not the shape.
Behavior: Calls an LLM to resolve ambiguous service mappings where the static equivalence table is insufficient. Does not deploy.
Inputs: spec_json (required), providers (required). Returns: result
design_architectureA
Design a cloud architecture from a natural-language description.
Primary entry point for greenfield architecture design. Returns a complete ArchSpec (YAML-serializable dict) with components, connections, tier assignments, and a cost estimate.
When to use: You have a requirement (prose) and need a concrete architecture
with services, wiring, and cost. Use modify_architecture to iterate on
an existing spec, or chat_create_session + chat_send for multi-turn
refinement.
Behavior: Calls an LLM provider (Anthropic or OpenAI depending on configured keys) — incurs API costs per invocation. Deterministic post-processing layers (cost engine, catalog lookup) apply safe defaults like encryption-at-rest, multi-AZ on databases, and auto-scaling. Does not deploy or modify any cloud resources.
Inputs: description (required), provider, region, budget_monthly, +1 more.
diff_architecturesA
Diff two architecture specs and return a structured change report.
Returns a structured delta: components added / removed / modified, connections added / removed / modified, cost delta (USD/month), compliance-impact flags (e.g. WAF removal, encryption-at-rest turned off), and a human-readable summary.
When to use: You have two versions of a spec (before / after a proposed change) and need a reviewable diff for approval or ADR writing.
Behavior: Pure computation — no LLM, no network. Read-only. Does not modify either spec.
Inputs: old_spec_json (required), new_spec_json (required).
estimate_costA
Estimate the monthly cloud bill for an architecture spec.
Returns a structured estimate with per-component breakdown, total monthly cost, data-transfer costs, and currency. Deterministic: same spec + tier yields same result.
When to use: You need the numeric bill for one architecture on one
provider+tier combination. For multi-provider comparison of just the
costs, use compare_provider_costs. For side-by-side architecture +
cost comparison across providers, use compare_providers + this tool.
Behavior: Pure computation — no LLM, no network, no API costs. Works offline. Does not deploy or touch cloud resources.
Inputs: spec_json (required), pricing_tier.
export_architectureA
Export an architecture spec to Terraform, CloudFormation, Mermaid, D2, or other formats.
Returns {'format': str, 'content': str} where content is the
ready-to-write payload. Terraform/CFN outputs use variables for sensitive
values (no hardcoded credentials), include provider blocks with region
configuration, and generate data sources for VPC/subnet discovery.
When to use: You have a finalized ArchSpec and need IaC code, a diagram,
or an audit artifact. For multi-format export, call once per format.
Behavior: Pure computation — no LLM, no network. Does not write files or deploy; the caller is responsible for persisting or applying the returned content.
Inputs: spec_json (required), format.
lint_architectureA
Lint an architecture for anti-patterns and best-practice violations.
Returns a list of warnings with rule name, severity (error / warning), component IDs involved, and a human-readable message.
Errors (production-blocking): unencrypted data stores, single-AZ databases, missing load balancer on public compute, public databases, single point of failure. Warnings (review-worthy): oversized instances (16xlarge+), missing WAF, missing monitoring, missing backups, missing auth.
When to use vs security_scan: lint is about architectural hygiene
(is this a sane shape?). security_scan is about threat exposure
(can an attacker reach X?). Use both for comprehensive review.
Behavior: Pure computation — no LLM, no network. Does not touch cloud.
Inputs: spec_json (required). Returns: result
list_servicesA
List all cloud services supported for a given provider.
Returns one entry per service with its slug, human-readable name, category
(compute / database / storage / networking / etc.), and supported tiers.
Use this to discover valid service: keys when hand-authoring ArchSpecs
or mapping requirements to services.
Behavior: Pure lookup from the bundled service registry — no LLM, no network, no cloud access.
Inputs: provider. Returns: result
modify_architectureA
Modify an existing architecture with a natural-language instruction.
When to use: You already have an ArchSpec and want to evolve it (add a
cache, swap a service, change a region). Returns the updated ArchSpec.
For from-scratch design, use design_architecture. For iterative
multi-turn editing with conversation memory, use chat_create_session.
Behavior: Calls an LLM provider — incurs API costs. Pure function: returns a new spec without mutating the input. Does not deploy.
Inputs: spec_json (required), instruction (required).
scan_terraformA
Scan Terraform HCL source for security misconfigurations.
Returns findings (severity-graded) tied to specific resource blocks — e.g.
aws_s3_bucket with acl = public-read, aws_security_group with
cidr_blocks = 0.0.0.0/0 on sensitive ports, aws_rds_instance with
storage_encrypted = false.
When to use: You have existing Terraform code (not an ArchSpec) and want
an immediate security audit. For ArchSpec-level audit, use security_scan.
Behavior: Pure computation — no LLM, no network. Does not run Terraform or touch cloud. Safe for scanning untrusted HCL.
Inputs: hcl_content (required).
score_architectureA
Score an architecture across reliability, security, cost, compliance, and complexity.
Returns the dimension scores, overall weighted score (0-100), letter grade, and per-dimension notes. Weights: Reliability 30% (load balancing, multi-AZ, auto-scaling, CDN, caching), Security 25% (WAF, auth, encryption, HTTPS, DNS), Cost Efficiency 20% (budget compliance, free- tier usage), Compliance 15% (framework validation), Complexity 10% (component count, connection density, tier separation).
When to use: You want a quick quality summary before a design review.
For specific findings, use lint_architecture, security_scan, or
validate_compliance.
Behavior: Pure computation — no LLM, no network. Read-only.
Inputs: spec_json (required).
security_scanA
Scan an architecture for security anti-patterns and misconfigurations.
Returns a structured report with severity-graded findings (critical / high
/ medium / low / info), each tied to specific component IDs. Framework-
agnostic — use validate_compliance for specific regulatory frameworks.
Checks include: unencrypted data stores, public-facing databases, missing WAF on public HTTP endpoints, weak auth on APIs, SPOFs, overly permissive connection protocols.
Behavior: Pure computation — no LLM, no network. Does not touch cloud.
Inputs: spec_json (required).
validate_complianceA
Validate an architecture against compliance frameworks.
Returns one result object per framework with pass/fail status per check, evidence (which components triggered the rule), and remediation hints.
When to use: You have a proposed architecture and need to know whether
it satisfies HIPAA / PCI-DSS / SOC 2 / FedRAMP / GDPR before proceeding.
Use security_scan for anti-pattern detection (weak auth, public
buckets, etc.) which is framework-agnostic.
Behavior: Pure computation — no LLM, no network. Evaluates the spec statically against 30+ rules. Does not access or modify any cloud resources.
Inputs: spec_json (required), frameworks (required), well_architected. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Most tools have distinct purposes with clear 'when to use' cross-references, but there is slight overlap between security_scan and lint_architecture (both catch similar issues), and between scan_terraform and security_scan (both scan for security misconfigurations). The descriptions help distinguish them, so confusion is unlikely.
All tools follow a consistent verb_noun pattern: design_architecture, modify_architecture, compare_providers, estimate_cost, scan_terraform, chat_create_session, etc. The 'chat_' prefix for session tools clearly groups them, and each verb is meaningful and non-redundant.
19 tools is slightly above the typical 3-15 range but well-justified given the server's broad scope: architecture design, cost estimation, compliance, security, IaC export, session management, and catalog lookup. Each tool has a clear role, and the count is reasonable for the domain.
The tool surface covers the full architecture lifecycle: design, modify, compare, cost, validate, security, lint, blast radius, diff, export, and session management. Missing deployment/apply is intentional (server does not deploy), and the catalog lookup tools support hand-authoring. No obvious gaps for the stated purpose.
Maintenance
Related MCP Connectors
Designs, prices, and deploys AWS/GCP cloud infrastructure from plain-English requirements.
Design, plan and apply cloud infrastructure across AWS, GCP, Azure and Hetzner, with human approval.
11Unified API to query AWS, GCP, Azure and generate Terraform/CLI execution kits for AI agents.
Simulate cloud infrastructure and estimate cost before deploying or changing infrastructure.
Related MCP Servers
- AlicenseAqualityBmaintenanceAI infrastructure design agent. Describe your app in plain English; Riley designs, prices, and deploys AWS or GCP infrastructure with generated Terraform.24Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to model, validate, and analyze multi-cloud infrastructure as a typed graph, with tools for IaC import/export, cost estimation, and architecture review.Apache 2.0
- AlicenseAqualityCmaintenanceCloud infrastructure provisioning via natural language. Enables deploying production-ready infrastructure on AWS, GCP, Azure, or Oracle with a single prompt.129 npmMIT
- AlicenseNot gradedqualityBmaintenanceAutonomous multi-agent pipeline that analyzes Terraform files for cost, governance, and compliance issues, providing real-time remediation and XAI console for human-in-the-loop approval.MIT