Terraform Assistant

Terraform Assistant

An advisory and generative copilot for Terraform that reviews existing scripts and generates compliant infrastructure using organization-specific rules.

Category
Visit Server

README

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
    

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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured