Skip to main content
Glama
teomanS
by teomanS

Terraform Assistant MCP Server

This is a Model Context Protocol (MCP) server built in Python that acts as an advisory co-pilot for reviewing existing Terraform scripts, and a generative co-pilot for writing new, compliant Terraform infrastructure. It enforces organization-specific rules via localized configuration files (standards.md & endpoints_lookup.md).

Setup Instructions

  1. Initialize the Python Environment: Navigate to the root directory where this README.md is located and create a virtual environment, then install the dependencies:

    Mac / Linux:

    python3 -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt

    Windows:

    python -m venv .venv
    .\.venv\Scripts\activate
    pip install -r requirements.txt

Related MCP server: MCP CloudOps IaC Rules Server

How to Use in VS Code

This server does not have its own custom UI. Instead, it plugs seamlessly into popular AI extensions for VS Code that support the Model Context Protocol, such as Cline or Roo Code.

1. Install an MCP-compatible VS Code Extension

Install the Roo Code or Cline extension in VS Code.

2. Configure the MCP Server

Open the MCP configuration file for your chosen extension. For Roo Code or Cline, click on the MCP Servers icon (the plug icon) in the extension's sidebar to edit the cline_mcp_settings.json file.

Add the following configuration block:

Mac / Linux Example:

{
  "mcpServers": {
    "terraform-assistant": {
      "command": "/home/teosevinc/workspaces/terraform-assistant/.venv/bin/python3",
      "args": [
        "src/server.py"
      ],
      "cwd": "/home/teosevinc/workspaces/terraform-assistant",
      "env": {
        "PYTHONPATH": "src"
      }
    }
  }
}

Windows Example:

{
  "mcpServers": {
    "terraform-assistant": {
      "command": "C:\\path\\to\\your\\terraform-assistant\\.venv\\Scripts\\python.exe",
      "args": [
        "src\\server.py"
      ],
      "cwd": "C:\\path\\to\\your\\terraform-assistant",
      "env": {
        "PYTHONPATH": "src"
      }
    }
  }
}

(By pointing the command directly to the .venv/bin/python3 or .venv\Scripts\python.exe that you created in Step 1, the extension will run the MCP server with all the correct dependencies regardless of what workspace you have active!)

3. Usage inside VS Code

  1. Open the Chat inside your AI extension.

  2. Make sure you have your API key set up for your LLM (like Azure OpenAI) within the extension's settings.

  3. The AI will now instantly have access to tools like read_standards, read_lookup, and read_terraform_file.

  4. Try asking it prompts like:

    • "Review my existing main.tf file and tell me if it violates anything in our standards."

    • "Generate a new PostgreSQL server resource and apply all relevant compliance checks from the endpoints lookup."

Architecture Restrictions

  • Advisory Mode: For evaluating existing .tf files, the assistant will read them locally and advise you on fixes, but it will never automatically overwrite your existing code.

  • Generative Mode: For creating new .tf files, the assistant will author the appropriate resources from scratch ensuring 100% compliance with the rules without you needing to do it manually.

Configuration & Authentication Notes

You do not need to configure Bitbucket or Azure OpenAI secrets anywhere in this server code!

  1. Bitbucket API Keys: Because of our Scenario A architectural decision, the MCP server operates natively against the local filesystem clone on the developer's laptop rather than fetching from the remote Bitbucket API. This ensures the AI evaluates your local, uncommitted code changes in real-time as you type them in VS Code.

  2. Azure OpenAI API Keys: The MCP server itself does not securely generate responses or talk to LLMs. The VS Code extension (e.g., Cline or Roo Code) acts as the client that communicates with Azure OpenAI. You will input your Azure API key and Endpoint URL directly into your VS Code extension's LLM API settings menu.

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Threat modeling, code/cloud/pipeline scanning, shadow-AI discovery, compliance checks and fixes.

  • Screens public GitHub repos and PRs to generate risk maps, findings, and merge-readiness signals.

  • Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/teomanS/terraform-assistant'

If you have feedback or need assistance with the MCP directory API, please join our Discord server