HCP Terraform MCP server for AI agents

Live

BEARER TOKEN

INFRASTRUCTURE

Developer Tools

HCP Terraform gives your agent your infrastructure workspaces: list organizations, projects, and workspaces, inspect runs, plans, and state, and queue, apply, cancel, or discard runs.

  • Per-user credentials: each call uses the actual user's access token, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
HCP Terraform
agent · Acme Q3
Run
Show the latest runs for the prod-network workspace.
S
terraform_runs_list
289ms
Infrastructure agent
Listed the runs for the workspace, newest first. The latest run is planned and waiting for confirmation.
Sources: HCP Terraform workspace
terraform
1 workspace
18:29
Message Claude...

Tools your infrastructure agent reaches for on HCP Terraform, scoped per user.

CALL ANY TOOL
30 tools for infrastructure in HCP Terraform: list organizations, projects, and workspaces, inspect runs, plans, and state versions, queue and apply runs, and lock workspaces.
terraform_organization_get
Get organization
Get one HCP Terraform organization by name. Returns its settings: email, default execution mode, collaborator auth policy, cost estimation, session settings and the token's permissions on it. Use terraform_organization_get for a known name. Use terraform_organizations_list to find names.
Parameters
Name
Type
Required
Description
organization_name
string
Required
The organization name (not ID), as shown in the HCP Terraform URL app.terraform.io/app/<organization>. Use terraform_organizations_list to find it. Example: my-org
terraform_organization_runs_list
List organization runs
terraform_organizations_list
List organizations
terraform_plan_get
Get plan
terraform_project_create
Create project
terraform_project_get
Get project
terraform_projects_list
List projects
terraform_run_apply
Apply run
terraform_run_cancel
Cancel run
terraform_run_create
Create run
terraform_run_discard
Run discard
terraform_run_get
Get run
terraform_runs_list
List runs
terraform_state_versions_list
List state versions
terraform_teams_list
List teams
terraform_variable_sets_list
List variable sets
terraform_workspace_create
Create workspace
terraform_workspace_current_state_outputs_list
List workspace current state outputs
terraform_workspace_current_state_version_get
Get workspace current state version
terraform_workspace_get
Get workspace
terraform_workspace_get_by_name
Workspace get by name
terraform_workspace_lock
Workspace lock
terraform_workspace_safe_delete
Delete workspace safe
terraform_workspace_unlock
Workspace unlock
terraform_workspace_update
Update workspace
terraform_workspace_variable_create
Create workspace variable
terraform_workspace_variable_delete
Delete workspace variable
terraform_workspace_variable_update
Update workspace variable
terraform_workspace_variables_list
List workspace variables
terraform_workspaces_list
List workspaces
Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// HCP Terraform tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["terraform"], toolNames: [
    "terraform_workspaces_list",
    "terraform_runs_list",
    "terraform_run_create"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "List the production workspaces, check their latest runs, and queue a new run for prod-network" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["terraform"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "List the production workspaces, check their latest runs, and queue a new run for prod-network" }],
  tools,
});

// Execute the tool call with the user's vaulted HCP Terraform access token
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["terraform"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "List the production workspaces, check their latest runs, and queue a new run for prod-network" }],
  tools,
});

// Tool call runs with the user's vaulted HCP Terraform access token
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["terraform"] }, pageSize: 100,
});

const agent = new Agent({
  name: "infrastructure_agent",
  model: "gemini-2.5-pro",
  instruction: "HCP Terraform tools scoped to this user",
  tools,
});

await agent.run("List the production workspaces, check their latest runs, and queue a new run for prod-network");
Try these prompts
Copy any prompt into your agent. Each maps directly to a HCP Terraform tool. Click to copy, paste into your agent, done.
Runs
Copy the prompt
Copied
List the latest runs in the prod-network workspace.
Copy the prompt
Copied
Show the plan for this run with its resource changes.
Copy the prompt
Copied
Apply the run that is waiting for confirmation.
Workspaces
Copy the prompt
Copied
List the workspaces in my organization tagged production.
Copy the prompt
Copied
Lock this workspace while I investigate.
Copy the prompt
Copied
List the variables set on this workspace.
State and teams
Copy the prompt
Copied
Show the current state outputs of this workspace.
Copy the prompt
Copied
List the state versions of this workspace.
Copy the prompt
Copied
Which teams are in my organization?
SEE HOW AUTH WORKS
Each user connects their own HCP Terraform access token once, and Scalekit sends it with every call. Access tokens stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
HCP Terraform
once. We tie it to their identity and the access they approved, with no shared bot account and no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
HCP Terraform
credential lives in a vault scoped to them. User A's data is never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tenants:
isolated
3
Resolve
When your agent calls a
HCP Terraform
tool, we fetch the right credential server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
HCP Terraform
tool call is logged: who triggered it, which tool ran, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other developer tools and automation connectors.
Engineering Teams
DevOps assistant agent
Polls GitHub for failing checks and stale PRs, opens Linear issues for the ones that need work, and posts a daily digest to Slack. It acts as the engineer, not a shared service account.
Engineering Teams
Engineering standup agent
Pulls commits from GitHub and GitLab, tracks issue movement in Jira, and posts a per-engineer standup brief to Slack. Each engineer's activity is read on their own delegated OAuth.
Test other agents
See the same per-user auth pattern across other developer tools and automation connectors.
ENGINEERING
DevOps assistant agent
Poll GitHub for failing checks and stale pull requests, open Linear issues for the ones that need work, and digest to Slack.
ENGINEERING
Engineering standup agent
Pull commits from GitHub and GitLab, track Jira issue movement, and post a per-engineer standup brief to Slack.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared HCP Terraform access token looks fine in a demo. In production every run looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared token
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
HCP Terraform today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access HCP Terraform as the user or through a shared access token?
As the user. Each user connects their own HCP Terraform access token once, and Scalekit sends it with every call. Audit logs attribute every run and workspace change to that user, not a shared service account.
Where is the HCP Terraform access token stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. To rotate it, the user reconnects with a new access token. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in HCP Terraform?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example the list and get tools without terraform_run_apply, which confirms and applies a run, and terraform_workspace_safe_delete, which deletes a workspace that manages no resources. 2 of the 30 tools are destructive. Scalekit also enforces scope checks before every API call.
What happens when a user revokes HCP Terraform access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
Which HCP Terraform organizations can the agent reach?
The organizations the user's access token can access. terraform_organizations_list returns them, and terraform_workspaces_list lists the workspaces inside one.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""terraform"": {
""url"": ""https://mcp.scalekit.com/terraform"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.terraform]
url = ""https://mcp.scalekit.com/terraform""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""terraform"": {
""url"": ""https://mcp.scalekit.com/terraform"",
""type"": ""http""
}
}
}