AWS Terraform MCP Server
Offers containerized deployment of the MCP server, allowing it to run in isolated environments with all dependencies included
Integrates with GitHub for source code management and package distribution through GitHub Container Registry (GHCR)
Provides access to AWS-IA GenAI modules for OpenSearch through the SearchSpecificAwsIaModules tool
Supports testing framework for validating MCP server functionality
Implements Semantic Versioning for release management with automated releases based on commit conventions
Provides access to AWS-IA GenAI modules for Streamlit through the SearchSpecificAwsIaModules tool
Provides tools for executing Terraform commands (init, plan, validate, apply, destroy) and searching AWS provider documentation to help with infrastructure as code management
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AWS Terraform MCP Server create an S3 bucket with encryption and versioning enabled"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AWS Terraform MCP Server
Docker containerized version of the AWS Labs Terraform MCP Server - a Model Context Protocol (MCP) server for Terraform on AWS best practices, infrastructure as code patterns, and security compliance with Checkov.
๐ Quick Start
Using Docker (Recommended)
# Pull and run the latest image
docker run --rm --interactive ghcr.io/stv-io/aws-terraform-mcp-server:latestUsing with MCP Clients
Windsurf IDE
Add to your Windsurf MCP settings:
{
"name": "AWS Terraform MCP Server",
"command": "docker",
"args": [
"run", "--rm", "--interactive",
"--env", "FASTMCP_LOG_LEVEL=ERROR",
"ghcr.io/stv-io/aws-terraform-mcp-server:latest"
],
"env": {},
"disabled": false,
"autoApprove": []
}Cursor IDE
Add to your Cursor MCP configuration:
{
"mcpServers": {
"aws-terraform-mcp-server": {
"command": "docker",
"args": [
"run", "--rm", "--interactive",
"--env", "FASTMCP_LOG_LEVEL=ERROR",
"ghcr.io/stv-io/aws-terraform-mcp-server:latest"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}Related MCP server: Terrakube MCP Server
๐ ๏ธ Features
Tools Available
ExecuteTerraformCommand - Run Terraform commands (init, plan, validate, apply, destroy)
ExecuteTerragruntCommand - Run Terragrunt workflows with advanced features
SearchAwsProviderDocs - Search AWS provider documentation
SearchAwsccProviderDocs - Search AWSCC provider documentation
SearchSpecificAwsIaModules - Access AWS-IA GenAI modules (Bedrock, OpenSearch, SageMaker, Streamlit)
RunCheckovScan - Security and compliance scanning with Checkov
SearchUserProvidedModule - Analyze Terraform Registry modules
Resources Available
terraform_development_workflow - Security-focused development process guide
terraform_aws_provider_resources_listing - Comprehensive AWS provider resources catalog
terraform_awscc_provider_resources_listing - AWSCC provider resources catalog
terraform_aws_best_practices - AWS Terraform best practices guidance
๐ง Development
Building Locally
# Clone the repository
git clone https://github.com/stv-io/aws-terraform-mcp-server.git
cd aws-terraform-mcp-server
# Build the Docker image
docker build -t aws-terraform-mcp-server .
# Run locally
docker run --rm --interactive aws-terraform-mcp-serverTesting
Local Docker Testing
# Test the locally built Docker image
python3 test_docker_mcp.py
# Test the published Docker image from GHCR
sed 's|aws-terraform-mcp-server:latest|ghcr.io/stv-io/aws-terraform-mcp-server:latest|g' test_docker_mcp.py > test_published.py
python3 test_published.pyDirect Server Testing (without Docker)
# Test the server directly using uv
python3 test_mcp_server.pyUnit Tests
# Run the comprehensive test suite
python3 -m pytest tests/ -vUsing UV (Alternative)
# Install dependencies
uv sync
# Run the server
uv run awslabs.terraform-mcp-server๐ Prerequisites
For local development:
uv - Python package manager
Python 3.10+
Terraform CLI (for workflow execution)
Checkov (for security scanning)
For Docker usage:
Docker or compatible container runtime
๐ Security Considerations
Follow structured development workflow with integrated validation and security scanning
Review all Checkov warnings and fix security issues when possible
Use AWSCC provider for consistent API behavior and better security defaults
Conduct independent assessment before applying changes to production environments
๐ Versioning
This project uses Semantic Versioning with automated releases based on Conventional Commits.
Available Tags
latest- Latest stable releasev1.2.3- Specific versionv1.2- Latest patch of minor versionv1- Latest minor of major version
See CONTRIBUTING.md for commit message guidelines.
๐ License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
๐ Acknowledgments
Original implementation by AWS Labs
Built on the Model Context Protocol
Uses FastMCP framework
๐ Support
For issues and questions:
Note: This is a containerized distribution of the AWS Labs Terraform MCP Server. All credit for the core functionality goes to the AWS Labs team.
Available Tools
7 toolsExecuteTerraformCommandA
Execute Terraform workflow commands against an AWS account.
This tool runs Terraform commands (init, plan, validate, apply, destroy) in the
specified working directory, with optional variables and region settings.
Parameters:
command: Terraform command to execute
working_directory: Directory containing Terraform files
variables: Terraform variables to pass
aws_region: AWS region to use
strip_ansi: Whether to strip ANSI color codes from output
Returns:
A TerraformExecutionResult object containing command output and status
Inputs: command (required), working_directory (required), variables, aws_region, +1 more. Returns: Result model for Terraform command execution. Attributes: command: The Terraforโฆ
ExecuteTerragruntCommandA
Execute Terragrunt workflow commands against an AWS account.
This tool runs Terragrunt commands (init, plan, validate, apply, destroy, run-all) in the
specified working directory, with optional variables and region settings. Terragrunt extends
Terraform's functionality by providing features like remote state management, dependencies
between modules, and the ability to execute Terraform commands on multiple modules at once.
Parameters:
command: Terragrunt command to execute
working_directory: Directory containing Terragrunt files
variables: Terraform variables to pass
aws_region: AWS region to use
strip_ansi: Whether to strip ANSI color codes from output
include_dirs: Directories to include in a multi-module run
exclude_dirs: Directories to exclude from a multi-module run
run_all: Run command on all modules in subdirectories
terragrunt_config: Path to a custom terragrunt config file (not valid with run-all)
Returns:
A TerragruntExecutionResult object containing command output and status
Inputs: command (required), working_directory (required), variables, aws_region, +5 more. Returns: Result model for Terragrunt command execution. Attributes: command: The Terragrโฆ
RunCheckovScanA
Run Checkov security scan on Terraform code.
This tool runs Checkov to scan Terraform code for security and compliance issues,
identifying potential vulnerabilities and misconfigurations according to best practices.
Checkov (https://www.checkov.io/) is an open-source static code analysis tool that
can detect hundreds of security and compliance issues in infrastructure-as-code.
Parameters:
working_directory: Directory containing Terraform files to scan
framework: Framework to scan (default: terraform)
check_ids: Optional list of specific check IDs to run
skip_check_ids: Optional list of check IDs to skip
output_format: Format for scan results (default: json)
Returns:
A CheckovScanResult object containing scan results and identified vulnerabilities
Inputs: working_directory (required), framework, check_ids, skip_check_ids, +1 more. Returns: Result model for Checkov scan execution. Attributes: status: Execution status (โฆ
SearchAwsccProviderDocsA
Search AWSCC provider documentation for resources and attributes.
The AWSCC provider is based on the AWS Cloud Control API
and provides a more consistent interface to AWS resources compared to the standard AWS provider.
This tool searches the Terraform AWSCC provider documentation for information about
a specific asset in the AWSCC Provider Documentation, assets can be either resources or data sources. It retrieves comprehensive details including descriptions, example code snippets, and schema references.
Use the 'asset_type' parameter to specify if you are looking for information about provider resources, data sources, or both. Valid values are 'resource', 'data_source' or 'both'.
The tool will automatically handle prefixes - you can search for either 'awscc_s3_bucket' or 's3_bucket'.
Examples:
- To get documentation for an S3 bucket resource:
search_awscc_provider_docs(asset_name='awscc_s3_bucket')
search_awscc_provider_docs(asset_name='awscc_s3_bucket', asset_type='resource')
- To search only for data sources:
search_aws_provider_docs(asset_name='awscc_appsync_api', kind='data_source')
- To search for both resource and data source documentation of a given name:
search_aws_provider_docs(asset_name='awscc_appsync_api', kind='both')
- Search of a resource without the prefix:
search_awscc_provider_docs(resource_type='ec2_instance')
Parameters:
asset_name: Name of the AWSCC Provider resource or data source to look for (e.g., 'awscc_s3_bucket', 'awscc_lambda_function')
asset_type: Type of documentation to search - 'resource' (default), 'data_source', or 'both'. Some resources and data sources share the same name
Returns:
A list of matching documentation entries with details including:
- Resource name and description
- URL to the official documentation
- Example code snippets
- Schema information (required, optional, read-only, and nested structures attributes)
Inputs: asset_name (required), asset_type. Returns: result
SearchAwsProviderDocsA
Search AWS provider documentation for resources and attributes.
This tool searches the Terraform AWS provider documentation for information about
a specific asset in the AWS Provider Documentation, assets can be either resources or data sources. It retrieves comprehensive details including descriptions, example code snippets, argument references, and attribute references.
Use the 'asset_type' parameter to specify if you are looking for information about provider resources, data sources, or both. Valid values are 'resource', 'data_source' or 'both'.
The tool will automatically handle prefixes - you can search for either 'aws_s3_bucket' or 's3_bucket'.
Examples:
- To get documentation for an S3 bucket resource:
search_aws_provider_docs(asset_name='aws_s3_bucket')
- To search only for data sources:
search_aws_provider_docs(asset_name='aws_ami', asset_type='data_source')
- To search for both resource and data source documentation of a given name:
search_aws_provider_docs(asset_name='aws_instance', asset_type='both')
Parameters:
asset_name: Name of the service (asset) to look for (e.g., 'aws_s3_bucket', 'aws_lambda_function')
asset_type: Type of documentation to search - 'resource' (default), 'data_source', or 'both'
Returns:
A list of matching documentation entries with details including:
- Resource name and description
- URL to the official documentation
- Example code snippets
- Arguments with descriptions
- Attributes with descriptions
Inputs: asset_name (required), asset_type. Returns: result
SearchSpecificAwsIaModulesA
Search for specific AWS-IA Terraform modules.
This tool checks for information about four specific AWS-IA modules:
- aws-ia/bedrock/aws - Amazon Bedrock module for generative AI applications
- aws-ia/opensearch-serverless/aws - OpenSearch Serverless collection for vector search
- aws-ia/sagemaker-endpoint/aws - SageMaker endpoint deployment module
- aws-ia/serverless-streamlit-app/aws - Serverless Streamlit application deployment
It returns detailed information about these modules, including their README content,
variables.tf content, and submodules when available.
The search is performed across module names, descriptions, README content, and variable
definitions. This allows you to find modules based on their functionality or specific
configuration options.
Examples:
- To get information about all four modules:
search_specific_aws_ia_modules()
- To find modules related to Bedrock:
search_specific_aws_ia_modules(query='bedrock')
- To find modules related to vector search:
search_specific_aws_ia_modules(query='vector search')
- To find modules with specific configuration options:
search_specific_aws_ia_modules(query='endpoint_name')
Parameters:
query: Optional search term to filter modules (empty returns all four modules)
Returns:
A list of matching modules with their details, including:
- Basic module information (name, namespace, version)
- Module documentation (README content)
- Input and output parameter counts
- Variables from variables.tf with descriptions and default values
- Submodules information
- Version details and release information
Inputs: query (required). Returns: result
SearchUserProvidedModuleA
Search for a user-provided Terraform registry module and understand its inputs, outputs, and usage.
This tool takes a Terraform registry module URL and analyzes its input variables,
output variables, README, and other details to provide comprehensive information
about the module.
The module URL should be in the format "namespace/name/provider" (e.g., "hashicorp/consul/aws")
or "registry.terraform.io/namespace/name/provider".
Examples:
- To search for the HashiCorp Consul module:
search_user_provided_module(module_url='hashicorp/consul/aws')
- To search for a specific version of a module:
search_user_provided_module(module_url='terraform-aws-modules/vpc/aws', version='3.14.0')
- To search for a module with specific variables:
search_user_provided_module(
module_url='terraform-aws-modules/eks/aws',
variables={'cluster_name': 'my-cluster', 'vpc_id': 'vpc-12345'}
)
Parameters:
module_url: URL or identifier of the Terraform module (e.g., "hashicorp/consul/aws")
version: Optional specific version of the module to analyze
variables: Optional dictionary of variables to use when analyzing the module
Returns:
A SearchUserProvidedModuleResult object containing module information
Inputs: module_url (required), version, variables. Returns: Result model for searching user-provided Terraform modules. Attributes: status:โฆ
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 7 tools
Most tools have distinct purposes: Terraform/Terragrunt execution, Checkov scanning, and three types of documentation/module searches. However, there is some overlap between ExecuteTerraformCommand and ExecuteTerragruntCommand, as both handle similar infrastructure-as-code workflows with identical core commands, which could cause confusion if an agent doesn't understand the Terragrunt extension. The three search tools are well-differentiated by their targets (AWSCC docs, AWS docs, specific modules, user-provided modules).
Tool names follow a consistent PascalCase pattern (e.g., ExecuteTerraformCommand, RunCheckovScan, SearchAwsccProviderDocs), which is predictable and readable. The only minor deviation is that some names start with verbs like 'Execute' or 'Run', while others start with 'Search', but this aligns with their functional groups (execution vs. search), maintaining overall consistency.
With 7 tools, the count is well-scoped for an AWS Terraform server, covering execution, security scanning, and documentation/module searches. Each tool earns its place by addressing a specific aspect of Terraform workflows in AWS, without being overly sparse or bloated, making it manageable for agents to navigate.
The tool set provides good coverage for Terraform operations in AWS, including execution (Terraform/Terragrunt), security (Checkov), and documentation/search capabilities. Minor gaps exist, such as no direct tools for managing Terraform state (e.g., state locking, migration) or handling provider configurations, but core workflows are supported, and agents can likely work around these with the available tools.
Related MCP Connectors
The AWS Knowledge MCP server is a fully managed remote Model Context Protocol server that provides real-time access to official AWS content in an LLM-compatible format. It offers structured access to AWS documentation, code samples, blog posts, What's New announcements, Well-Architected best practices, and regional availability information for AWS APIs and CloudFormation resources. Key capabilities include searching and reading documentation in markdown format, getting content recommendations, listing AWS regions, and checking regional availability for services and features.
Devopness MCP server for DevOps happiness! Empower AI Agents to deploy apps and infra, to any cloud.
The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoโฆ
Related MCP Servers
- AlicenseCqualityDmaintenanceA Model Context Protocol server allowing Claude AI to interact with AWS resources through natural language, enabling users to query and manage AWS services without using the traditional AWS Console or CLI.36ISC
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables managing Terrakube infrastructure through natural language, handling workspace management, variables, modules, and organization operations.1620 npm3Apache 2.0

LocalStack MCP Serverofficial
AlicenseAqualityBmaintenanceA Model Context Protocol (MCP) server for LocalStack that enables management of local AWS development environments, including container lifecycle operations, infrastructure deployments, log analysis with IAM policy generation, chaos injection, and Cloud Pods state management.7265 npm29Apache 2.0- AlicenseNot gradedqualityDmaintenanceA secure, containerized MCP server that enables AI assistants to manage Terraform infrastructure using integrated Language Server Protocol (LSP) tools. It facilitates safe operations like initialization, validation, and planning while providing context-aware code completion and documentation.10MIT