To connect Claude to a Postgres database, give Claude an MCP (Model Context Protocol) server that can list tables and run SQL for you. With WoWSQL, that server is already hosted at https://mcp.wowsql.com/mcp: you sign in with OAuth (no database password in a config file), pin it to one project with project_ref, and add read_only=true so Claude can query but not change data. It works in Claude Desktop, on Claude.ai as a connector (WoWSQL is listed in Claude's connectors directory) and in Claude Code.
This tutorial covers all three clients, what Claude can and can't do once connected, and how to keep production data safe. WoWSQL steps follow the WoWSQL MCP docs, and Claude steps follow Anthropic's own documentation, both checked on 23 November 2026.
Key facts
- Hosted MCP URL:
https://mcp.wowsql.com/mcp(Streamable HTTP). It returns 401 with OAuth metadata until you sign in, so the client starts the OAuth flow for you.- Scoping parameters (MCP overview):
project_refpins one project,read_only=trueblocks mutating SQL inexecute_sql, andfeatures=account,database,docschooses tool groups.- Tools (MCP reference):
list_projects,get_project,list_tables,execute_sql,search_docsandget_doc. There are no storage tools.- Plans (pricing): REST and MCP APIs are listed on Free $0, Pro $25/month (100 MCP requests per minute) and Scale $99/month (250 MCP requests per minute).
- Claude directory: WoWSQL's connector was approved for Claude's connectors directory in October 2026. Search "wowsql" to find it.
What you need
- A WoWSQL account and project. The free plan is enough to try this: create one here and choose Mumbai, US East or Frankfurt.
- One of: Claude Desktop, a Claude.ai account, or Claude Code.
- For the Claude Desktop config-file method only: Node.js, so
npxworks.
You don't need a connection string, a database password or an API key. MCP access uses OAuth with PKCE, scoped to the project you pick on the consent screen (AI and MCP policy).
What Claude can do with the WoWSQL MCP server
The server exposes six tools. Which ones Claude sees depends on the URL you use.
| Tool | Feature group | What it does |
|---|---|---|
list_projects |
account (only when no project_ref is set) |
Lists your WoWSQL projects |
get_project |
account |
Gets one project's details by slug |
list_tables |
database |
Lists tables in the project's Postgres database |
execute_sql |
database |
Runs a SQL statement; with read_only=true, mutating statements are rejected |
search_docs |
docs |
Searches WoWSQL documentation |
get_doc |
docs |
Fetches a full docs page after a search |
Every tool response ends with a reminder that returned data is untrusted content, which helps against prompt injection hidden in database rows.
Step 1: Choose your MCP URL
Start with the most restricted URL that does the job. Replace YOUR_PROJECT_SLUG with your project's slug from the dashboard.
| Goal | URL |
|---|---|
| Explore one project safely (recommended) | https://mcp.wowsql.com/mcp?project_ref=YOUR_PROJECT_SLUG&read_only=true |
| Same, without docs tools | https://mcp.wowsql.com/mcp?project_ref=YOUR_PROJECT_SLUG&read_only=true&features=database |
| Let Claude change schema and data in a dev project | https://mcp.wowsql.com/mcp?project_ref=YOUR_DEV_PROJECT_SLUG |
| See all your projects (account tools) | https://mcp.wowsql.com/mcp |
With project_ref set, the account tools are hidden and the database tools default to that project. The OAuth consent screen also scopes access to the project you pick.
Step 2, option A: Claude.ai and the Claude apps (connector)
Connectors are the simplest route and work across Claude on the web, Claude Desktop and the mobile apps. Anthropic's servers make the connection, so it's set up once in your Claude account.
From the directory: open Customize → Connectors, browse the directory, search for "wowsql", and click Connect. Complete the WoWSQL sign-in and consent in the browser.
As a custom connector with a scoped URL: if you want project_ref and read_only=true, add it yourself, following Anthropic's custom connector guide:
- Go to Customize → Connectors, click + Add, then Add custom connector.
- Name it
WoWSQL (read-only). - Paste your scoped URL, for example
https://mcp.wowsql.com/mcp?project_ref=YOUR_PROJECT_SLUG&read_only=true, and click Continue. - Keep the authentication Claude detects (OAuth) and choose Sign in now.
- Finish with Add, then sign in to WoWSQL and approve the project.
Then, in a chat, open the + menu → Connectors and switch WoWSQL on for that conversation. On Team and Enterprise plans, only owners (or admins with the right role) can add custom connectors. Free Claude users are limited to one custom connector.
Step 2, option B: Claude Desktop config file
WoWSQL's Claude configuration page uses the mcp-remote package, which bridges Claude Desktop's local (stdio) MCP support to the hosted HTTP server.
- Install Node.js so
npxis available. - Open the config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
- Add the WoWSQL server, with your scoped URL inside
args:
{
"mcpServers": {
"wowsql": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.wowsql.com/mcp?project_ref=YOUR_PROJECT_SLUG&read_only=true"
]
}
}
}
- Fully quit Claude Desktop and reopen it.
- Complete OAuth in the browser when prompted.
This local server is separate from connectors: it runs on your machine and only appears in Claude Desktop.
Step 2, option C: Claude Code
WoWSQL's docs give a generic HTTP config for clients that support Streamable HTTP (other MCP clients). In Claude Code, the documented way to add a remote HTTP server is claude mcp add --transport http (Claude Code MCP docs):
claude mcp add --transport http wowsql \
"https://mcp.wowsql.com/mcp?project_ref=YOUR_PROJECT_SLUG&read_only=true"
Then start claude, run /mcp, select wowsql and authenticate in the browser. claude mcp list should show it as connected.
To share the server with your team, add --scope project, or commit a .mcp.json at the repo root:
{
"mcpServers": {
"wowsql": {
"type": "http",
"url": "https://mcp.wowsql.com/mcp?project_ref=YOUR_PROJECT_SLUG&read_only=true"
}
}
}
Each teammate still signs in with their own WoWSQL account. If you're signed in to Claude Code with a Claude.ai account, connectors you added on Claude.ai also show up in /mcp.
Step 3: Try these prompts
Start with read-only questions:
- "List the tables in my WoWSQL project and describe what each one stores."
- "How many orders were created in the last 7 days? Show the SQL you ran."
- "Find users who signed up but never created a project, and show the 20 most recent."
- "Which columns in
ordershave no index? Suggest indexes, but don't create them." - "Search the WoWSQL docs for how to enable realtime on a table."
With read_only=true, Claude can still write SQL for you to review. Ask: "Write a migration that adds a status column to orders and a Row Level Security policy so users only see their own orders. Don't run it." Then run it yourself in the SQL editor, or in a dev project connected without read-only.
Keep production data safe
An MCP connection gives Claude your permissions on that project. Treat it like giving a capable colleague a database console.
- Scope to one project. Always set
project_reffor anything real. - Use read-only by default. The docs describe
read_only=trueas blocking obvious DML and DDL (INSERT,UPDATE,DELETE, schema changes) inexecute_sql. It's a statement check, so for a hard guarantee, connect Claude to a separate project with a copy of the data. - Do write work in a dev project. Let Claude create tables and seed data there, then promote reviewed SQL to production yourself.
- Keep tool approvals on. Don't auto-approve
execute_sqlagainst production in any client. - Remember prompt injection. A row containing "ignore previous instructions" is just data. WoWSQL appends an untrusted-content reminder to tool output, but your own review is the real defence.
- Know where data goes. WoWSQL doesn't send database passwords to Claude, but query results and schema a tool returns go to Anthropic, which handles them under its own terms. Claude isn't a WoWSQL sub-processor (AI and MCP policy). Don't run broad
SELECT *queries on tables full of personal data. - Never paste the service key. OAuth makes the anon and service keys unnecessary for MCP.
WoWSQL vs Supabase vs Neon MCP for Claude
| WoWSQL | Supabase | Neon | |
|---|---|---|---|
| Hosted URL | https://mcp.wowsql.com/mcp |
https://mcp.supabase.com/mcp |
https://mcp.neon.tech/mcp |
| Auth | OAuth (PKCE) | OAuth | OAuth or API key |
| Read-only option | read_only=true blocks mutating SQL in execute_sql |
read_only=true runs queries as a read-only Postgres user |
readonly=true, or choose read-only scope during OAuth |
| Project scoping | project_ref |
project_ref |
projectId |
| Tool groups | features=account,database,docs |
features= with more groups (for example branching and debugging) |
Broad project, branch and SQL tools |
| Claude directory | Listed (search "wowsql") | Not checked for this table | Official Claude connector |
Sources: Supabase MCP docs and Neon MCP docs, checked 23 November 2026.
Where the others are stronger: Supabase's read-only mode uses a read-only database role, a stronger guarantee than a statement check, and both Supabase and Neon expose more tools, such as branching. Neon also supports API-key auth for headless agents. WoWSQL's server is deliberately small (six tools) and suits a Postgres backend you also use for auth, REST and realtime. For local and self-hosted options, see Postgres MCP server: local vs hosted.
Troubleshooting
- The URL shows 401 in a browser. Expected. MCP uses POST JSON-RPC, and a browser GET returns 401. Use an MCP client.
- No OAuth prompt in Claude Desktop. Quit the app completely (not just the window), check the JSON is valid, and make sure
npxruns from a terminal. - "project_ref must be set in MCP URL or pass project_slug". You used the unscoped URL and Claude called a database tool without naming a project. Add
project_refto the URL, or tell Claude which project slug to use. - A write was rejected. You're in read-only mode, as intended. Use a dev project without
read_onlyfor changes. - Rate limited. Pro allows 100 MCP requests per minute and Scale 250. Ask Claude to batch questions into fewer queries.
Self-hosting the MCP server
The MCP server's source is public at github.com/WoWSQL/MCP-Server under the Elastic License 2.0, a source-available licence (the main WoWSQL self-hosted edition is Apache-2.0). For development you can run it locally and point clients at http://localhost:8787/mcp. In production, run it behind HTTPS and set MCP_PUBLIC_URL and WOWSQL_API_BASE. Never set MCP_ALLOW_UNAUTHENTICATED=true outside local testing.
Related guides
- Cursor AI database setup: connect Postgres with MCP
- Connect ChatGPT to your database with WoWSQL MCP
- Backend for AI agents: Postgres with MCP and pgvector
- Best realtime database for apps in 2026
- Appwrite vs Supabase (2026)
FAQ
How do I connect Claude to my database?
Add an MCP server for your database to Claude. With WoWSQL, use the hosted server at https://mcp.wowsql.com/mcp: connect it from Claude's connectors directory (search "wowsql"), add it to claude_desktop_config.json with npx mcp-remote, or run claude mcp add --transport http in Claude Code. Then sign in with OAuth.
Is there a Claude MCP server for Postgres?
Yes. Hosted Postgres platforms run their own: WoWSQL at https://mcp.wowsql.com/mcp, Supabase at https://mcp.supabase.com/mcp and Neon at https://mcp.neon.tech/mcp. WoWSQL's server lists tables, runs SQL and searches the docs, and you can limit it to one project with project_ref.
How do I set up a database MCP server in Claude Desktop?
Edit claude_desktop_config.json and add a server named wowsql that runs npx mcp-remote with your WoWSQL MCP URL, then fully restart Claude Desktop and complete OAuth in the browser. You need Node.js installed. Alternatively, add WoWSQL as a connector under Customize, then Connectors.
How do I set up a database in Claude Code?
Run claude mcp add --transport http wowsql followed by your WoWSQL MCP URL, then start Claude Code, run /mcp and authenticate. Use --scope project or a committed .mcp.json to share the server with your team; each person signs in with their own account.
How do I give Claude safe, read-only database access?
Add project_ref=YOUR_PROJECT_SLUG&read_only=true to the WoWSQL MCP URL. Claude can then list tables and run SELECT queries in one project, while INSERT, UPDATE, DELETE and schema changes are rejected. For a hard guarantee, connect Claude to a separate project with a copy of your data, and keep tool approvals on.
Does the WoWSQL MCP server work on the free plan?
Yes. The pricing page lists REST and MCP APIs on the Free plan as well as on Pro at $25 a month, with 100 MCP requests per minute, and Scale at $99 a month, with 250 requests per minute. The free plan includes one project with a 256 MB database.