MCP Catalogs
首页tfmcp screenshot

tfmcp

by nwiizo·364·综合分 52

tfmcp 是一个全面的 Terraform MCP 服务器,配备 31 个专业工具,让 AI 助手能够管理基础设施。

ops-infradeveloper-toolssecurity
28
Forks
0
活跃 Issue
2 个月前
最近提交
2 天前
收录于

概述

tfmcp 是一个基于 Rust 的命令行工具,通过模型上下文协议扩展了 Terraform 的功能。它提供了全面的基础设施管理工具,包括配置分析、计划执行、状态管理和工作区操作。该工具具有强大的安全控制功能,包括可配置策略、审计日志和操作限制,适合生产环境使用。其高级分析功能包括模块健康评分、依赖关系图可视化和 Future Architect Terraform 指南的合规性检查。

试试问 AI

装完之后,这里有 7 个你可以让 AI 做的事:

:AI 助手通过自然语言命令管理 Terraform 基础设施
:基础设施即代码分析和重构建议
:自动化 Terraform 计划审查和风险评估
:跨多个环境的工作区管理
:Terraform 模块搜索和集成辅助
:如何启用 terraform apply 等危险操作?
:审计日志存储在哪里?

什么时候选它

当您需要通过 AI 助手全面管理 Terraform,尤其是已经使用 Claude Desktop 并需要企业级安全功能时,选择 tfmcp。

什么时候不要选它

如果您需要 Terraform 以外的云提供商的 MCP 服务器支持,或者需要超出 Terraform 操作的写入能力,请避免使用 tfmcp。

此 server 暴露的工具

从 README 抽取出 12 个工具
  • init_terraform

    Initialize Terraform working directory

  • get_terraform_plan

    Generate and show execution plan

  • apply_terraform

    Apply Terraform configuration

  • destroy_terraform

    Destroy Terraform-managed infrastructure

  • validate_terraform

    Validate configuration syntax

  • analyze_plan

    Analyze plan with risk scoring and recommendations

  • terraform_workspace

    Manage Terraform workspaces (list, show, new, select, delete)

  • terraform_import

    Import existing resources into Terraform state

  • analyze_terraform

    Analyze Terraform configuration

  • terraform_graph

    Generate dependency graph of Terraform resources

  • search_terraform_modules

    Search Terraform modules in the registry

  • get_security_status

    Perform security scan with secret detection

可对比工具

mcp-terraformmcp-infraterraform-shell

安装

安装

从 Crates.io 安装

cargo install tfmcp

使用 Docker

git clone https://github.com/nwiizo/tfmcp
cd tfmcp
docker build -t tfmcp .
docker run -it tfmcp

Claude Desktop 集成

添加到 ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "tfmcp": {
      "command": "/path/to/your/tfmcp",
      "args": ["mcp"],
      "env": {
        "HOME": "/Users/yourusername",
        "PATH": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
        "TERRAFORM_DIR": "/path/to/your/terraform/project"
      }
    }
  }
}

FAQ

如何启用 terraform apply 等危险操作?
设置环境变量:TFMCP_ALLOW_DANGEROUS_OPS=true。要启用自动批准,还需设置 TFMCP_ALLOW_AUTO_APPROVE=true。
审计日志存储在哪里?
默认情况下,审计日志存储在 ~/.tfmcp/audit.log。您可以使用 TFMCP_AUDIT_LOG_FILE 自定义路径。

Hacker News 讨论

开发者社区最近的相关讨论。

tfmcp 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。