Main
A safe pattern for “agent queries” is:
- Keep the MCP server read-only (leave
ALLOW_INSERT_OPERATION,ALLOW_UPDATE_OPERATION,ALLOW_DELETE_OPERATIONset tofalse). - Ask the agent to describe intent before executing (e.g., “I will run a
SELECT ... LIMIT 50to validate hypothesis X”). - Use the agent for schema discovery first (tables, columns, indexes) before any large query.
- When connecting to a remote DB, use the README’s SSH tunnel support and keep credentials out of version control (prefer env prompts / local secret stores).
If you later need writes (migrations, backfills), flip write flags only for a time-bounded session and keep a human in the loop.
FAQ
Q: Is it read-only?
A: By default, yes. The README config shows write operations gated by ALLOW_*_OPERATION env flags.
Q: Can it connect to a remote DB? A: Yes. The README highlights SSH tunnel support for remote MySQL.
Q: How do I verify it’s working in Claude Code?
A: Use claude mcp list and then try a small schema query (e.g., list tables) before larger SQL.