tfmcp: Terraform Model Context Protocol Tool
🌍 Terraform Model Context Protocol (MCP) Tool - An experimental CLI tool that enables AI assistants to manage and operate Terraform environments. Supports reading Terraform configurations, analyzing plans, applying configurations, and managing state with Claude Desktop integration. ⚡️
Overview
tfmcp is an experimental command-line tool that enables AI assistants to manage and operate Terraform environments through the Model Context Protocol (MCP). It allows users to read Terraform configurations, analyze plans, apply configurations, and manage state effectively.
To use tfmcp, install it via Cargo with cargo install tfmcp, and then run commands like tfmcp analyze to analyze configurations or tfmcp mcp to launch it as an MCP server. Integration with Claude Desktop is also supported for enhanced functionality.
- Deep integration with Terraform CLI for executing operations. - Runs as an MCP server for AI assistants. - High-speed processing powered by Rust. - Automatic setup of sample Terraform projects for new users.
- Managing Terraform configurations through AI assistants.
- Analyzing and applying Terraform plans efficiently.
- Automating infrastructure management tasks with AI integration.
Add to your AI client
Use these steps to connect tfmcp: Terraform Model Context Protocol Tool in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"tfmcp-nwiizo": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-tfmcp-nwiizo"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"tfmcp-nwiizo": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-tfmcp-nwiizo"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"tfmcp-nwiizo": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-tfmcp-nwiizo"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"tfmcp-nwiizo": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-tfmcp-nwiizo"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"tfmcp-nwiizo": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-tfmcp-nwiizo"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"tfmcp-nwiizo": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-tfmcp-nwiizo"
]
}
}
}FAQ
**Is tfmcp stable?**
No, tfmcp is experimental and features may change without notice.
**What are the requirements?**
You need Rust, Terraform CLI, and Claude Desktop for full functionality.
**Can I contribute to tfmcp?**
Yes, contributions are welcome! Please follow the guidelines in the repository.