- Home
- MCP servers
- Terragrunt GCP
Terragrunt GCP
- python
1
GitHub Stars
python
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"spolspol-terragrunt-gcp-tool-mcp": {
"command": "python3",
"args": [
"-m",
"terragrunt_gcp_mcp.server"
]
}
}
}You run an MCP server that enables automated management of Terragrunt-based Google Cloud Platform infrastructure. It exposes a programmable interface for deploying, validating, visualizing, and monitoring resources, with optional AutoDevOps integration and experimental Terragrunt features to speed up and safeguard your deployments.
How to use
You connect an MCP client to the server using standard input/output (stdio) endpoints. From there you can validate configurations, generate deployment plans, apply changes, visualize infrastructure trees, manage stacks, and monitor costs. The server supports a mix of experimental features, resource lifecycle commands, deployment workflows, and AutoDevOps prompts to help you automate complex cloud operations. Start by choosing a command flow that fits your workflow: validate → plan → deploy, visualize infrastructure before changing anything, and use dry-run or auto-approve options as appropriate.
How to install
Prerequisites: You need Python 3 and pip installed on your system. Optional: a virtual environment can help isolate dependencies.
Install steps to set up the MCP server and run it for development or local testing.
# Prerequisites
# Ensure Python 3 is installed
python3 --version
pip --version
# Optional: create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate # on Unix/macOS
# .venv\Scripts\activate # on Windows
# Clone the project (replace with the actual repository URL when you have it)
# git clone <repository-url>
# cd terragrunt-gcp-tool-mcp
# Install dependencies
pip install -r requirements.txt
# Or install in development mode
pip install -e .
# Configure the MCP server (example)
cp config/config.example.yaml config/config.yaml
# Edit config.yaml with your settings
# Start the MCP server (one of several options shown below)
# 1) Start with the default config
python3 run_server.py
# 2) Start with a custom config file
python3 run_server.py config/config.yaml
# 3) Start via the module interface
python3 -m terragrunt_gcp_mcp.server
# With a custom config
python3 -m terragrunt_gcp_mcp.server config/config.yaml
# 4) Use the CLI entry to start the server
python3 -m terragrunt_gcp_mcp.cli init
python3 -m terragrunt_gcp_mcp.cli server
# Optional: Claude Desktop integration example (endpoint config)
# This is an integration example; you would adapt paths to your setup
"}]} ,{
Configuration and usage notes
Configuration details are defined to support Terragrunt GCP automation, including GCP access, Terragrunt settings, and optional monitoring and Slack integration. The configuration enables experimental features like stacks, enhanced dependency resolution, and parallel execution, along with stack outputs and timeout controls.
# Example YAML configuration blocks shown in practice
# GCP Configuration
gcp:
project_id: "your-project-id"
credentials_path: "/path/to/credentials.json"
default_region: "europe-west2"
# Terragrunt Configuration
terragrunt:
root_path: "/path/to/terragrunt-gcp-org-automation"
binary_path: "terragrunt"
terraform_binary: "tofu"
# Experimental features configuration
experimental:
stacks_enabled: true
enhanced_dependency_resolution: true
parallel_execution: true
stack_outputs: true
recursive_stacks: false
# Stack execution settings
max_parallel_units: 10
stack_timeout: 7200
continue_on_error: false
# Slack Configuration (optional)
slack:
webhook_url: "https://hooks.slack.com/..."
default_channel: "#infrastructure"
# Monitoring Configuration
monitoring:
enabled: true
check_interval: 300
"}]},{
Security
The server supports multiple GCP authentication methods, validates permissions before operations, and logs all actions for audit purposes. Dry-run mode is available to test changes safely before applying them.
Examples
Below are representative workflows you can perform with the MCP server. Use the appropriate commands for your environment and preferred workflow.
Notes and troubleshooting
If you encounter issues starting the server, ensure Python 3 and pip are installed, dependencies are installed, and the configuration file path is correct. Check for any required environment variables in your deployment environment and ensure network access to any external services your setup uses.
Available tools
list_stacks
List all Terragrunt stacks using experimental features.
get_stack_details
Get detailed information about a specific stack including units and execution order.
execute_stack_command
Execute commands on stacks with parallel execution and dependency management.
get_stack_outputs
Get aggregated outputs from stack-level operations.
get_enhanced_infrastructure_status
Get comprehensive status including both traditional resources and stacks.
list_resources
List all resources in the infrastructure.
get_resource_details
Get comprehensive information about a specific resource including attributes, state, and configuration.
validate_resource_config
Validate a Terragrunt resource configuration with dependency checking.
create_resource
Create a new infrastructure resource.
update_resource
Update an existing resource configuration.
delete_resource
Delete a resource with dependency checking.
draw_resource_tree
Draw a visual resource tree using Terragrunt CLI redesign commands.
get_dependency_graph
Generate dependency graphs in DOT, Mermaid, or JSON format.
visualize_infrastructure
Comprehensive infrastructure visualization combining trees and graphs.
get_autodevops_system_prompt
Get system prompts for creating AutoDevOps assistants for automation.
cost_analysis
Comprehensive cost analysis with forecasting and optimization recommendations.
cost_alerts
Cost alerts based on budget thresholds and spending patterns.
cost_optimization_score
Infrastructure cost optimization scoring and recommendations.
cost_status
Complete cost status dashboard with analysis, alerts, and optimization insights.
plan_deployment
Generate a deployment plan for changes (deprecated; use plan_resource_deployment).
plan_resource_deployment
Generate a comprehensive deployment plan for a Terragrunt resource.
deploy_resources
Deploy infrastructure changes (deprecated; use apply_resource_deployment).
apply_resource_deployment
Apply changes to a Terragrunt resource with safety checks.
check_deployment_status
Check the status of ongoing deployments.
rollback_deployment
Rollback a failed deployment.
get_infrastructure_status
Get overall infrastructure health.
analyze_dependencies
Analyze resource dependencies.
check_drift
Detect configuration drift.
send_slack_notification
Send notifications to team via Slack.
create_deployment_summary
Generate deployment reports.
get_audit_log
Retrieve audit logs.