AI coding agents and SQLEye
SQLEye includes a local MCP server, so a coding agent such as Claude Code can manage your database instances and read what your code actually sent to the database: captured queries, slow queries and N+1 groups. It is off by default and has no tool for running arbitrary SQL.
What can an agent do with SQLEye?
Section titled “What can an agent do with SQLEye?”An agent can do two kinds of things through 16 tools:
- Manage local instances: list engine versions and instances, install an engine version, create, start, stop, rename and delete an instance, and read its connection string.
- Read what the database saw: turn capture on or off, then read recent queries (filterable by time, slow, N+1, errors or SQL text), queries grouped by shape, N+1 groups, current connections and an Explain plan for one statement. It can also clear the captured history.
The server tells the agent a typical loop: list instances, turn capture on, run the app or its tests, read N+1 groups, shapes and queries, fix the code, clear the queries and run again.
How does the connection work?
Section titled “How does the connection work?”agent --stdio--> sqleye-mcp (small bundled helper) --local socket--> SQLEye app --> engines + Live Eye- The agent runs
sqleye-mcp, a small helper shipped next to the app. It only forwards messages and opens SQLEye if it is not running. - The app listens on a Unix domain socket on macOS and Linux (
mcp.sockin the app data directory, owner-only permissions) or a named pipe on Windows. There is no TCP port and no HTTP server. - Only the same operating-system user can connect. SQLEye accepts MCP protocol versions 2024-11-05, 2025-03-26, 2025-06-18 and 2025-11-25.
What is off until I turn it on?
Section titled “What is off until I turn it on?”The MCP server is off by default. While it is off there is no socket, no background thread and no timer. See enable the MCP server.
What keeps an agent from doing damage?
Section titled “What keeps an agent from doing damage?”- There is no tool that runs arbitrary SQL.
explain_querytakes one SELECT, INSERT, UPDATE or DELETE statement, never usesANALYZEand rejects anything else. - Deleting an instance and downloading an engine ask you for approval by default, and deleting moves the data to the Trash where the system supports it.
- Read-only mode hides every tool that changes anything.
- Captured SQL and error text reach the agent as data and are marked as untrusted in the tool descriptions.
Details are in security and approvals.
Where do I go next?
Section titled “Where do I go next?”- Enable the MCP server.
- Set up your agent, or use Manual Setup for any other client.
- Look up arguments and limits in the tool reference.
- If something fails, see troubleshooting.
SQLEye is developed and maintained by CodeROG. This page is also available as Markdown.