Provider REST API
InfrastructureConnect Claude to HCP Terraform
Read workspaces, runs, plans, state outputs, variables, and projects. Toolspoke puts 11 of its actions behind one MCP endpoint that Claude, Cursor, and Codex all speak.
- Connection
- Provider REST API
- Authentication
- API token
- Actions exposed
- 11
- Cost per call (typical)
- 1 credit
- Adapter
- Maintained by Toolspoke
Connected in three steps
- 1
Install HCP Terraform
Open the marketplace in your workspace, add HCP Terraform to the project your agents work in, and it appears on the gateway immediately.
- 2
Connect the credential
Authenticate with api token. Where to get one, and what it has to be able to reach, is the next section.
- 3
Point your agent at the gateway
Give your client one address, https://toolspoke.com/mcp. Claude Code takes it as a command, Claude and Claude Desktop add it as a custom connector, and Cursor, Codex and VS Code each read it from a config file of their own.
.mcp.json{
"mcpServers": {
"toolspoke": {
"type": "http",
"url": "https://toolspoke.com/mcp"
}
}
}One block covers every tool you have installed. HCP Terraform shows up in the client as soon as your policy allows it, and so does everything else you install later.
Where the address goes, per client
- Claude Code
Run it in your project, then /mcp to sign in
claude mcp add --transport http toolspoke https://toolspoke.com/mcp- Claude and Claude Desktop
Settings, then Connectors, then Add custom connector
https://toolspoke.com/mcp- Cursor
~/.cursor/mcp.json, or .cursor/mcp.json for one project
{ "mcpServers": { "toolspoke": { "url": "https://toolspoke.com/mcp" } } }- Codex
~/.codex/config.toml
[mcp_servers.toolspoke] url = "https://toolspoke.com/mcp"- VS Code
.vscode/mcp.json, or the MCP: Add Server command
{ "servers": { "toolspoke": { "type": "http", "url": "https://toolspoke.com/mcp" } } }
What HCP Terraform asks for
API token. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.
- API tokenRequired
- User Settings → Tokens → Create an API token, or a team token from the organization's Team settings. A user or team token is the better fit here: HashiCorp documents that an organization token cannot read a plan's JSON output at all, so get_plan_json_output will fail for one even though every other read works.
- Paste the token value
- Default organization nameOptional
- Used whenever an action is called without an explicit organization. This is the name in the URL bar (app.terraform.io/app/<name>), not the display name. Leave it blank to require one on every call; list_organizations shows what this token can see.
- my-org
What Claude can do in HCP Terraform
11 actions, each one declared and named by the connector rather than discovered at runtime. A workspace policy grants a person all of them, a hand-picked selection, everything on the read side, everything on the write side, or none.
- Reads
- 11Reads
- Writes
- 0Writes
- Destructive
- 0Destructive
Reads
11Fetches data and changes nothing.
list_organizationsList the organizations this token can see, with each one's name and settings. Call it first when you do not know which organization to act on, and to find out whether the connection reaches anything at all - an empty list means the token is valid but is a member of nothing. The `name` returned here is what every organization argument below takes.
list_workspacesList an organization's workspaces with each one's name, Terraform version, execution mode, current run status and id. Call it to get the workspace id (ws-…) that get_workspace, list_runs, list_variables and get_current_state_outputs all take.
get_workspaceFetch one workspace by id, including its execution mode, Terraform version, auto-apply setting, VCS repository, working directory, lock state, and the id of its current run. Read auto-apply before trusting anything about how a run in this workspace behaves - a workspace with auto-apply on applies a successful plan without a person approving it.
list_runsList a workspace's runs, newest first, with each run's status, message, source, and the ids of its plan and apply. This is the operation that answers "what happened in this workspace lately" and "why is it stuck".
get_runFetch one run by id - its status, the timestamps of every status it passed through, who queued it, and its permissions block. Pass include to pull the related plan, apply or configuration version back in the same response instead of making a second call.
get_planFetch one plan by id - its status, whether it has changes, and the counts of resources it would add, change and destroy. This is the cheap summary; get_plan_json_output is the full machine-readable plan. HashiCorp documents no endpoint that lists plans, so the id comes from a run: call get_run with include ["plan"], or read the run's relationships.
get_plan_json_outputFetch the full machine-readable JSON execution plan - every resource change with its before and after attribute values. Use it to answer exactly what a run would do before a person approves it. Three things to expect. The endpoint answers 307 and the real content comes from a short-lived download URL, so the payload is the plan itself rather than a JSON:API envelope. It answers 204 when the plan has not finished yet, and 422 when the workspace runs a Terraform older than 0.12. And HashiCorp documents that an organization token cannot call it at all - use a user or team token with admin access to the workspace. The response is not written to the audit log: a plan carries the resolved values of the resources it touches.
list_state_versionsList a workspace's state versions, newest first, with each one's serial number, creation time, and the run that produced it. Use it to see how often state has changed and which run last wrote it. Both the workspace name and the organization name are required by the API - this endpoint is filtered rather than nested.
get_current_state_outputsRead the outputs of a workspace's current state - each output's name, type and value. This is the workspace-scoped outputs endpoint on purpose: HashiCorp documents that it returns null for any output marked sensitive, while the state-version-output endpoints return the real value. This connector exposes only the redacting one, and does not expose the raw state download at all. Treat what does come back as sensitive anyway: an output is only masked if whoever wrote the Terraform remembered to mark it, and outputs routinely carry endpoints, ARNs and connection strings. The response is not written to the audit log for that reason.
list_variablesList a workspace's own variables - key, category ("terraform" or "env"), whether the value is HCL, and whether it is marked sensitive. A variable marked sensitive is write-only in HCP Terraform, so its value does not come back; every other variable's value does, which is why this response is not written to the audit log. Variable sets shared across workspaces are a separate resource and are not covered here.
list_projectsList an organization's projects with their names and ids. A project groups workspaces; pass the prj- id returned here to list_workspaces to see only that group.
What it will not do
Enforced by the gateway rather than left to convention, which is why each of these can be stated flatly.
- It cannot call anything else
- The 11 actions above are the whole of it. A call to any other name is refused before it reaches HCP Terraform rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time.
- It only reads
- Every action here reads. Nothing this connector can do changes anything in HCP Terraform.
- It reaches no further than your credential
- Toolspoke holds no access to HCP Terraform of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either.
- It never hears from HCP Terraform
- Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in HCP Terraform. An agent has to ask.
- It does not smooth over provider limits
- Toolspoke does not retry, queue or back off around HCP Terraform's own rate limits. A call that HCP Terraform refuses comes back to the agent as a failed call.
Before you connect it
What can Claude do in HCP Terraform?
11 named actions: 11 that only read. They include list_organizations, list_workspaces and get_workspace. Nothing outside that list is reachable: the connector declares each operation by name rather than proxying whatever an agent asks for.
What credentials does the HCP Terraform connector need?
API token. The connector asks for api token, and optionally default organization name. Values are encrypted at rest and attached to the outbound request by the gateway, so they are never part of the arguments an agent sends and never reach the audit log.
Does the HCP Terraform connector work with Cursor and Codex, or only Claude?
Any client that speaks MCP, and every one of them gets the same 11 actions. There is a single address, https://toolspoke.com/mcp. Claude Code adds it with claude mcp add --transport http, Claude and Claude Desktop take it as a custom connector in settings, Cursor reads it from .cursor/mcp.json, Codex from ~/.codex/config.toml, and VS Code from .vscode/mcp.json. Each of them signs in to the gateway itself, so there is no key to paste.
What does the HCP Terraform connector not do?
The 11 actions above are the whole of it. A call to any other name is refused before it reaches HCP Terraform rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time. Every action here reads. Nothing this connector can do changes anything in HCP Terraform. Toolspoke holds no access to HCP Terraform of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either. Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in HCP Terraform. An agent has to ask. Toolspoke does not retry, queue or back off around HCP Terraform's own rate limits. A call that HCP Terraform refuses comes back to the agent as a failed call.
Can I limit which actions an agent can call?
Yes, in two places. The project switches HCP Terraform's actions on and off one at a time, for everyone in the project at once, and the screen groups them by read, write and destructive so turning off everything that deletes is one click. An individual agent key can then be narrowed further, to particular toolkits in a project and to particular actions in a toolkit. Whatever it was granted, a key never reaches a project its owner cannot.
What gets recorded when an agent calls HCP Terraform?
Every attempt, with the agent that made it and the person that agent belongs to, the full request payload, the response payload, the status, the duration, and the credits spent. Values whose key names a secret are masked out before the record is shown to anyone. An operation the connector marks as not retained never has its response body written at all, so the gateway keeps no second copy of what was read.