An AWS Labs Model Context Protocol (MCP) server for terraform
Project description
AWS Terraform MCP Server
MCP server for Terraform on AWS best practices, infrastructure as code patterns, and security compliance with Checkov.
Features
-
Terraform Best Practices - Get prescriptive Terraform advice for building applications on AWS
- AWS Well-Architected guidance for Terraform configurations
- Security and compliance recommendations
- AWSCC provider prioritization for consistent API behavior
-
Security-First Development Workflow - Follow a structured process for creating secure code
- Step-by-step guidance for validation and security scanning
- Integration of Checkov at the right stages of development
- Clear handoff points between AI assistance and developer deployment
-
Checkov Integration - Work with Checkov for security and compliance scanning
- Run security scans on Terraform code to identify vulnerabilities
- Automatically fix identified security issues when possible
- Get detailed remediation guidance for compliance issues
-
AWS Provider Documentation - Search for AWS and AWSCC provider resources
- Find documentation for specific resources and attributes
- Get example snippets and implementation guidance
- Compare AWS and AWSCC provider capabilities
-
AWS-IA GenAI Modules - Access specialized modules for AI/ML workloads
- Amazon Bedrock module for generative AI applications
- OpenSearch Serverless for vector search capabilities
- SageMaker endpoint deployment for ML model hosting
- Serverless Streamlit application deployment for AI interfaces
-
Terraform Registry Module Analysis - Analyze Terraform Registry modules
- Search for modules by URL or identifier
- Extract input variables, output variables, and README content
- Understand module usage and configuration options
- Analyze module structure and dependencies
-
Terraform Workflow Execution - Run Terraform commands directly
- Initialize, plan, validate, apply, and destroy operations
- Pass variables and specify AWS regions
- Get formatted command output for analysis
-
Terragrunt Workflow Execution - Run Terragrunt commands directly
- Initialize, plan, validate, apply, run-all and destroy operations
- Pass variables and specify AWS regions
- Configure terragrunt-config and and include/exclude paths flags
- Get formatted command output for analysis
Tools and Resources
- Terraform Development Workflow: Follow security-focused development process via
terraform://workflow_guide - AWS Best Practices: Access AWS-specific guidance via
terraform://aws_best_practices - AWS Provider Resources: Access resource listings via
terraform://aws_provider_resources_listing - AWSCC Provider Resources: Access resource listings via
terraform://awscc_provider_resources_listing
Prerequisites
- Install
uvfrom Astral or the GitHub README - Install Python using
uv python install 3.10 - Install Terraform CLI for workflow execution
- Install Checkov for security scanning
Installation
Here are some ways you can work with MCP across AWS, and we'll be adding support to more products including Amazon Q Developer CLI soon: (e.g. for Amazon Q Developer CLI MCP, ~/.aws/amazonq/mcp.json):
{
"mcpServers": {
"awslabs.terraform-mcp-server": {
"command": "uvx",
"args": ["awslabs.terraform-mcp-server@latest"],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR"
},
"disabled": false,
"autoApprove": []
}
}
}
or docker after a successful docker build -t awslabs/terraform-mcp-server .:
{
"mcpServers": {
"awslabs.terraform-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"--interactive",
"--env",
"FASTMCP_LOG_LEVEL=ERROR",
"awslabs/terraform-mcp-server:latest"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
Security Considerations
When using this MCP server, you should consider:
- Following the structured development workflow that integrates validation and security scanning
- Reviewing all Checkov warnings and errors manually
- Fixing security issues rather than ignoring them whenever possible
- Documenting clear justifications for any necessary exceptions
- Using the RunCheckovScan tool regularly to verify security compliance
- Preferring the AWSCC provider for its consistent API behavior and better security defaults
Before applying Terraform changes to production environments, you should conduct your own independent assessment to ensure that your infrastructure would comply with your own specific security and quality control practices and standards, as well as the local laws, rules, and regulations that govern you and your content.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file awslabs_terraform_mcp_server-1.0.1.tar.gz.
File metadata
- Download URL: awslabs_terraform_mcp_server-1.0.1.tar.gz
- Upload date:
- Size: 306.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01e93a5e2e9431e87b076a51cdb1bfceaa6f45824b11d486a4f876a87111d1d8
|
|
| MD5 |
41092db5de3f457c351d695f6193c6eb
|
|
| BLAKE2b-256 |
1c9d9199463982088503bf3e5d400a718cf1b2f07bbcccbe815a142a82b3c1e9
|
Provenance
The following attestation bundles were made for awslabs_terraform_mcp_server-1.0.1.tar.gz:
Publisher:
release.yml on awslabs/mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
awslabs_terraform_mcp_server-1.0.1.tar.gz -
Subject digest:
01e93a5e2e9431e87b076a51cdb1bfceaa6f45824b11d486a4f876a87111d1d8 - Sigstore transparency entry: 229943801
- Sigstore integration time:
-
Permalink:
awslabs/mcp@6cc04ae59d56ca5de30ecc642ac055e332e937e2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/awslabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6cc04ae59d56ca5de30ecc642ac055e332e937e2 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file awslabs_terraform_mcp_server-1.0.1-py3-none-any.whl.
File metadata
- Download URL: awslabs_terraform_mcp_server-1.0.1-py3-none-any.whl
- Upload date:
- Size: 168.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea0f9ff5191e63fe669de91b607828ab628c639560da371623f0589474ae8f16
|
|
| MD5 |
f28dfe117f7b82bf309863f9c176f06b
|
|
| BLAKE2b-256 |
8c21011f8c918ec1a8e8c91a71c1fdf268d9fcc0ff76603f63891468b24f9a87
|
Provenance
The following attestation bundles were made for awslabs_terraform_mcp_server-1.0.1-py3-none-any.whl:
Publisher:
release.yml on awslabs/mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
awslabs_terraform_mcp_server-1.0.1-py3-none-any.whl -
Subject digest:
ea0f9ff5191e63fe669de91b607828ab628c639560da371623f0589474ae8f16 - Sigstore transparency entry: 229943811
- Sigstore integration time:
-
Permalink:
awslabs/mcp@6cc04ae59d56ca5de30ecc642ac055e332e937e2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/awslabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6cc04ae59d56ca5de30ecc642ac055e332e937e2 -
Trigger Event:
workflow_dispatch
-
Statement type: