Terrakube MCP server

Provides a bridge to Terrakube infrastructure for managing workspaces, variables, modules, and organization resources through natural language interaction
Back to servers
Setup instructions
Provider
AzBuilder
Release date
Mar 25, 2025
Language
TypeScript
Stats
2 stars

The Terrakube MCP Server provides an interface to manage Terrakube resources via the Model Context Protocol, allowing you to perform operations like workspace management, variable handling, module operations, and organization management directly from applications that support MCP.

Installation

Environment Setup

First, create a .env file in your root directory with your Terrakube credentials:

TERRAKUBE_API_URL=<your-terrakube-api-url>
TERRAKUBE_PAT_TOKEN=<your-personal-access-token>

Installing via Smithery

The easiest way to install Terrakube MCP Server for Claude Desktop is via Smithery:

npx -y @smithery/cli install @AzBuilder/mcp-server-terrakube --client claude

Manual Configuration for Claude Desktop

To manually configure Claude Desktop to use this server, add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "terrakube": {
      "command": "npx",
      "args": [
        "-y",
        "@terrakube/mcp-server"
      ],
      "env": {
        "TERRAKUBE_API_URL": "<YOUR_API_URL>",
        "TERRAKUBE_PAT_TOKEN": "<YOUR_PAT_TOKEN>"
      }
    }
  }
}

Usage

Working with Organizations

List Organizations

const organizations = await terrakube.listOrganizations();

Create an Organization

const newOrg = await terrakube.createOrganization({
  name: "my-organization",
  description: "My organization description"
});

Get Organization Details

const orgDetails = await terrakube.getOrganization({
  name: "my-organization"
});

Update an Organization

const updatedOrg = await terrakube.updateOrganization({
  name: "my-organization",
  description: "Updated organization description"
});

Delete an Organization

const result = await terrakube.deleteOrganization({
  name: "my-organization"
});

Managing Workspaces

List Workspaces

const workspaces = await terrakube.listWorkspaces({
  organization: "my-organization"
});

Create a Workspace

const newWorkspace = await terrakube.createWorkspace({
  name: "my-workspace",
  organization: "my-organization",
  description: "My workspace description",
  vcsProviderId: "github",
  vcsRepository: "owner/repo",
  vcsBranch: "main"
});

Get Workspace Details

const workspaceDetails = await terrakube.getWorkspace({
  name: "my-workspace",
  organization: "my-organization"
});

Update a Workspace

const updatedWorkspace = await terrakube.updateWorkspace({
  name: "my-workspace",
  organization: "my-organization",
  description: "Updated workspace description",
  vcsBranch: "develop"
});

Delete a Workspace

const result = await terrakube.deleteWorkspace({
  name: "my-workspace",
  organization: "my-organization"
});

Managing Variables

List Variables

const variables = await terrakube.listVariables({
  organization: "my-organization",
  workspace: "my-workspace"
});

Create a Variable

const newVariable = await terrakube.createVariable({
  name: "my-variable",
  organization: "my-organization",
  workspace: "my-workspace",
  value: "variable-value",
  description: "Variable description",
  category: "terraform",
  hcl: false,
  sensitive: false
});

Get Variable Details

const variableDetails = await terrakube.getVariable({
  name: "my-variable",
  organization: "my-organization",
  workspace: "my-workspace"
});

Update a Variable

const updatedVariable = await terrakube.updateVariable({
  name: "my-variable",
  organization: "my-organization",
  workspace: "my-workspace",
  value: "new-value",
  sensitive: true
});

Delete a Variable

const result = await terrakube.deleteVariable({
  name: "my-variable",
  organization: "my-organization",
  workspace: "my-workspace"
});

Working with Modules

List Modules

const modules = await terrakube.listModules({
  organization: "my-organization"
});

Create a Module

const newModule = await terrakube.createModule({
  name: "my-module",
  organization: "my-organization",
  provider: "aws",
  description: "My module description"
});

Get Module Details

const moduleDetails = await terrakube.getModule({
  name: "my-module",
  organization: "my-organization",
  provider: "aws"
});

Update a Module

const updatedModule = await terrakube.updateModule({
  name: "my-module",
  organization: "my-organization",
  provider: "aws",
  description: "Updated module description"
});

Delete a Module

const result = await terrakube.deleteModule({
  name: "my-module",
  organization: "my-organization",
  provider: "aws"
});

Feature Summary

Workspaces Management

  • Create, update, delete, and query workspaces
  • Connect workspaces to VCS repositories

Variables Handling

  • Create and manage Terraform and environment variables
  • Support for sensitive variables and HCL format

Modules Operations

  • Register and manage Terraform modules
  • Organize modules by provider

Organizations Management

  • Create and manage organizational structures
  • Organize resources within organizations

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "terrakube" '{"command":"npx","args":["-y","@terrakube/mcp-server"],"env":{"TERRAKUBE_API_URL":"<YOUR_API_URL>","TERRAKUBE_PAT_TOKEN":"<YOUR_PAT_TOKEN>"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

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.

Adding an MCP server to Cursor globally

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": {
        "terrakube": {
            "command": "npx",
            "args": [
                "-y",
                "@terrakube/mcp-server"
            ],
            "env": {
                "TERRAKUBE_API_URL": "<YOUR_API_URL>",
                "TERRAKUBE_PAT_TOKEN": "<YOUR_PAT_TOKEN>"
            }
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "terrakube": {
            "command": "npx",
            "args": [
                "-y",
                "@terrakube/mcp-server"
            ],
            "env": {
                "TERRAKUBE_API_URL": "<YOUR_API_URL>",
                "TERRAKUBE_PAT_TOKEN": "<YOUR_PAT_TOKEN>"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later