Skip to content
agentusehub
Sign in+ Submit
Run Terraform plan and apply through an MCP agent

Run Terraform plan and apply through an MCP agent

The author had Cursor run Terraform against Postgres via MCP; the apply hit a permissions error and he finished from the terminal.

Read the experience
Time saved
Not reported
Setup time
Not reported
Running cost
Not reported
Cost range
Not reported

Use case overview

“Run Terraform plan and apply through an MCP agent” is a Software & DevOps AI agent workflow from Any. It connects Cursor in 3 steps.

The author had Cursor run Terraform against Postgres via MCP; the apply hit a permissions error and he finished from the terminal.

Reported experience

  1. What they did

    Weston Platter installed the tfmcp server and added it to Cursor's mcp.json, pointing it at a local Terraform directory. He wrote a main.tf for a Postgres role, database and schema, then had the agent run plan and apply. When the apply failed, he ran it in the terminal and granted CREATEROLE and CREATEDB through psql.

  2. How it went

    The MCP never showed the actual Terraform errors. Cursor's own Run tool displayed them and suggested setting superuser = false, after which apply worked. He concluded tfmcp made the workflow no easier than the command line.

  3. Worth knowing

    The MCP hid the Terraform error output, so be ready to run commands directly. Also, an MCP is third-party code running on your machine.

Example prompts

Try with Cursor
Connect to my Terraform project and database via MCP, run a terraform plan against [resource/environment], and summarize what will change. Pause and show me the exact plan before running apply, since this will modify infrastructure.

Frequently asked questions

What does the “Run Terraform plan and apply through an MCP agent” workflow do?

The author had Cursor run Terraform against Postgres via MCP; the apply hit a permissions error and he finished from the terminal.

Which tools do I need?

You need Cursor.

How long does it take to set up?

The guide walks through 3 steps, starting with “What they did”.

Add this badge to your site

Built this workflow? Show it is featured on AgentUseHub with a live upvote count that links back here. About badges

Featured on AgentUseHub