AI & MCP
SQL Explorer can run a local MCP (Model Context Protocol) server so an AI assistant can query the connections you explicitly allow — and nothing else.
Turning it on
Open Settings ▸ MCP server and enable it. The app binds a
loopback-only listener at http://127.0.0.1:5488 (the port is configurable) and,
by default, requires a bearer token. Copy the URL and token into your MCP client —
that pair is what grants access. You can Start/Stop the server, regenerate the token, and (because it runs
in-process) let the window close to the tray to keep it running.
Per-connection access
Enabling the server grants nothing on its own. Each connection has an AI access level, None by default, so a connection stays invisible until you raise it — in the connection dialog or by right-clicking the connection in the tree. Reachable connections show an AI badge; AI-created temporary ones show a Temporary badge. You can also exclude a connection from the AI entirely.
| Level | Allows |
|---|---|
| None (default) | Nothing — the connection is invisible to the AI. |
| Read-only | SELECT / EXPLAIN only. |
| Read-write | Adds INSERT / UPDATE / DELETE. DDL is still refused. |
Tools the AI can call
| Tool | Access | What it does |
|---|---|---|
list_connections | read | Lists connections the AI may see (never returns secrets). |
get_schema | read | Browses databases, schemas, tables and columns. |
run_query | read / write* | Runs a single statement, row-capped. Writes need Read-write; DDL and multi-statement are always refused. |
explain_query | read | Returns the query plan without executing. |
get_query_log | read | Reads the on-disk query log (if enabled). |
list_providers | read | Lists engines and their connection fields. |
create_connection | write (gated) | Creates a connection — off unless you opt in. |
delete_connection | write (gated) | Removes an AI-created connection only. |
Letting the AI create connections
Off by default. When you enable “Let the AI create connections”, an assistant can list providers and create or delete connections — fail-closed: only loopback hosts are allowed until you add more, persistent connections are capped at Read-write, new ones land in an MCP folder, and temporary ones are session-only and cleared when the app closes. delete_connection only removes connections the AI itself created — never your own.
Auditing
Every call is audited. The AI activity panel (toggled from the status bar) shows each call, the connection, and whether it was allowed or denied. Turn on the query log in Settings to also record the SQL an AI ran, with timing and outcome.
SQL Explorer