Skip to content

add MCP support - #7602

Merged
mccanne merged 7 commits into
mainfrom
mcp
Nov 9, 2026
Merged

mccanne merged 7 commits into
mainfrom
mcp

Conversation

@mccanne

@mccanne mccanne commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

This commit adds native support for MCP. There are two modes.

With "super db serve -mcp" a running service is extended with MCP endpoints so an agent can interact with data used by other users. This piggy backs on the auth capabilities of db serve.

With "super db mcp", a stdin/stderr invocation can be run by an agent to privately use SuperDB capabilities in a session.

@mccanne
mccanne marked this pull request as ready for review November 4, 2026 19:54
Comment thread service/mcp/tools.go Outdated
var r vio.Puller
switch {
case args.Path != "":
f, err := anyio.Open(ctx, sctx, storage.NewLocalEngine(), args.Path, opts)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The worry here is that an outsider could load any file on the local file system into a table then query it

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed. Load now uses the same remote-only storage engine as queries (HTTP/HTTPS/S3), so it can’t read the server’s files or stdin. Local paths are allowed only for super db mcp over stdio, where the client already runs as the user. Added tests for both transports.

mccanne and others added 6 commits November 7, 2026 17:50
This commit adds native support for MCP.  There are two modes.

With "super db serve -mcp" a running service is extended with
MCP endpoints so an agent can interact with data used by other
users.  This piggy backs on the auth capabilities of db serve.

With "super db mcp", a stdin/stderr invocation can be
run by an agent to privately use SuperDB capabilities in a session.
The query tool gets the csv, tsv, table, and line formats and a structured
mode that returns MCP structured content.  New tools: health, create_table,
and drop_table.  The load tool takes text formats only (data_base64 is
removed; binary files can still be loaded by path).

With -include (super db mcp) or -mcp.include (super db serve), the query
tool's include argument names SuperSQL source files in that directory
whose text precedes the query, like -I.  Names that are absolute, contain
"..", or resolve outside the directory are rejected.  In read-only mode,
the included files are checked too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@philrz
philrz requested a review from mattnibs November 9, 2026 21:59
@mccanne
mccanne merged commit 5343509 into main Nov 9, 2026
4 checks passed
@mccanne
mccanne deleted the mcp branch November 9, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants