11 — Roadmap
Phased plan from skeleton to a deployable gateway. Each phase is mergeable independently and leaves the previous phase still working. Order is best-guess; phases 2 onward will shuffle once usage informs priorities.
Phase 0 — Skeleton ✅ done (v0.1.0)
- Repo bootstrapped, CI green on an empty Rust workspace.
- Docs in
website/docs/initial-idea/describe the target. - CLAUDE.md spells out architecture, conventions, non-negotiables.
- License, README, .gitignore, Cargo workspace, basic GitHub Actions.
Phase 1 — MCP transport + auth bones ✅ done (v0.1.0)
- HTTP listener (hand-rolled JSON-RPC; no stable MCP SDK at the time). Since 2.0 it is Streamable HTTP only:
POSTcarries JSON-RPC,GETanswers405. - OIDC login flow, JWT verification, in-memory session cache.
- A single working tool:
list_servers(returns config contents minus secrets). - State DB with sessions table; migrations on startup.
- End-to-end test: agent connects, completes mock-OIDC login, calls
list_servers. - v0.2.0 addition: MCP OAuth bridge (discovery, PKCE S256, authorization-code flow, refresh tokens) for agents that drive the OAuth dance without a browser.
Phase 2 — First real DB tools ✅ done (v0.1.0)
- Per-database Postgres connection pool with statement timeout + row cap.
list_databases,describe_schema,sample_table,run_query,explain.- Permission evaluation pipeline (groups × server × db × action).
- Audit log table + synchronous write on every tool call.
- Manual smoke test against a local Postgres.
Phase 3 — Production readiness ✅ done (v0.1.1)
- TLS by default, cert reload on SIGHUP.
/healthz,/readyz,/metrics.- Structured logging.
- Secrets references:
${ENV:NAME}and${FILE:/path}.vault:/aws-sm:/gcp-sm:refs parse but abort boot — those backends are not started. - Config validation with friendly errors at startup.
- Docker image build + push pipeline.
Phase 4 — Audit retention + archive (partial — see note)
- Hot retention pruner background task. Done.
- Streaming sinks (
logging.streamin YAML):stdoutandsyslogdone (#218) —stdoutemits the full audit row as atarget: "audit_stream"tracing event;syslogsends the same row as an RFC 5424 message over UDP, fire-and-forget.otlpremains unimplemented; the config parser rejects it. - S3 / GCS / Azure Blob archive exporter. Not started.
- SQL capture policies (
full/redacted/metadata_only). Not started.
Phase 5 — Beyond Postgres (partial — see note)
- MongoDB adapter ✅ done (v0.2.0) —
DbAdaptertrait implemented; run_query wired; describe_schema (collections + indexes) and sample_table added in plan 101. Mongo stays read-only. - Redis adapter ✅ done —
kind: redisfor any RESP server (Redis, Dragonfly, Valkey, KeyDB; Redis and Dragonfly CI-tested). Read-only always: deny-by-default command allowlist,SCANCOUNTclamped, client-side timeout with the connection closed on a cut-off command. Client:redis1.8.1 (tokio-rustls-componly); TLS verifies chain and hostname.run_queryonly —describe_schema,sample_table,explain,table_stats,db_activity,cancel_queryanswerunsupported_backend. Key scoping is the ACL user's job (06). - YugabyteDB (YSQL) ✅ tested as a
kind: postgrestarget — prod-proven on 2.25.2.0-b359, and since 2.0.1 the connection reset falls back toRESET ALLalone when the server has no advisory locks. A dedicated CI job (yugabyte, gating image publishing; locallybin/test-yugabyte) runs the Postgres query-path integration suite against it: 92 pass, 2 excluded because YugabyteDB ignoresNOTIFY(yugabyte-db#1872; the guard's denial ofpg_notifystays unit-tested), and one large-object sub-case is skipped. Cancellation needshostto name a single tserver, not a load balancer (03). - MySQL adapter — deferred post-1.0. Config parses and validates, but boot validation rejects the kind (
has_adapter). See note below. - MSSQL adapter — deferred post-1.0. Same status as MySQL.
- BigQuery adapter — not started.
- Snowflake adapter — not started.
Each adapter implements the DbAdapter trait (12) — execute, describe_schema, sample, explain, table_stats, db_activity, cancel_request, is_stale; a tool the engine cannot serve answers unsupported_backend. Audit + permissions are engine-agnostic.
MySQL / MSSQL — deferred
The config parser knows kind: mysql and kind: mssql, but boot validation rejects both rather than letting them fail at query time. Full adapter implementation is planned but has no committed timeline. sqlx's MySQL driver is in Cargo.toml only for the MySQL permissions store; there is no MySQL query path, and no MSSQL driver (tiberius).
Phase 6 — Reason capture + policy hooks ✅ done (v0.2.0)
require_reasonenforcement end-to-end (tool returnsreason_requirederror; agent prompts user; retries with reason).- Per-grant constraints:
row_limit,statement_timeout_msandrequire_reasonare wired;time_window(business hours only) is still to come.allowed_schemas/denied_tablesare dropped — table scoping is the target-DB role's job (06). - Dynamic permissions admin API — SSO-gated
/admin/*endpoints for grant CRUD; all mutations audited synchronously topermissions_audit. See 12-dynamic-permissions.
Phase 7 — HA + multi-replica (partial)
- Multi-replica deploys behind a load balancer ✅ for
/mcp, the admin API and refresh: sessions, refresh tokens, audit and permissions are in the state DB; grant changes reach other replicas overLISTEN/NOTIFY. - OAuth bridge login state (pending
/authorizeflows, consents, authorization codes) lives in the state DB (migration 0022) — no sticky routing; replicas shareSESSION_SIGNING_KEY(09) ✅. - Pruner and reaper run on every replica under a transaction-scoped advisory lock, so only one does the work ✅.
- Documented runbook for rolling restarts: operations ✅.
Phase 8 — Operator ergonomics
- CLI subcommands
login,grants,sessions revoke,audit,roles,doctor,mint-service-token✅ — CLI. Listing active sessions: not built. - Helm chart (
deploy/helm/db-mcp-gateway, optional cert-managerCertificate), kustomize base, Prometheus alerts, Grafana dashboard and runbook (deploy/) ✅ — Kubernetes.release.ymlpublishes the chart to GHCR as an OCI artifact on the release tag ✅. - Example
docker-composepolished — lives inexamples/in this repo, not a separate repo. - Provisioning SQL per engine — documented in target roles ✅; bundled templates not planned.
Phase 9 — Write mode
query_writeaction with explicit per-grant opt-in ✅ — runs as a separatewrite_roleper database; reads of the same caller stay on the read role.rows_affectedin the response andaudit_calls.rows_affected✅;dry_run(execute, report, roll back; auditeddry_run) ✅;explainof DML underquery_write✅;tool_calls{access="write"}✅.- Mandatory reason capture — available per grant (
require_reason), not forced for writes. - Optional pre-write review step — not planned: an in-band approval UI conflicts with MUST #5 (10).
Phase 10 — Agent power (plan 101, slice 12) ✅
- Upstream attribution for service tokens:
x-dbmcp-run-id/x-dbmcp-on-behalf-of→audit_calls.upstream_run_id/upstream_actor(claimed, unverified);require_upstreamper account (14). - Per-account
max_concurrent_requests;get_query_historyfiltered by run id for service identities. explainwithanalyze: truefor reads; introspection toolstable_stats,db_activity,cancel_query(03).- Mongo
describe_schema(collections + indexes) andsample_table(find+ limit).
Later, maybe never
- Kubernetes operator (vs. plain Helm).
- SCIM for direct group sync (vs. OIDC claims).
- Browser-based audit log viewer (resists the temptation — see 10-non-goals; this would be operator-only, not user-facing).
- Per-query approval workflow (write mode, sensitive tables).
- Query cost estimation + budget caps per user/group.
Anti-roadmap
Things explicitly not on the roadmap, even with infinite time:
- SaaS hosted version.
- Customer dashboards.
- Natural-language-to-SQL inside the gateway.
- Multi-tenancy on one install.
See 10-non-goals for the reasoning.