Skip to content

feat: allow insecure database connections via explicit opt-in - #39

Merged
rahulcrl merged 1 commit into
mainfrom
add_insecure_db_optin
Jul 7, 2026
Merged

rahulcrl merged 1 commit into
mainfrom
add_insecure_db_optin

Conversation

@rahulcrl

@rahulcrl rahulcrl commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Adds CRDB_MCP_ALLOW_INSECURE_DB=true to support local development clusters (cockroach start-single-node --insecure, cockroach demo --insecure), following the existing secure-by-default opt-out pattern (CRDB_MCP_ALLOW_INSECURE_HTTP, CRDB_MCP_ALLOW_PASSWORD_AUTH).

Changes

  • The sslmode values that can run without TLS (disable, allow, prefer) are accepted only with the opt-in, in both auth paths (CRDB_DATABASE_URL and cert env vars). require/verify-ca/verify-full behave as before.
  • Cert env vars are not required in these modes, so CRDB_HOST + CRDB_USERNAME + CRDB_SSL_MODE=disable is a complete local config.
  • Startup logs a warning with the active sslmode, matching the other opt-out warnings.
  • README: new "stdio + local insecure cluster" setup example, updated Auth prose and config tables, and a note that GUI MCP clients need an absolute binary path (minimal PATH, no tilde expansion).
  • Fixes the config test clearEnv helper, which was not resetting CRDB_MCP_ALLOW_NO_BEARER, CRDB_MCP_MAX_CONNS, CRDB_MCP_TXN_QOS between subtests (caught by the new gating test).

Testing

  • New t.Run cases covering accept/reject for all three gated modes, DSN shape without cert params, and InsecureDB() reporting.
  • Verified end-to-end against a local cockroach start-single-node --insecure node: full MCP handshake, list_databases returns rows, warning logged.
  • go test ./... passes.

Support the sslmode values that can run without TLS (disable, allow,
prefer) behind CRDB_MCP_ALLOW_INSECURE_DB=true, following the existing
opt-out pattern, for local development clusters (e.g. cockroach
start-single-node --insecure). Cert env vars are not required in these
modes and a startup warning logs the active sslmode. Also fixes the
config test clearEnv helper, which was not resetting newer env vars
between subtests.
@rahulcrl
rahulcrl force-pushed the add_insecure_db_optin branch from f05dcfe to 1d2b660 Compare July 7, 2026 07:23
@rahulcrl
rahulcrl marked this pull request as ready for review July 7, 2026 07:28

@TheComputerM TheComputerM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@rahulcrl

rahulcrl commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

TFTR @TheComputerM!

@rahulcrl
rahulcrl merged commit 189a4d2 into main Jul 7, 2026
6 checks passed
@rahulcrl
rahulcrl deleted the add_insecure_db_optin branch July 7, 2026 08:10
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.

2 participants

⌂ 换网址