# SaturnSQL MCP Setup

Instructions for an AI agent (Claude, or any MCP-capable client) to connect to a user's SaturnSQL account.

## 1. Get an API key

Check what the user already sent you first — if they used the "Install MCP" button in the app, the key (`sat_live_...`) is already in their message alongside this URL. Use that one; do not ask them to make another.

Otherwise, ask them to create one at `https://saturnsql.com/settings#api-keys` (any plan, including Free). It needs at least the `read` and `execute` scopes; add `write` too if the user wants saved queries created or updated. The key is shown once — the user copies it and pastes it to you.

## 2. Add the MCP server

Remote MCP server, Streamable HTTP transport, one endpoint:

```
https://mcp.saturnsql.com/mcp
```

Auth is the user's own API key as a bearer token — no OAuth, no query-string key. If a client can't set custom headers on connect, it can't use this server; there is no query-param fallback (a database credential does not belong in a URL).

Claude Code:

```
claude mcp add --transport http --scope user saturnsql https://mcp.saturnsql.com/mcp --header "Authorization: Bearer sat_live_..."
```

Claude.ai / Claude Desktop: Settings → Connectors → Add custom connector, URL `https://mcp.saturnsql.com/mcp`, header `Authorization: Bearer sat_live_...`.

Any other MCP client: same URL and header, whatever its config format is.

## 3. What you can do

Eleven tools, all thin wrappers over the same REST API described at `https://saturnsql.com/openapi.yaml` (OpenAPI spec — read that directly rather than the rendered docs page, it's the same content and easier for you to parse):

- `list_connections`, `get_schema` — discover what's there
- `list_queries`, `get_query` — browse saved queries
- `execute_query` — run SQL against a connection (only a single SELECT / WITH / EXPLAIN on connections in read-only mode, the default)
- `run_saved_query` — run a saved query, substituting its `{{variables}}`
- `save_query` — create or update a saved query
- `export_query_results` — run SQL and get the rows back as csv, json, or xlsx (xlsx comes back base64-encoded)
- `list_schedules`, `create_schedule`, `run_schedule_now` — scheduled exports of a saved query to Google Sheets or Slack

Not yet available over MCP: editing or deleting schedules, connection management, dashboards. Use the web app for those.

## Verification

This file lives at `https://saturnsql.com/agent-setup/prompt.md`. It only ever asks you to point a standard MCP client at the URL above with the user's own key — never to install a plugin, marketplace, or anything else on your host machine.
