Article
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.
Key takeaways
- Scalr's MCP server lets you query a Scalr account in plain language from AI clients like Claude, covering workspaces, run history, environments, variables, policy groups, access controls, and billing data, within your own Scalr permissions and the tools your account admin allows.
- 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.
Weighing a Terraform Cloud alternative? Scalr's Free plan covers up to 50 runs a month. Start free
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 letting you ask about your Scalr account in plain language 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, within your own Scalr permissions and the tools your account admin has allowed.
How Do You Write a Specific MCP Prompt?
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)?
Which 6 MCP Prompts Should Platform Teams Start With?
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 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 many resources drifted, when drift was last checked, and when each workspace last had a successful apply."
The resource count tells you how big the problem is, and the last check time tells you how fresh the answer is. As of December 2026, the MCP drift tool doesn't say when drift started, so if its age matters, ask the assistant to work it out from the workspace's run history. Save it as a standing instruction that ranks by drifted-resource count. For the wider picture, see our guide to Terraform drift detection.
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. To make the output easier to scan, add: "Separate Terraform input variables from shell environment variables, and show workspace level overrides separately from environment level settings."
5. Policy and Access Coverage
"Which environments have no OPA policy group attached? List the workspaces in each one with their last run date. Also list service accounts with no owner or description, and any access tokens that haven't been rotated in the last 90 days."
Policy and access assignments drift slowly, without anything dramatic happening. Make the fixes in Scalr or your policy repo afterwards: as of December 2026, the MCP server can read policy groups and access policies but can't change them.
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 the report to prioritize, so you get what matters and skip the rest.
How Should You Chain These 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:
- Run drift triage to surface everything out of sync
- Ask follow-up questions about highest-priority workspaces and timing
- Pull run history for the workspace with the most drifted resources to develop root cause hypotheses
The same three steps work for failure analysis (fleet → environment → specific logs) and variable issues (full audit → flagged workspaces → each variable's current scope and settings).
Getting started: once an account admin enables the Scalr MCP Server integration and allows its tools, add https://<your-account>.scalr.io/mcp as a connector in your AI client. It runs with your own Scalr permissions. Setup steps are in the Scalr MCP server docs.
About the author

director 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.
Reviewed by

Sebastian Stadil
CEO at Scalr
Sebastian Stadil is the CEO of Scalr with 15+ years of DevOps experience. He started with AWS in 2004 and advised early Microsoft Azure and Google Cloud.
Reviewed Dec 4, 2026