QueryBear is a managed MySQL MCP server. Add the QueryBear MCP endpoint to your AI client and it can query your MySQL or MariaDB database through a hardened read-only gateway — no local install, no credentials in client config files, no chance of the agent corrupting data. Works with MySQL 5.7+, MySQL 8.x, and MariaDB 10.x+, including managed MySQL on AWS RDS, Aurora MySQL, Google Cloud SQL, Azure Database for MySQL, PlanetScale, and DigitalOcean.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.
Why a MySQL MCP server (vs. raw mysql access)
Giving an agent a MySQL connection string is the same gun you’d hand a junior dev with no review process. Even a read-only MySQL user solves only the most obvious problem:
- A prompt-injected agent can
SELECT * FROM users WHERE email LIKE '%@enterprise.com'and exfiltrate your customer list. - An agent can
SELECT *from a billion-row events table and saturate your binlog replicas. - Sensitive columns like
password_hash,bcrypt_cost,2fa_secret,address_line_1are all visible to anything withSELECTpermission.
- A SQL parser that rejects writes at the gateway layer, including multi-statement attempts and stored procedure calls that mutate state.
- Per-table allow-listing — new tables added by migrations stay invisible until you opt them in.
- Per-column block lists — sensitive columns are stripped from the schema the agent sees.
- Row limits and query timeouts.
- Full audit log.
Create a read-only MySQL user
QueryBear’s gateway enforces read-only, but a least-privilege MySQL user is belt-and-suspenders. Run this as a user withGRANT privileges:
'%', replace it with QueryBear’s egress IP (find this in the dashboard under Connections → Network).
Connection settings
In the QueryBear dashboard, add a new MySQL connection:- Host — e.g.
db.example.com, your RDS endpoint, or PlanetScale host - Port —
3306by default - Database
- User —
querybear(the user above) - Password
- SSL mode —
requirefor any non-localhost connection
MySQL-specific notes
- Multi-statement queries are rejected.
SELECT 1; DROP TABLE users;fails at the parser, even though MySQL would happily execute both. - Stored procedure calls are rejected by default. Procedures can mutate state, so they’re blocked unless explicitly allow-listed per connection.
information_schemais read for schema discovery but not query-allow-listed unless you opt in.- MariaDB is fully supported. Sequence syntax and other MariaDB-specific features work transparently.
- JSON columns work. Functions like
JSON_EXTRACT,->,->>are allowed. - Views and materialized views appear in
get_schemaand are queryable like tables.
Connect MySQL to your AI client
Claude Code
One-line CLI setup. Query MySQL from
claude in the terminal.Claude Desktop
Custom connector in Claude’s desktop app.
Cursor
Drop into
.cursor/mcp.json. Query your DB while pairing with Cursor.Codex
Add to
~/.codex/config.toml. MySQL access in Codex CLI.Windsurf
Add as a custom MCP server in Windsurf settings.
ChatGPT
Custom connector in ChatGPT (developer mode).