This guide walks through connecting MySQL (or MariaDB) to Cursor using QueryBear’s managed MCP server. End result: Cursor’s chat and composer can query your MySQL database while you code.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.
What you’ll need
- A QueryBear account (sign up free)
- A MySQL or MariaDB database (5.7+ / 10.x+)
- Cursor with MCP support
Step 1: Create a read-only MySQL user
Step 2: Add the connection to QueryBear
Dashboard → Connections → New connection → MySQL, with the credentials from Step 1.Step 3: Add QueryBear to Cursor
.cursor/mcp.json in your project root (or ~/.cursor/mcp.json globally):
Step 4: Authorize and verify
Open Cursor. First QueryBear tool call triggers OAuth in browser. In chat:“What QueryBear tools do you have? List my connections.”
Try it
“I’m adding a unique constraint on users.email. Check production for duplicate emails first.”
Cursor calls get_schema for users, writes SELECT email, COUNT(*) FROM users GROUP BY email HAVING COUNT(*) > 1, and runs it through QueryBear.
MySQL + Cursor gotchas
.cursor/mcp.jsonis project-scoped — keep different DBs for different projects.- Cursor’s built-in MySQL support is separate from MCP — both can coexist.
- Cursor caches MCP server status — restart Cursor after editing config.
- For PlanetScale, the TLS-mandatory connection string from their dashboard works as-is.
- Multi-statement queries are blocked — even if Cursor writes one.
Related
- MySQL MCP server — MySQL-specific deep dive
- Cursor client — Cursor overview
- Security model — what the gateway protects against