Cursor is the AI-first code editor. It has first-class MCP support — define an MCP server inDocumentation Index
Fetch the complete documentation index at: https://docs.querybear.com/llms.txt
Use this file to discover all available pages before exploring further.
.cursor/mcp.json and Cursor’s agent can use it across all chat, composer, and inline modes.
Connect
Choose project-scoped or global install:Project-scoped (recommended for client work)
Create.cursor/mcp.json in your project root:
.gitignore if not.
Global
Same JSON, but at~/.cursor/mcp.json. Applies to all Cursor projects.
Authorize
The first time Cursor uses the QueryBear MCP server, it opens a browser tab for OAuth. Approve, and Cursor is linked to your QueryBear account.Verify
In Cursor chat or composer, ask:“What QueryBear tools do you have?”You should see
list_connections, get_schema, and run_query. If you don’t see them after restarting Cursor, check Settings → MCP for any error messages.
Why QueryBear + Cursor
When you’re pair-programming with Cursor, the database is often the thing you most need it to see. Without QueryBear, you copy-paste schemas into the chat or describe the data structure in prose. With QueryBear, Cursor can:- Pull the actual schema when generating queries — no more hallucinated column names.
- Verify migrations against real data before you run them.
- Answer “does this row exist?” / “how many users have field X set?” while you’re writing code.
- Generate seed data based on real production distributions (without ever leaking the rows themselves — QueryBear’s row limit + column blocks see to that).
Per-database setup guides
PostgreSQL + Cursor
Step-by-step Postgres setup, including read-only role SQL.
MySQL + Cursor
Step-by-step MySQL setup, including read-only user SQL.
SQLite + Cursor
Local SQLite file setup.
Tips for using QueryBear in Cursor
- Per-project connections. If different projects target different databases, keep
.cursor/mcp.jsonproject-scoped and connect a different database per project in QueryBear. - In Composer mode, ask for the query before running it. Cursor’s composer can string together multiple tool calls; for production reads, “show me the SQL you’d run” is a good intermediate step.
- Use
@to reference QueryBear. In some Cursor versions you can@querybearto scope the agent’s tool selection. - Pin your default connection in the QueryBear dashboard. Cursor uses it without needing
list_connections.
Common workflows
- “Add a migration that backfills
users.timezonefromusers.locale. First, check how many users have alocaleset.” - “Generate a TypeScript type for the
orderstable based on its current schema.” - “I changed the
subscriptionsquery. Run it against production and tell me if any rows return unexpected fields.”
Related
- Quickstart — full QueryBear setup
- Security model — what the gateway enforces
- Windsurf — the other AI-first code editor