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.

Windsurf is Codeium’s AI-first code editor. It supports MCP servers via its settings UI — paste in a JSON snippet and Windsurf’s Cascade agent gets access.

Connect

In Windsurf:
1

Open Settings

SettingsMCP ServersAdd custom server.
2

Paste the QueryBear config

{
  "mcpServers": {
    "querybear": {
      "serverUrl": "https://mcp.querybear.com/mcp"
    }
  }
}
Note Windsurf uses serverUrl, not url — easy to miss if you’re copy-pasting from a Cursor config.
3

Save and authorize

Save the settings. The first time Cascade calls a QueryBear tool, Windsurf opens a browser for OAuth. Approve, and Windsurf is linked to your QueryBear account.

Verify

In Cascade, ask:
“What QueryBear tools do you have?”
You should see list_connections, get_schema, and run_query.

Why QueryBear + Windsurf

Windsurf’s Cascade agent shines on long-running, multi-step tasks. The more it can see, the better its plans. QueryBear lets Cascade:
  • Reference real database schemas when writing or refactoring data access code.
  • Verify the impact of a migration before suggesting one.
  • Look up specific rows when debugging customer reports.
  • Generate analytics queries on demand.
…without ever giving the agent write access or visibility into sensitive columns.

Per-database setup guides

PostgreSQL + Windsurf

Step-by-step Postgres setup, including read-only role SQL.

MySQL + Windsurf

Step-by-step MySQL setup, including read-only user SQL.

SQLite + Windsurf

Local SQLite file setup.

Tips for using QueryBear in Windsurf

  • Cascade plans before it acts. For database work, ask Cascade to “outline the queries you’d run first” before letting it execute. You get a free preview of what’s about to hit your DB.
  • Use the connection name in prompts. “Using the staging connection, list tables that have a deleted_at column” — saves time vs. letting Cascade enumerate.
  • Cascade is multi-step. Watch for it to call get_schemarun_queryget_schemarun_query. This is normal and produces better answers than one-shot prompts.
  • QueryBear’s audit log captures every call. Useful for post-mortems when Cascade does something surprising.

Common workflows

  • “Refactor this query to use a window function. First, run both versions against production and compare row counts.”
  • “Add an index recommendation: pull the 10 slowest queries from pg_stat_statements, then suggest indexes that would help.”
  • “Audit the users table for rows that violate the new email-uniqueness constraint we’re about to add.”