Skip to main content
vsql_mcp serves the database to AI agents over the Model Context Protocol, from a listener inside the server process. An agent can list schemas, describe tables, and run read-only queries. Writes stay off until you turn them on, and the query path runs through a database account you nominate, so the agent gets exactly the access you granted that account.
This extension uses preview capabilities, four of them, so the server must be started with --vsql_allow_preview_extensions=ON. INSTALL EXTENSION is refused otherwise.

Install

vsql_mcp is not bundled with the server, so build it from the repository first and copy the resulting vsql_mcp.veb into the directory named by the veb_dir system variable. Then install it:
Confirm it is there:
The build instructions are in the repository.

What it adds

It adds one SQL function, info(), which reports what the listener is doing. Everything else is configuration and MCP traffic.

Example

Point the listener at a database and start it:
Agents then connect to http://127.0.0.1:3100 over MCP Streamable HTTP. The repository carries the client configuration for each agent.
The account in db_url sets the ceiling on what an agent can do, so grant it the least it needs and leave allow_write off until you mean it. Turn on require_auth with a bearer token before the port is reachable from anywhere but localhost.
A setting written with SET PERSIST survives a restart, but UNINSTALL EXTENSION deletes it. After an uninstall and reinstall every setting is back at its default, and no restart brings the old value back.

See also