Set up Terraform Cloud in Metorial for Claude, ChatGPT and Cursor
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'll 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 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, 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 organizationbaseUrl(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
Open Shared Resources
Open Workforce, choose the portal, and select Shared Resources under Access.
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.
Limit the tools
Under Tool Filters, set the write and destructive groups to Reject if agents should only read from Terraform Cloud.
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:
Employee: connect Terraform Cloud
In the portal
Open Terraform Cloud in the catalog
Sign in to your portal and open Terraform Cloud. The status reads Available.
Authenticate
Under Quick setup, select Authenticate. In the setup window, enter your API token (token).
Confirm
The status changes to Configured. If it later reads Needs reconnect, select Reconnect and sign in again.
With the CLI
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.
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.
Check it worked
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. NeedsworkspaceId.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. NeedsworkspaceId.get_current_state: Get the current (latest) state version for a workspace, including fully paginated public outputs. NeedsworkspaceId.get_workspace: Call list_organizations to select an organization or use the optional configured default.list_notifications: List all notification configurations for a workspace. NeedsworkspaceId.get_run: Get detailed information about a specific Terraform run. NeedsrunId.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. NeedsworkspaceId.list_run_triggers: List run triggers (workspace dependencies) for a workspace. NeedsworkspaceId.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. Needsname.create_policy_set: Call list_organizations to select an organization or use the optional configured default. Needsname.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. NeedsworkspaceIdandsourceWorkspaceId.update_workspace: Update an existing workspace's settings. NeedsworkspaceId.create_workspace: Call list_organizations to select an organization or use the optional configured default. Needsname.update_project: Update a project's name or description. NeedsprojectId.create_variable: Create a Terraform variable or environment variable in a workspace. NeedsworkspaceId,key,valueandcategory.lock_unlock_workspace: Lock or unlock a workspace. NeedsworkspaceIdandaction.update_variable: Update an existing variable's key, value, description, HCL setting, or sensitivity. NeedsworkspaceIdandvariableId.manage_team_members: Call list_organizations to select an organization or use the optional configured default. NeedsteamId,actionandusernames.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. NeedsteamId,workspaceIdandaccess.create_project: Call list_organizations to select an organization or use the optional configured default. Needsname.create_notification: Create a notification configuration for a workspace. NeedsworkspaceId,name,destinationTypeandtriggers.create_team: Call list_organizations to select an organization or use the optional configured default. Needsname.
Destructive tools (11)
delete_workspace: Permanently delete a workspace and all of its content (state versions, runs, variables). NeedsworkspaceId.delete_variable: Permanently delete a variable from a workspace. NeedsworkspaceIdandvariableId.delete_variable_set: Permanently delete a variable set. NeedsvariableSetId.delete_project: Permanently delete a project. NeedsprojectId.delete_policy_set: Permanently delete a policy set. NeedspolicySetId.delete_team: Permanently delete a team. NeedsteamId.manage_run: Perform an action on an existing Terraform run. NeedsrunIdandaction.create_run: Queue a Terraform run that may plan, apply, or destroy real infrastructure and incur costs in a workspace. NeedsworkspaceId.delete_run_trigger: Remove a run trigger (workspace dependency). NeedsrunTriggerId.delete_notification: Delete a notification configuration from a workspace. NeedsnotificationConfigurationId.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, Cursor, Codex and ChatGPT: connect each client to your portal and use Terraform Cloud there
- Tool permissions: tool filters and what employees see
- Terraform Cloud on metorial.com: the integration overview