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.

Cursor is the AI-first code editor. It has first-class MCP support — define an MCP server in .cursor/mcp.json and Cursor’s agent can use it across all chat, composer, and inline modes.

Connect

Choose project-scoped or global install: Create .cursor/mcp.json in your project root:
{
  "mcpServers": {
    "querybear": {
      "url": "https://mcp.querybear.com/mcp"
    }
  }
}
Commit this file if your team should all use the same connection. Add it to .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.json project-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 @querybear to 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.timezone from users.locale. First, check how many users have a locale set.”
  • “Generate a TypeScript type for the orders table based on its current schema.”
  • “I changed the subscriptions query. Run it against production and tell me if any rows return unexpected fields.”