MCP server

TerraVision MCP: Terraform Code to Architecture Diagrams

TerraVision MCP lets an AI agent generate cloud architecture diagrams from real Terraform code or a JSON graph, using the same renderer as the CLI.

Run
pipx install "terravision[mcp]"
claude mcp add terravision -- terravision mcp
View on GitHub

Stars, license and last push from GitHub. Install count as reported by the open skills directory.

What is TerraVision MCP?

TerraVision MCP is an optional stdio server bundled with the TerraVision CLI. It gives an AI agent tools to generate AWS, Azure or GCP architecture diagrams, export the underlying resource graph, build an interactive HTML view, and open the rendered output, all derived from a Terraform plan or a hand-written JSON graph, with no cloud credentials of its own.

It is an optional stdio server bundled with the TerraVision CLI. Instead of an agent inventing an architecture diagram from whatever it can infer, the server returns one derived from a real Terraform plan, with conditionals, count, for_each and module expansion already resolved.

The server runs as a local subprocess and listens on no port. It needs no cloud credentials of its own; when a tool is pointed at raw Terraform, Terraform itself authenticates to the cloud provider to produce the plan.

What changes in an agent's diagrams

  • diagram_guide reports the graph format rules, node types, pattern library and gallery designs for one provider, so the agent matches TerraVision's own icon and detail conventions before it draws anything.
  • render_graph renders a diagram straight from an inline JSON graph and never runs Terraform, so an agent can preview or correct a design in seconds.
  • Warnings point at exactly what will not draw as written, such as an unknown resource type, an arrow into a shared service, or a node listed in two boxes.
  • generate_diagram always saves the full set together, PNG, SVG, an editable draw.io drawing and the graph itself, so the same data can be reopened and rendered again.

How the setup works

  1. Install the optional mcp extra alongside TerraVision, with pipx, uv, pip or Poetry.
  2. Register the server with your client; it speaks stdio and launches as a local subprocess.
  3. Pass --output-dir so generated diagrams land in a fixed, writable location.
  4. Point a tool at a Terraform source path, a Git URL, a .tvg.json graph export, or a planfile/graphfile pair exported from a CI pipeline.

Who TerraVision MCP is for

Best for

  • Teams that already generate diagrams with the TerraVision CLI and want the same renderer callable from inside an agent session.
  • Agents working from a Terraform plan or a previously exported graph, so the diagram matches what is actually defined in code rather than a guess.

Not for

  • Hand-drawing a fresh architecture diagram with no existing Terraform to parse, a job Excalidraw Icons MCP covers with its own live canvas and vendor icons.
  • Loading general design rules for charts, mockups or SVG art rather than cloud architecture diagrams, which Generative UI MCP covers with one on-demand tool.
  • Turning a finished diff or Terraform plan into a short HTML explainer page with diagrams and tables, a task Visual Explainer already takes on for an agent's regular output.
  • Running a separate local desktop design editor beside the canvas instead of rendering from Terraform code, a role Figmaboy MCP fills with its own stdio server.

Requirements and platform

  • Needs terraform or tofu, dot and gvpr from Graphviz, and git on PATH; a GUI client that does not inherit a shell's PATH is a common source of "not found" errors.
  • A Docker image bundles Graphviz, Git and Terraform together, so a client can run the server with nothing else installed locally.
  • Reads are unrestricted, matching the CLI's own reach; writes are confined to the configured output location, since outfile rejects separators and ...