Terry-Form MCP is a bridge between AI language models and Terraform infrastructure management, providing a secure, containerized environment for executing Terraform commands. It now features Language Server Protocol (LSP) integration for intelligent code completion, validation, and documentation.
# Build using the provided script (Linux/macOS)
./build.sh
# Or for Windows users
build.bat
# Alternatively, build directly with Docker
docker build -t terry-form-mcp .
# Run as MCP server
docker run -it --rm \
-v "$(pwd)":/mnt/workspace \
terry-form-mcp
Most IDEs that support MCP will have a configuration file or UI:
{
"mcpServers": {
"terry": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "/path/to/your/workspace:/mnt/workspace",
"terry-form-mcp"
]
}
}
}
{
"mcpServers": {
"terry": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "C:\\Users\\YourUsername\\terraform-projects:/mnt/workspace",
"terry-form-mcp"
]
}
}
}
{
"mcpServers": {
"terry": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "/Users/YourUsername/terraform-projects:/mnt/workspace",
"terry-form-mcp"
]
}
}
}
{
"mcpServers": {
"terry": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "/home/YourUsername/terraform-projects:/mnt/workspace",
"terry-form-mcp"
]
}
}
}
Execute Terraform commands in a containerized environment:
// Initialize and validate a Terraform project
terry(
path="infrastructure/aws",
actions=["init", "validate"]
)
// Plan with variables
terry(
path="environments/production",
actions=["plan"],
vars={
"instance_count": "3",
"environment": "prod",
"region": "us-east-1"
}
)
Get intelligent code assistance with LSP:
// Initialize LSP client for a workspace
terry_lsp_init(
workspace_path="modules/vpc"
)
// Get documentation for a resource
terraform_hover(
file_path="modules/vpc/main.tf",
line=15,
character=12
)
// Get code completion suggestions
terraform_complete(
file_path="modules/vpc/variables.tf",
line=8,
character=0
)
// Validate a file with detailed diagnostics
terraform_validate_lsp(
file_path="modules/vpc/outputs.tf"
)
// Format a file
terraform_format_lsp(
file_path="modules/vpc/main.tf"
)
// Check environment readiness
terry_environment_check()
// Create a new Terraform workspace
terry_workspace_setup(
path="new-project",
project_name="aws-vpc-module"
)
// Analyze workspace structure
terry_workspace_info(
path="existing-project"
)
// Check specific file
terry_file_check(
file_path="existing-project/main.tf"
)
// Step 1: Create a workspace
terry_workspace_setup(path="new-aws-project", project_name="aws-infra")
// Step 2: Check workspace structure
terry_workspace_info(path="new-aws-project")
// Step 3: Initialize Terraform
terry(path="new-aws-project", actions=["init"])
// Step 4: Initialize LSP
terry_lsp_init(workspace_path="new-aws-project")
// Step 5: Get code completion as you develop
terraform_complete(file_path="new-aws-project/main.tf", line=10, character=0)
// Step 6: Format the file
terraform_format_lsp(file_path="new-aws-project/main.tf")
// Step 7: Validate with detailed diagnostics
terraform_validate_lsp(file_path="new-aws-project/main.tf")
// Step 8: Plan the infrastructure
terry(path="new-aws-project", actions=["plan"])
LSP Not Initializing
terry_environment_check()
terry_lsp_init(workspace_path="your-project")
Docker Mount Issues
LSP Features Not Working
terraform_lsp_status()
Enable verbose output for troubleshooting:
docker run -it --rm \
-v "$(pwd)":/mnt/workspace \
-e TF_LOG=DEBUG \
-e PYTHONUNBUFFERED=1 \
terry-form-mcp
/mnt/workspace
mount pointapply
or destroy
commandsTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "terry" '{"command":"docker","args":["run","-i","--rm","-v","${workspaceFolder}:/mnt/workspace","terry-form-mcp"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"terry": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"${workspaceFolder}:/mnt/workspace",
"terry-form-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"terry": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"${workspaceFolder}:/mnt/workspace",
"terry-form-mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect