A database MCP server that lets AI agents in, on your terms
Give Claude Code, Claude Desktop, Cursor or opencode access to your databases without pasting schemas or passwords, and decide exactly what each connection allows.
Kaleidb ships with kaleidb-mcp, a stdio Model Context Protocol server. It exposes your saved connections to AI agents through 12 tools, and enforces a per-connection access level (off, read, approve or write) so you stay in control of what an agent can change.
What does the Kaleidb MCP server do?
It lets an AI agent list your connections, read schemas, sample rows, run read-only queries, run EXPLAIN, inspect Redis keys and search vector collections. Writes go through a separate tool, so intent is explicit and can require your approval in the Kaleidb app.
It shares Kaleidb's local store and OS keychain with the desktop app, so there is nothing to configure twice.

How do I connect an AI agent to my database?
Four steps. The Kaleidb installer includes the kaleidb-mcp binary, and the MCP tab inside the app shows its exact path for your machine, so you can copy a ready-made command.
Add the database in Kaleidb
Create a connection as usual. Agents use your saved connections, so there are no passwords in agent config files.
Choose the AI access level
Open the MCP tab (Ctrl/Cmd Shift M) and set the connection to Read only to begin with. By default local and dev connections start on read, and staging and prod start with access off.
Add the server to your client
Pick your client below and paste the command or config. Replace
/path/to/kaleidb-mcpwith the path shown in the MCP tab.Ask a question about your data
Try "which tables reference orders?" or "how many users signed up last week?". Anything that writes appears in Kaleidb for approval when the connection is on Approve.
Claude Code
claude mcp add kaleidb -- /path/to/kaleidb-mcp claude mcp add kaleidb -- /path/to/kaleidb-mcp --connection "Local Postgres" --read-only Claude Desktop and Cursor
Add to claude_desktop_config.json (Claude Desktop) or ~/.cursor/mcp.json (Cursor), then restart the app.
{
"mcpServers": {
"kaleidb": {
"command": "/path/to/kaleidb-mcp",
"args": []
}
}
} opencode
Add to opencode.json (project) or ~/.config/opencode/opencode.json (global), then check with opencode mcp list.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"kaleidb": {
"type": "local",
"command": ["/path/to/kaleidb-mcp"],
"enabled": true
}
}
} Server options: --connection <id-or-name> exposes only that connection, --read-only disables all writes, and --home <dir> uses another Kaleidb data directory.
What can an AI agent do at each access level?
Each connection has its own AI access setting. We suggest read for production, approve for staging, and off for anything an agent should not know about.
| Level | Label in the app | What the agent can do |
|---|---|---|
off | Nothing | The connection is invisible to agents. |
read | Browse and query | Browse schema and run read-only queries. |
approve | Ask before writes | Also request writes; each appears in Kaleidb and runs only after you approve it (waits up to 5 minutes). |
write | Full access | Run writes directly. Destructive statements still need an explicit confirm_destructive. |
Which tools does the Kaleidb MCP server expose?
Twelve tools, plus the resources kaleidb://connections and kaleidb://{connection}/schema. Results come back as compact markdown tables, capped at about 200 rows or 30 KB with a note when truncated.
| Tool | Purpose |
|---|---|
list_connections | Connections you may use: name, kind, env, access level, read-only. |
list_objects | One level of the object tree (schemas, tables, collections, keys). |
describe_table | Columns, types, primary and foreign keys, indexes, DDL. |
describe_schema | Compact ER-style overview of all tables with foreign keys. |
search_schema | Find tables and columns by name. |
sample_rows | Rows with structured filters and sorting, no SQL needed. |
run_query | Read-only query (SQL, MongoDB JSON command, Redis read command). |
execute_write | Writes and DDL. May require your approval in the app. |
apply_row_changes | Insert, update or delete rows by key in one transaction, with dry run. |
explain_query | EXPLAIN for SQL engines. |
redis_inspect_key | Type, TTL, size and value of a Redis key. |
vector_search | Nearest-neighbour search in Qdrant and Chroma by vector or point id. |
Is it safe to give an AI agent database access?
Safer than pasting credentials, as long as you set the level deliberately. Rules are enforced by Kaleidb's core library, not only by the MCP binary, and they stack:
- Access level per connection: off, read, approve or write.
- Read-only flag: a connection marked read-only cannot be written to by anyone, agents included.
- Approval in the app: on approve connections each write waits up to 5 minutes for you to accept or deny it.
- Destructive statements: on write connections they still need an explicit
confirm_destructive. - Reads and writes are separate:
run_queryrejects statements classified as writes, so agents must useexecute_write. - Audit trail: every agent query is recorded in the query history, tagged with the MCP client's name.
Source and full reference: crates/kaleidb-mcp on GitHub. Not installed yet? Download Kaleidb.
MCP questions
Is there a database viewer with MCP for AI agents?
Yes, Kaleidb includes a built-in MCP server (kaleidb-mcp) that lets Claude Code, Claude Desktop, Cursor, opencode and other MCP clients explore and edit your saved connections. Each connection has an access level (off, read, approve or write), and in approve mode every write waits for your confirmation in the app.
How do I connect an AI agent to my database?
Open the MCP tab in Kaleidb, set the connection's AI access (start with read), and copy the generated command. For Claude Code that is claude mcp add kaleidb -- /path/to/kaleidb-mcp. Claude Desktop and Cursor use a small JSON snippet. The agent reuses your saved connections, so no passwords go into agent config files.
Is Kaleidb safe to use on a production database?
Kaleidb is designed for it: production connections are read-only by default, shown with a red strip, and any DELETE or UPDATE without a WHERE clause needs explicit confirmation. Edits go through a pending-changes tray that shows the exact SQL first. For AI agents, you can leave production on read access only.