TrademarkTrademark
Features
Documentation

How to Use a MCP Server with Terraform: 6 Prompts for Infrastructure Teams

Six ready-to-use prompts that turn Scalr's MCP server into a daily operations tool for platform engineers, covering status checks, incident triage, drift, secrets hygiene, policy coverage, and standing reports.
Ryan FeeApril 27, 2026
Key takeaways
  • Scalr's MCP server makes a Scalr account conversational in AI clients like Claude, exposing workspaces, run history, environments, variables, policy groups, access controls, and billing data.
  • The post provides six ready-to-use prompts covering morning infrastructure checks, incident triage, drift triage, variable and secrets hygiene, policy and access coverage, and a standing report.
  • Effective prompts specify which workspaces or environments, what condition to filter for, what time window matters, and the desired output format.
  • Prompts work best used sequentially, moving from broad scope to narrow signal to specific instances, such as drift triage then follow-up questions then run history for the worst workspace.

If you run a platform team, you answer the same questions by hand all day: which workspaces failed, whether anything has drifted, how the compliance posture changed since last week. Scalr's MCP server fixes that by making your whole Scalr account conversational once you connect it to an AI client like Claude. Workspaces, run history, environments, variables, policy groups, access controls, and billing data all turn into things you can just ask about.

Before You Start: Make Your Prompts Specific

Broad prompts give you broad answers. Four things will tighten a prompt:

  • Which workspaces or environments are you asking about?
  • What condition are you filtering for (run status, version, missing configuration)?
  • What time window matters (last 7 days, last 30, specific date)?
  • How do you want the output (table, ranked list, Slack summary)?

The Prompts

1. Morning Infrastructure Check

"Give me a status overview of all workspaces in my Scalr account. Group by environment, include current run status and Terraform version, and flag anything that's failed or hasn't had a successful run in the last 14 days."

The 14-day staleness flag catches workspaces that stop working without anyone noticing. Save it as a standing instruction so it runs every time you ask for an overview.

2. Incident Triage

"Show me all failed or errored runs from the last 24 hours. For each one, include the workspace, the environment it belongs to, and a summary of what the plan log says went wrong."

Plan log summaries turn a bare list of failures into something you can actually act on. To separate the risk further, add: "separate production from non production environments, and group any non production workspaces that share the same error type."

3. Drift Triage

"Which workspaces currently have drift? List by environment and include how long each workspace has been in a drifted state and when it last had a successful apply."

Duration tells you how worried to be: three-hour drift is a different problem from three-week drift. Save it as a standing instruction that ranks by drift duration and flags anything over 48 hours.

4. Variable and Secrets Hygiene

"List all variables across my workspaces. Flag any that appear to contain sensitive values (credentials, tokens, keys) that aren't marked as sensitive. Also flag any variable that's defined differently across workspaces within the same environment."

Config inconsistencies and security gaps usually hide in how variables are managed. Add this to keep things clear: "Separate Terraform input variables from shell environment variables, and show workspace level overrides separately from environment level settings."

5. Policy and Access Coverage

"Which workspaces aren't assigned to any OPA policy group? Group by environment and include each workspace's last run date. Also flag any environments where a service account's access hasn't been reviewed in the last 90 days."

Policy and access assignments drift slowly, without anything dramatic happening. Ask for a preview before you change anything, since policy changes at scale are hard to undo.

6. The Standing Report

"Generate an infrastructure health report for the production environment covering the last 7 days. Format it for Slack: key status metrics, anything that needs immediate attention, and one recommended action."

For repeatable weekly reports, use this standing instruction: "For weekly infrastructure reports, always include: workspace count by status, the most notable change from the previous week, one workspace or environment behaving outside the norm, and a single recommended action. Five bullets, no more. Write it for engineers who already know the context."

The five-bullet limit forces you to prioritize, so you get what matters instead of a dump of everything.

Using Prompts Together

Use these prompts in sequence instead of one at a time. A pattern that works well moves from broad scope to a narrow signal down to specific instances:

  1. Run drift triage to surface everything out of sync
  2. Ask follow-up questions about highest-priority workspaces and timing
  3. Pull run history for the workspace with longest drift to develop root cause hypotheses

The same three steps work for failure analysis (fleet → environment → specific logs) and variable issues (full audit → flagged workspaces → change history).


Getting started: Connect the Scalr MCP server in your AI client settings for live access to your account without SQL, API calls, or tab switching.

About the author
Ryan Feedirector of platform engineering at Scalr
Ryan Fee is the director of platform engineering at Scalr, with over 15 years of experience improving infrastructure experiences at companies large and small.