add_connection
Register or replace a MongoDB connection profile at runtime, test it, and optionally make it the default for secure multi-connection access without mongosh or PowerShell.
Instructions
Register (or replace) a connection profile at runtime and test it.
host: "srv01", "srv01:27017" or "h1:27017,h2:27017"; or uri: "mongodb://..." / "mongodb+srv://...". auth: none | scram (user+password) | ldap | windows (Kerberos with the Windows logon) | x509 | uri. Passwords are never passed here: use password_env (name of an environment variable set in mcp.json).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tls | No | ||
| uri | No | ||
| auth | No | ||
| host | No | ||
| name | Yes | ||
| user | No | ||
| database | No | ||
| readonly | No | ||
| auth_source | No | ||
| replica_set | No | ||
| make_default | No | ||
| password_env | No | ||
| direct_connection | No | ||
| tls_allow_invalid_certificates | No |