Query your database from Cursor

Let Cursor check the real schema before it writes a migration, or ask it "how many rows still have a null email?" while you code. SaturnSQL hosts the MCP server, so you add one URL to mcp.json and sign in. No connection string in your repo.

CursorMCP · app_db
You
How many users still have a null email before I add the NOT NULL constraint?
execute_query
SELECT COUNT(*) AS null_emails
FROM users
WHERE email IS NULL;
null_emails
37
Cursor
37 rows still have no email, so backfill them before adding NOT NULL.

Setup in Cursor

1. Add your database connection in SaturnSQL, the same connection the editor uses.

2. Add this to ~/.cursor/mcp.json (or .cursor/mcp.json in a project):

{
  "mcpServers": {
    "saturnsql": {
      "url": "https://mcp.saturnsql.com/mcp"
    }
  }
}

3. Open Cursor Settings, go to the MCP section, and click Connect next to saturnsql. Sign in to SaturnSQL in the browser window that opens. Cursor's agent can now use the tools.

The file holds only the URL. Cursor stores the sign-in token itself and refreshes it, so nothing secret ends up in your dotfiles or in git.

What it can do

The connector gives your assistant eight tools: list your connections, read a schema (tables, columns and foreign keys), run SQL, browse and open your team's saved queries, run one of them with its variables filled in, save a new query back to that library, and export a result as CSV, JSON or Excel. Queries get the same row limits as the SaturnSQL editor, and the same read-only check on connections in read-only mode (the default), and billing, users and account settings are never reachable.

It works with PostgreSQL, MySQL and MariaDB, SQL Server, Oracle, Amazon Redshift, ClickHouse, BigQuery and DynamoDB. Your database password stays encrypted in SaturnSQL; the assistant only ever sees results.

Why not a local database MCP server?

A local server needs a connection string in its config, which tends to leak into shared .cursor/mcp.json files and screenshots. It also points at whatever database the developer happens to have credentials for. With SaturnSQL, Cursor sees exactly the connections your SaturnSQL role allows, with read-only validation and row limits on every query.

Common questions

What plan do I need? The MCP server is included on SaturnSQL Starter and above. The free plan can try the editor, but it cannot connect an AI client.

Does the assistant see my database password? No. The connection and its credentials stay encrypted in SaturnSQL. Your AI client signs in with your SaturnSQL account and only receives query results.

Can it change or delete data? Not unless you allow it. New connections start in read-only mode, where every query must be a single SELECT, WITH or EXPLAIN statement. Keep read-only mode on for the connections your AI client uses, and connect with a read-only database user as well.

Can I commit .cursor/mcp.json to the repo? Yes. It contains only the server URL. Each developer signs in with their own SaturnSQL account the first time they connect.

Does it work in Windsurf, VS Code or other editors? Any MCP client that supports remote servers with OAuth sign-in can use the same URL. Clients without OAuth can use a named API key from the Install MCP dialog.

Other AI clients

Using something else? The same server works in Claude, ChatGPT and Claude Code, or see the MCP server overview.

Query your database from Cursor