HomeFeaturesPluginsDocsDownload

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.

The listener is 127.0.0.1 only by design — there is deliberately no setting to expose it on the network.

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.

LevelAllows
None (default)Nothing — the connection is invisible to the AI.
Read-onlySELECT / EXPLAIN only.
Read-writeAdds INSERT / UPDATE / DELETE. DDL is still refused.
Extra guards apply on every call: a server-side row cap (200) and timeout (30s), secret-scrubbing of results, and a master-password gate — all in Settings.

Tools the AI can call

ToolAccessWhat it does
list_connectionsreadLists connections the AI may see (never returns secrets).
get_schemareadBrowses databases, schemas, tables and columns.
run_queryread / write*Runs a single statement, row-capped. Writes need Read-write; DDL and multi-statement are always refused.
explain_queryreadReturns the query plan without executing.
get_query_logreadReads the on-disk query log (if enabled).
list_providersreadLists engines and their connection fields.
create_connectionwrite (gated)Creates a connection — off unless you opt in.
delete_connectionwrite (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.