Terraform Cwd MCP logo

Terraform Cwd MCP

by @yawlabs

Reads pinned Terraform schemas, plans, state, modules, and provider-upgrade effects from a working directory.

Install Terraform Cwd MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "yawlabs-terraform-cwd-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/terraform-cwd-mcp@latest"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passed— started and listed 9 tools correctly ().

Overview

@yawlabs/terraform-cwd-mcp reads Terraform's pinned provider schemas, saved plans, state, and module interfaces from a working directory. It uses the versions recorded in `.terraform.lock.hcl` and runs Terraform commands without initializing the root directory. Reach for it when an agent must validate configuration against the provider version actually installed, inspect redacted state, or assess a provider upgrade. State access can use remote backend credentials inherited from the MCP client, while upgrade analysis works in a temporary copy.

Use cases

  • Inspect pinned provider schemas before editing Terraform
  • Validate resource and nested-block argument paths
  • Summarize saved plans without exposing values
  • Review module interfaces and installed module calls
  • Assess provider-upgrade impact before changing constraints

Key features

  • Pinned provider schema inspection
  • Argument and block-path validation
  • Saved plan summarization
  • Redacted Terraform state inspection
  • Module interface discovery
  • Provider-upgrade impact analysis

Tools9

What Terraform Cwd MCP lets your agent do. Expand a tool for its parameters.

Verified live~2.4k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

4/4 checks healthy over the last 12d

What it can do

From the 9 tools this server returned when we ran it; 9 declare their own safety hints.

Handles credentials · 2Makes network requests · 3Read-only tools · 9
Network at startup3 connections
Files written at startupNone
Install scriptsprepare
npm provenanceNot published
Package age34 days
Maintainers1

Observed 2026-11-19 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 12d ago via OSV.dev · @yawlabs/terraform-cwd-mcp@latest (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
npm downloads1.4kPackage downloads in the last 30 days.
Last commit1d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed9Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Terraform Cwd MCP works

What @yawlabs/terraform-cwd-mcp does

@yawlabs/terraform-cwd-mcp exposes Terraform working-directory inspection through MCP. Its primary source of schema information is terraform providers schema -json from the root module, with provider versions tied to .terraform.lock.hcl rather than the latest registry documentation.

The server covers provider types, argument paths, saved plans, module interfaces, state addresses, individual resource values, and provider upgrade effects. It is intended for agents that need repository-specific Terraform facts before editing configuration. The server complements, rather than replaces, HashiCorp's official Terraform MCP server: the official server covers usage documentation, current versions, registry modules, and HCP/TFE runs, while this server focuses on the checked-out working directory.

How it works

Each tool accepts an optional dir identifying the root module. Provider discovery should begin with tf_list_providers, followed by type search and schema inspection when an agent needs to write or modify a resource, data source, or ephemeral block.

Schema dumps are cached in memory and on disk using the root path and lock-file contents as the cache key. Changing the lock file therefore invalidates the cached provider data. Terraform is launched directly rather than through a shell, and output is streamed for use across macOS, Linux, and Windows.

The server does not run terraform init in the working directory. State tools invoke terraform state list and terraform show -json; they do not refresh state or acquire a state lock. Remote backends may still be contacted using credentials available to the MCP client. Terraform child processes receive CHECKPOINT_DISABLE=1.

Provider upgrade analysis is isolated in a temporary directory. The target provider is installed into a plugin cache, then a temporary configuration copy is validated. The root state and *.tfvars files are not copied.

Setup and configuration

Install the package through an MCP client using the command npx -y @yawlabs/terraform-cwd-mcp. The working directory supplied to a tool should contain the Terraform root module and its initialized provider data; an uninitialized directory produces an actionable error instead of triggering initialization.

For upgrade analysis, the plugin cache can be selected with TERRAFORM_CWD_MCP_PLUGIN_CACHE. If it is unset, the server uses TF_PLUGIN_CACHE_DIR, followed by a cache location under the user's cache directory. Upgrade installation calls are serialized because the plugin cache is not safe for concurrent installs.

Tools and capabilities

  • tf_list_providers reports root-module providers, pinned versions, and resource, data, and ephemeral counts.
  • tf_search_types, tf_get_schema, and tf_check_arguments locate types, render their arguments and nested blocks, and classify dotted paths as valid, computed-only, deprecated, unknown, or attribute-versus-block mismatches.
  • tf_summarize_plan reads a binary plan, plan JSON, or JSON text and prioritizes deletes and replacements, including replacement causes. It also reports updates, creates, imports, moves, forgets, drift, deferred changes, outputs, counts, and destroy warnings without printing values.
  • tf_module_interface describes variables, outputs, and module calls for root, local, or installed modules, including type expressions, defaults, sensitivity, nullability, ephemeral status, and validation counts.
  • tf_state_addresses lists state instances with filtering and ID lookup. tf_show_resource displays one instance with sensitive and secret-like values redacted.
  • tf_upgrade_impact compares a pinned provider with an exact target version, identifies affected configuration usage and constraints, and confirms findings with validation in a temporary copy.

Limitations and notes

State redaction has no option to reveal sensitive values. It covers Terraform-sensitive values, values derived from marked secrets in state, secret-like keys, and recognizable token or private-key formats; some unmarked derived values may remain visible. Selecting a nonexistent non-default workspace is refused to avoid creating an empty remote state. The server never writes the root module, its .terraform directory, lock file, or state.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Terraform Cwd MCP

@yawlabs/terraform-cwd-mcp is an MCP server that connects AI agents to a Terraform working directory and its locked provider versions. Its main tools inspect provider schemas, validate arguments, summarize plans, examine redacted state, describe modules, and assess provider-upgrade impact without initializing the root module.

Install it with `npx -y @yawlabs/terraform-cwd-mcp` in an MCP client configuration. The server expects a Terraform working directory with initialized provider data and does not run `terraform init` itself.

Yes, it uses the pinned versions represented by `.terraform.lock.hcl` and the schemas produced by `terraform providers schema -json`. This lets schema and argument checks reflect the provider version in the working directory instead of the latest registry release.

No, `tf_show_resource` redacts sensitive state values and has no option to disable redaction. It also masks values under secret-like keys and recognizable secret formats, while unmarked derived values may still be shown.

It compares the pinned provider with an exact target version in a temporary copy, identifies removed, retyped, deprecated, read-only, or newly required usage, checks version constraints, and runs `terraform validate`. The working directory's state and `*.tfvars` files are not copied.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewTerraform Cwd MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/yawlabs-terraform-cwd-mcp?style=directory)](https://allmcps.com/mcp/yawlabs-terraform-cwd-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/yawlabs-terraform-cwd-mcp"><img src="https://allmcps.com/api/badge/yawlabs-terraform-cwd-mcp?style=directory" alt="Terraform Cwd MCP on AllMCPs" /></a>