Show HN: Tf-dialect: Teach AI agents your org's Terraform standards via MCP (github.com)

🤖 AI Summary
tf-dialect is an open-source MCP (Model Context Protocol) server that lets organizations teach their Terraform style guide directly to AI coding agents (Claude Desktop, Cline, etc.), so agents generate org-specific, compliant IaC instead of generic HCL. Instead of catching violations after the fact with tflint, Checkov or Sentinel, tf-dialect exposes naming conventions, required tags, approved modules and security defaults to the model before code is produced—reducing rework, improving security, and standardizing output across teams. Technically, tf-dialect is a Node.js MCP server configured via a single terraform-style.yaml that defines modules, naming formats (e.g., <project>-<env>-<component>-<extra?>), required tags, security_defaults (S3 encryption, versioning, block public ACLs; RDS encryption and backups), examples and regex rules. It exposes four MCP tools: get_style_guide, list_examples, validate_snippet and generate_resource. Agents can query the style, request examples, synthesize a resource that follows org rules, then validate snippets before committing. It supports aws_s3_bucket and aws_db_instance explicitly (others return annotated stubs), integrates with existing registries and post-generation checks, and ships MIT-licensed—making it a practical pre-generation enforcement layer for AI-native Terraform workflows.
Loading comments...
loading comments...