Execute SQL (Writes)
execute_sqlRun a WRITE SQL statement against the project's Postgres database — CREATE/ALTER TABLE, INSERT, UPDATE, DELETE, DROP, migrations. Destructive statements are allowed but your MCP client will show the user the SQL and ask them to approve it (they can allow once or for the session). Schema-changing statements (CREATE/ALTER/DROP of tables, types, …) automatically re-pull the typed schema helper and return the updated schema — no separate pull_database_schema call needed. Pass database only if the project has more than one. The query runs in a single transaction by default; set no_transaction for statements that cannot run inside a transaction block (VACUUM, CREATE INDEX CONCURRENTLY, …). Queries are killed after 90 seconds either way.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| database | No | ||
| projectId | Yes | ||
| no_transaction | No | Run the statement without a wrapping transaction — required for VACUUM, CREATE INDEX CONCURRENTLY, and other statements Postgres rejects inside a transaction block. |