Skip to content

MCP server

Terminal window
miudb mcp serve --transport stdio

The server reads the normal connection store and exposes it over stdio only; there is no HTTP transport. Stdout carries MCP frames only; diagnostics and SDK logs go to stderr. Unknown transports exit 2.

FlagDefaultEffect
--connection <ref>allRepeat to restrict which connections are visible and callable
--limit100Default row limit for query tools
--max-limit1000Highest limit a tool call may request
--max-bytes1048576Max serialized bytes per tool or resource response
--timeout30sGlobal connection and query timeout
--allow-mutateoffPermit mutation SQL. Unsafe.
HostSetup
Claude Codeclaude mcp add --transport stdio miudb -- miudb mcp serve --transport stdio
Codex~/.codex/config.toml, below
Cursor.cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
VS Code, Copilot.vscode/mcp.json or your user MCP config
~/.codex/config.toml
[mcp_servers.miudb]
command = "miudb"
args = ["mcp", "serve", "--transport", "stdio"]
startup_timeout_sec = 10
tool_timeout_sec = 60

Cursor and a project .mcp.json for Claude Code use mcpServers; VS Code uses servers with the same entry:

{
"mcpServers": {
"miudb": { "type": "stdio", "command": "miudb", "args": ["mcp", "serve", "--transport", "stdio"] }
}
}

To pin one connection, append "--connection", "app" to args. If the host cannot find miudb, use the full path from which miudb.

ToolDoes
connections_listRedacted connections visible to this server
connection_describeRedacted metadata for one connection
connection_testOpen one connection; may start a tunnel, runs no user SQL
connections_smokeBounded smoke query across visible connections or a subset
schema_treeTables, views, and columns for one connection
query_runOne read-only statement; columns plus row arrays and a cursor
query_scriptMulti-statement script, Snowflake and MySQL only; atomic wraps it in a transaction
query_fetch_pageNext page for a query_run cursor

Resources: miudb://connections, miudb://connections/{name}, miudb://connections/{name}/schema, miudb://queries/{cursor}. Schema resources can be large; prefer schema_tree.

  • query_run rejects mutations, uncertain multi-statements, mutating CTEs, EXPLAIN, and PRAGMA with query.read_only_violation unless the server runs with --allow-mutate.
  • A mutating query_script needs --allow-mutate on the server and allow_mutate=true on the call (query.mutation_not_acknowledged otherwise). Read-only scripts always run.
  • Connection output is redacted with the CLI helpers. Passwords, SSH passwords, private keys, credential file contents, and credential-bearing URLs are never serialized.
  • Cursors are signed for the running server and scoped to their connection, so the --connection allowlist also applies to query_fetch_page.
  • An oversized response fails with query.output_too_large: lower the limit, select fewer columns, or raise --max-bytes.
SymptomFix
Host cannot start the serverUse the full path from which miudb
No tools appearRestart the host; check its MCP panel
A connection is missingCheck the repeated --connection flags
query.read_only_violationUse a single select, or restart with --allow-mutate if you mean it