> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up Terraform Cloud in Metorial for Claude, ChatGPT and Cursor
URL: https://metorial.com/docs/integrations/terraform-cloud
Last updated: 2026-11-24

Share Terraform Cloud with your team in Claude, ChatGPT and Cursor through Metorial: API token sign-in, 42 tools (17 read-only).

---

To give your team Terraform Cloud in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Terraform Cloud integration in a Metorial portal, and each person connects with an API token. Agents can manage HCP Terraform workspaces, runs, variables, projects, teams, workspace grants, policy sets, variable sets, state metadata and public outputs. The integration has 42 tools, 17 read-only, 14 write and 11 destructive, plus 2 triggers.

**What you will learn**

- How an admin shares Terraform Cloud in a portal and how each person connects
- What Terraform Cloud asks for when you connect, and where to find it
- How to keep the 17 read-only tools and reject the other 25

**Before you start**

- A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- An API token from Terraform Cloud for each person, or one for a shared connection
- For the CLI steps: the [Metorial CLI](https://metorial.com/docs/platform/cli), signed in to your portal

## Sign-in method

| Method | Type | What a person provides |
| --- | --- | --- |
| **API Token** | API token | `token` |

### API Token

To connect, a person enters:

- `token`: Terraform Cloud API token (User, Team, or Organization token)

### Setup settings

Setup also asks for:

- `organizationName`: The name of your Terraform Cloud / HCP Terraform organization
- `baseUrl` (optional): API base URL. Use https://app.eu.terraform.io/api/v2 for HCP Europe organizations

## Admin: share Terraform Cloud in a portal

### In the dashboard

1. **Open Shared Resources**

   Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

2. **Share a new integration**

   Select **Share a Resource**, then **New Integration**, and choose Terraform Cloud. For how members connect, choose **Each person connects** so everyone enters their own API token, or **Shared connection** to enter one API token for everyone.

3. **Limit the tools**

   Under **Tool Filters**, set the write and destructive groups to **Reject** if agents should only read from Terraform Cloud.

4. **Choose who gets it**

   Add the access groups that should see Terraform Cloud. When a person asks for access from the portal, the request appears under **Access Requests**.

### With the CLI

The CLI cannot create the per-user Terraform Cloud integration. Once it exists, check which groups have it:

```bash
metorial-admin portals access list <portal-id> --type provider_template --search "terraform cloud"
```

## Employee: connect Terraform Cloud

### In the portal

1. **Open Terraform Cloud in the catalog**

   Sign in to your portal and open Terraform Cloud. The status reads **Available**.

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. In the setup window, enter your API token (token).

3. **Confirm**

   The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect** and sign in again.

### With the CLI

```bash
metorial catalog search "terraform cloud"
metorial setup <catalog-item-id>
```

`catalog search` prints the catalog item ID. 

### Add it to your AI client

`metorial install` adds your Terraform Cloud connection to a local MCP client such as Claude Code, Cursor or Codex. `metorial list` prints the integration ID and `metorial client list` the client identifiers.

```bash
metorial list "terraform cloud"
metorial client list
metorial install <client-identifier> <integration-id>
```

For a client that takes a server URL, such as ChatGPT, `metorial install custom <integration-id>` creates an installation token and shows the endpoint details.

## Make it read-only

Open the integration's **Tool Filters** and set the write and destructive groups to **Reject**. Agents keep the 17 read-only tools, such as `get_run` and `list_runs`, and lose the 14 write tools, such as `create_team` or `create_project`, and the 11 destructive tools, such as `create_run` or `manage_run`.

Employees see the result on the integration's page in the portal under **Tool access**. For the full walkthrough, see [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
metorial list "terraform cloud"
metorial tools <integration-id>
metorial call <integration-id> get_organization -d '{}'
```

`metorial tools` lists the 42 tools, minus any you rejected. `get_organization` takes no input. 

To see every input a tool takes, run `metorial schema <integration-id> <tool-key>`.

## Tools

### Read-only tools (17)

- `list_variables`: List all Terraform and environment variables in a workspace. Needs `workspaceId`.
- `get_organization`: Call list_organizations to select an organization or use the optional configured default.
- `list_variable_sets`: Call list_organizations to select an organization or use the optional configured default.
- `list_projects`: Call list_organizations to select an organization or use the optional configured default.
- `list_workspaces`: Call list_organizations to select an organization or use the optional configured default.
- `list_policy_sets`: Call list_organizations to select an organization or use the optional configured default.
- `list_runs`: List Terraform runs for a workspace. Needs `workspaceId`.
- `get_current_state`: Get the current (latest) state version for a workspace, including fully paginated public outputs. Needs `workspaceId`.
- `get_workspace`: Call list_organizations to select an organization or use the optional configured default.
- `list_notifications`: List all notification configurations for a workspace. Needs `workspaceId`.
- `get_run`: Get detailed information about a specific Terraform run. Needs `runId`.
- `list_teams`: Call list_organizations to select an organization or use the optional configured default.
- `list_state_versions`: List historical state versions for a workspace. Needs `workspaceId`.
- `list_run_triggers`: List run triggers (workspace dependencies) for a workspace. Needs `workspaceId`.
- `list_team_workspace_access`: List team/group grants on a workspace, including relationship IDs needed by delete_team_workspace_access.
- `list_organizations`: Discover authorized organization names for subsequent organization-scoped operations.
- `get_current_user`: Identify the authenticated HCP Terraform account.

### Write tools (14)

- `create_variable_set`: Call list_organizations to select an organization or use the optional configured default. Needs `name`.
- `create_policy_set`: Call list_organizations to select an organization or use the optional configured default. Needs `name`.
- `create_run_trigger`: Create a run trigger that automatically queues a run in the target workspace whenever a run in the source workspace completes successfully. Needs `workspaceId` and `sourceWorkspaceId`.
- `update_workspace`: Update an existing workspace's settings. Needs `workspaceId`.
- `create_workspace`: Call list_organizations to select an organization or use the optional configured default. Needs `name`.
- `update_project`: Update a project's name or description. Needs `projectId`.
- `create_variable`: Create a Terraform variable or environment variable in a workspace. Needs `workspaceId`, `key`, `value` and `category`.
- `lock_unlock_workspace`: Lock or unlock a workspace. Needs `workspaceId` and `action`.
- `update_variable`: Update an existing variable's key, value, description, HCL setting, or sensitivity. Needs `workspaceId` and `variableId`.
- `manage_team_members`: Call list_organizations to select an organization or use the optional configured default. Needs `teamId`, `action` and `usernames`.
- `set_team_workspace_access`: Grant a team access to a workspace; discover grants with list_team_workspace_access and revoke them with delete_team_workspace_access. Needs `teamId`, `workspaceId` and `access`.
- `create_project`: Call list_organizations to select an organization or use the optional configured default. Needs `name`.
- `create_notification`: Create a notification configuration for a workspace. Needs `workspaceId`, `name`, `destinationType` and `triggers`.
- `create_team`: Call list_organizations to select an organization or use the optional configured default. Needs `name`.

### Destructive tools (11)

- `delete_workspace`: Permanently delete a workspace and all of its content (state versions, runs, variables). Needs `workspaceId`.
- `delete_variable`: Permanently delete a variable from a workspace. Needs `workspaceId` and `variableId`.
- `delete_variable_set`: Permanently delete a variable set. Needs `variableSetId`.
- `delete_project`: Permanently delete a project. Needs `projectId`.
- `delete_policy_set`: Permanently delete a policy set. Needs `policySetId`.
- `delete_team`: Permanently delete a team. Needs `teamId`.
- `manage_run`: Perform an action on an existing Terraform run. Needs `runId` and `action`.
- `create_run`: Queue a Terraform run that may plan, apply, or destroy real infrastructure and incur costs in a workspace. Needs `workspaceId`.
- `delete_run_trigger`: Remove a run trigger (workspace dependency). Needs `runTriggerId`.
- `delete_notification`: Delete a notification configuration from a workspace. Needs `notificationConfigurationId`.
- `delete_team_workspace_access`: Revoke one workspace-specific team/group grant.

## Triggers

Terraform Cloud has 2 triggers, which fire on events in Terraform Cloud:

- `workspace_runs`: [Polling fallback] Polls for new Terraform runs in a specified workspace.
- `run_events`: Triggers when Terraform runs change status in a workspace — created, planning, needs attention, applying, completed, or errored.

## Next steps

- [Claude Code](https://metorial.com/docs/platform/clients/claude-code), [Cursor](https://metorial.com/docs/platform/clients/cursor), [Codex](https://metorial.com/docs/platform/clients/codex) and [ChatGPT](https://metorial.com/docs/platform/clients/chatgpt): connect each client to your portal and use Terraform Cloud there
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [Terraform Cloud on metorial.com](https://metorial.com/integrations/terraform-cloud): the integration overview