# Cursor repairs a Postgres Terraform apply

Weston Platter tested Cursor Agent mode with a Terraform MCP server to provision a local Postgres database, schema and application role. The deployment eventually worked, but the MCP interface initially hid the errors needed to diagnose it.

Agent: Cursor
Tools: Terraform, tfmcp, PostgreSQL, psql
Category: Software & DevOps
Date: 2025-04-17

Outcome: Weston Platter tested Cursor Agent mode with a Terraform MCP server to provision a local Postgres database, schema and application role. The deployment eventually worked, but the MCP interface initially hid the errors needed to diagnose it.

## Steps

1. Write local Postgres resources and configure tfmcp in Cursor.
2. Attempt Terraform apply and inspect errors directly when MCP fails to surface them.
3. Grant missing privileges manually, use Cursor Run to diagnose the provider issue and apply the corrected configuration.

Human oversight: Platter wrote Terraform configuration, inspected hidden errors directly and granted database privileges manually before the agent proposed its provider fix.

Source: [Weston Platter](https://masterpoint.io/blog/using-mcps-to-run-terraform/)

Canonical URL: https://agentsinuse.com/use-cases/cursor-to-repair-a-postgres-terraform-apply/
