TrademarkTrademark
Features
Documentation
All articles

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

Platform engineers frequently answer repetitive questions manually: which workspaces failed, whether infrastructure has drifted, or how compliance posture has changed. Scalr's MCP server addresses this by making your entire Scalr account conversational when connected to AI clients like Claude. Workspaces, run history, environments, variables, policy groups, access controls, and billing data all become something you can simply ask about.

Before You Start: Make Your Prompts Specific

Broad prompts return broad results. Four elements narrow prompts effectively:

  • 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 surfaces workspaces that quietly stop working without announcement. Save this as a standing instruction for automatic application each time you request 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 transform bare failure lists into actionable diagnostics. For additional risk separation, 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 reveals risk level: three-hour drift differs significantly from three-week drift. Save 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."

Configuration inconsistencies and security gaps typically hide in variable management. Add this separation for clarity: "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 gradually over time without dramatic changes. Request a preview before modifications, as policy changes at scale are difficult to reverse.

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 constraint forces prioritization, surfacing what matters rather than documenting everything.

Using Prompts Together

Treat these prompts sequentially rather than in isolation. A useful pattern moves from broad scope to narrow signal 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

This same three-step progression works 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.