Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.querybear.com/llms.txt

Use this file to discover all available pages before exploring further.

This quickstart gets you from zero to “ask the AI a question about your data” in about 5 minutes.

Prerequisites

1. Add a connection in the dashboard

Go to querybear.com/dashboardConnectionsNew connection. Choose your database type and either paste a connection string or fill in the fields:
  • Host — your database host (e.g. db.example.com or 127.0.0.1)
  • Port5432 (Postgres), 3306 (MySQL)
  • Database name
  • User / password — use a read-only role (see security)
  • SSL moderequire recommended for any remote DB
For SQLite, you instead point QueryBear at the file path.
For production databases, create a dedicated read-only user. QueryBear’s gateway is read-only by design, but a least-privilege DB role is belt-and-suspenders. See the Postgres, MySQL, or SQLite page for the exact CREATE ROLE SQL.

2. Configure access rules

After connecting, QueryBear pulls your schema. You can then:
  • Allow-list tables — only checked tables are visible to the agent. Default is “all tables.”
  • Block columns — mark sensitive columns (password hashes, API keys, PII). They’re stripped from schema responses and any query mentioning them is rejected.
  • Set a row limit — every query gets LIMIT n enforced. Default 1000.
  • Set a query timeout — long-running queries are killed. Default 30s.

3. Wire up your AI client

In the dashboard, open the MCP Config tab on your connection. Pick your client — Claude Code, Claude Desktop, Cursor, Codex, Windsurf, or ChatGPT — and copy the one-line config. For example, Claude Code:
claude mcp add --transport http querybear https://mcp.querybear.com/mcp
Full per-client instructions: Claude Code · Claude Desktop · Cursor · Codex · Windsurf · ChatGPT.

4. Authorize the client

The first tool call from your client triggers an OAuth flow — QueryBear opens a browser tab and asks you to grant the client access to your connections. Approve, and you’re done.

5. Ask a question

In your AI client, try:
“What QueryBear tools are available?”
You should see list_connections, get_schema, and run_query. Then try something real:
“How many users signed up in the last 7 days?”
The agent will:
  1. Call get_schema to learn your tables.
  2. Write a SQL query.
  3. Call run_query, which runs the query through QueryBear’s security pipeline.
  4. Return the result.
You can see every query the agent ran in the dashboard under Audit log.

What’s next?

Setup guides by combination

Step-by-step guides for every database × AI client combination.

Security model

Understand exactly what the gateway protects against.