# Terraform CWD MCP Server

> Terraform CWD MCP Server is an open-source MCP server for cloud and infrastructure. Check Terraform provider schemas, plans and state against what your lock file pins. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI
- **Website:** https://yaw.sh/mcp-servers/terraform-cwd-mcp/
- **Repository:** https://github.com/yawlabs/terraform-cwd-mcp
- **MCP Registry name:** io.github.YawLabs/terraform-cwd-mcp
- **Categories:** cloud and infrastructure, developer tools
- **Listing updated:** 2026-11-15

## About

Agents often write Terraform against whatever provider version their training data or the registry docs describe. Here the answer comes from terraform providers schema -json run in your root module, with versions read from .terraform.lock.hcl, so an argument is judged against the version you actually pinned. It is meant to sit beside HashiCorp's registry-based server, not replace it.

Tools cover listing pinned providers, searching type names, rendering one resource's schema as a compact outline, and checking dotted argument paths so an agent never sets a read-only attribute. tf_summarize_plan reads a saved plan and shows deletes and replaces first without printing values. State tools list addresses and show one instance with sensitive values redacted. tf_upgrade_impact diffs your configuration against a target provider version and confirms with terraform validate on a temp copy.

It never runs terraform init, so the directory must be initialised first. Schema dumps are cached per lock file, because the AWS provider's schema runs to tens of megabytes. Yaw Labs publishes it under the MIT licence.

## Features

- **Pinned schemas:** Answers reflect the provider versions in your lock file.
- **Argument checking:** Flags read-only, unknown and deprecated arguments before code is written.
- **Plan summaries:** Lists deletes and replaces first without printing values.
- **Redacted state:** Show resource instances with sensitive values hidden.
- **Upgrade impact:** See what a provider bump would break.

## Good for

- Verify a resource argument exists at your pinned AWS version
- Summarise a saved plan before approving it
- Inspect local module interfaces
- Estimate what upgrading a provider will break

## Install

### Claude Code (Terminal)

```sh
claude mcp add terraform-cwd-mcp -- npx -y @yawlabs/terraform-cwd-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "terraform-cwd-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/terraform-cwd-mcp"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "terraform-cwd-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/terraform-cwd-mcp"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "terraform-cwd-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/terraform-cwd-mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "terraform-cwd-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/terraform-cwd-mcp"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "terraform-cwd-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/terraform-cwd-mcp"
      ]
    }
  }
}
```

## Tools

- `tf_list_providers`: Providers with pinned versions and resource counts
- `tf_search_types`: Find type names containing a substring
- `tf_get_schema`: Arguments and nested blocks of one type at the pinned version
- `tf_check_arguments`: Validate dotted argument paths
- `tf_summarize_plan`: Summarise a saved plan, deletes and replaces first
- `tf_module_interface`: Variables and interface of a module
- `tf_state_addresses`: List resource instance addresses in state
- `tf_show_resource`: Show one state instance with sensitive values redacted
- `tf_upgrade_impact`: Diff configuration against a target provider version

## FAQ

### Does it run terraform init?

No. It never runs init, and an uninitialised directory gets an error telling you what to run.

### Which licence applies?

MIT.

### How does it relate to HashiCorp's server?

It complements it: that one answers from registry docs for the latest release, this one from your locked versions.

### Is Terraform CWD MCP Server free?

Yes. Terraform CWD MCP Server is open source, so you can use and self-host it for free.

### How do I add Terraform CWD MCP Server to Claude Code?

Run this command in your terminal: claude mcp add terraform-cwd-mcp -- npx -y @yawlabs/terraform-cwd-mcp

### What are the best alternatives to Terraform CWD MCP Server?

The closest alternatives to Terraform CWD MCP Server are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/terraform-cwd-mcp-server
