Technical preview · v0.1 · Open source · Apache-2.0
Connect MCP-compatible agents to PostgreSQL through ValkDB session budgets, without giving agents database credentials.
Open source. Stateless. stdio transport. PostgreSQL only. Read-only in v0.1. Built for technical preview against staging or disposable databases — not for production traffic without operator review.
Claude Desktop / Cursor / Kiro
↓ MCP stdio
ValkDB MCP Server
↓ HTTPS
ValkDB API
↓
PostgreSQL
Technical feedback: feedback@valkdb.dev
A small, focused bridge between MCP clients and ValkDB's session control engine.
agent_id and session_id server-side so the agent can't spoof another identity or reset its own budget.valk_schema. Sensitive columns (password, token, secret, api_key, card_number) are stripped server-side.valk_audit when VALKDB_AUDIT_ENABLED=true.Honest scope. ValkDB MCP is a thin, focused layer in v0.1.
SELECT is accepted; the in-process Read_Only_Guard blocks anything else before any HTTP call.Technical preview. Use it on staging, synthetic, or disposable databases first.
SELECT) only. Multi-statement payloads rejected.valk_audit tool gated by env var.@valkdb/mcp-server prepared but not the primary install path yetThe MCP preview is distributed as a downloadable source tarball, with the same source mirrored at github.com/Valkdb-dev/valkdb. npm publication is held back on purpose until v0.1 is signed off by early users.
curl -LO https://valkdb.dev/downloads/valkdb-mcp-server-0.1.0.tar.gz
tar -xzf valkdb-mcp-server-0.1.0.tar.gz
cd valkdb-mcp-server
npm ci
npm run build
node dist/index.js # smoke check; the process will exit with a clear error
# listing the missing env vars below
Verify the download checksum against downloads/valkdb-mcp-server-0.1.0.SHA256 if your environment requires it.
The downloadable preview package is optimized for local evaluation. The public repository includes tests and development assets.
Either point clients at the absolute path to dist/index.js (recommended for the preview), or link it as a global valkdb-mcp binary:
npm link # registers ./dist/index.js as `valkdb-mcp` on PATH which valkdb-mcp # confirm
| Variable | Required | Description |
|---|---|---|
VALKDB_API_URL | yes | Base URL of your ValkDB deployment (e.g. http://localhost:8081 for the local preview) |
VALKDB_API_KEY | yes | Bearer token issued by your ValkDB instance |
VALKDB_AGENT_ID | yes | Stable identifier for the agent. Used for budget scoping. |
VALKDB_DEFAULT_DATABASE | no | Connection name or UUID. Defaults to main. |
VALKDB_AUDIT_ENABLED | no | "true" to expose the valk_audit tool. Defaults to "false". |
VALKDB_SESSION_MODE | no | Only per_process in v0.1. |
When npx -y @valkdb/mcp-server becomes the official path, the same env vars apply, only the launch command changes.
Each client expects an absolute path to dist/index.js while the package is unpublished.
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"valkdb": {
"command": "node",
"args": ["/absolute/path/to/supersonic/valkdb-mcp-server/dist/index.js"],
"env": {
"VALKDB_API_URL": "http://localhost:8081",
"VALKDB_API_KEY": "sk-supersonic-...",
"VALKDB_AGENT_ID": "claude-desktop-1"
}
}
}
}
Add to .cursor/mcp.json in your project (or ~/.cursor/mcp.json for user-level).
{
"mcpServers": {
"valkdb": {
"command": "node",
"args": ["/absolute/path/to/supersonic/valkdb-mcp-server/dist/index.js"],
"env": {
"VALKDB_API_URL": "http://localhost:8081",
"VALKDB_API_KEY": "sk-supersonic-...",
"VALKDB_AGENT_ID": "cursor-1"
}
}
}
}
Add to ~/.kiro/settings/mcp.json (user) or .kiro/settings/mcp.json (workspace).
{
"mcpServers": {
"valkdb": {
"command": "node",
"args": ["/absolute/path/to/supersonic/valkdb-mcp-server/dist/index.js"],
"env": {
"VALKDB_API_URL": "http://localhost:8081",
"VALKDB_API_KEY": "sk-supersonic-...",
"VALKDB_AGENT_ID": "kiro-1"
},
"disabled": false,
"autoApprove": ["valk_budget", "valk_schema"]
}
}
}
Tip: keep valk_query and valk_audit out of autoApprove while you are still validating the setup. Approve them by hand the first few times.
Four tools. Closed input schemas. Server-side identity injection.
valk_queryRun a single read-only SELECT. Anything else (DML, DDL, multi-statement, EXECUTE, CALL) is rejected before the upstream call.
{ "query": "SELECT id, email FROM users WHERE active = true", "max_rows": 100 }
↓
{ "ok": true, "data": { "rows": [...], "row_count": 2 } }
valk_budgetInspect remaining session capacity at any time. No input fields.
{} ↓
{ "status": "active",
"queries": { "used": 3, "limit": 10 },
"rows": { "used": 120, "limit": 5000 },
"window": { "remaining_seconds": 47 } }
valk_schemaList tables and columns visible to the agent. Sensitive columns are stripped server-side, twice — once upstream, once by the MCP server.
{ "database": "main" } ↓
{ "database": "main",
"tables": [
{ "name": "users",
"columns": [
{ "name": "id", "type": "integer" },
{ "name": "email", "type": "text" }
] }
] }
valk_auditRecent audit events for the running session. Only registered when VALKDB_AUDIT_ENABLED=true; otherwise the tool returns PERMISSION_DENIED.
{ "limit": 5 } ↓
[ { "ts": "2026-05-25T12:00:00Z", "tool": "valk_query", "decision": "allowed" },
{ "ts": "2026-05-25T12:00:05Z", "tool": "valk_query", "decision": "blocked",
"reason": "session_query_limit_exceeded" } ]
The server is the trust boundary between the agent and the database.
agent_id is read once at startup; session_id is generated as a fresh UUID v4 per process. Both overwrite anything an agent tries to send. Inbound agent_id/session_id/task_id properties are stripped before forwarding.valk_query SQL string is parsed and rejected if it is empty, does not begin with SELECT, contains a forbidden keyword (INSERT, UPDATE, DELETE, DROP, ALTER, TRUNCATE, CREATE, GRANT, REVOKE, EXECUTE, CALL), contains a multi-statement separator, or exceeds 8192 characters.password, card_number, token, secret, api_key (case-insensitive, after trimming) are stripped from valk_schema responses, regardless of what the upstream API returns.agent_id + session_id continue consuming the same budget, they don't reset it.valk_audit tool is only registered when VALKDB_AUDIT_ENABLED=true. Otherwise it returns PERMISSION_DENIED.Background: 256 unit + property + integration tests pass. 22 adversarial tests (identity spoofing, SQL mutations, multi-statement, leakage, audit gating) pass. The detailed validation report (VALIDATION_REPORT.md) ships with the source tarball.
If any of these are blockers for your use case, tell us. They're prioritized by real demand.
INSERT / UPDATE / DELETE path in this release.session_id is per-process. If the agent restarts, a new session starts. Persisting sessions across restarts is on the roadmap.ValkDB MCP v0.1 is built for technical evaluation. Run it against synthetic data, staging, or a disposable Postgres before pointing it at anything real.
If you're a backend, security, or platform engineer evaluating it for a real workload: please talk to us first. The product is honest about what it does and doesn't do — we'd rather have that conversation up front than ship into surprise.
We're not selling ValkDB yet. We're looking for technical users to run the MCP locally and tell us whether the problem is real for them.
Technical feedback: feedback@valkdb.dev