You can connect to your MongoDB Enterprise deployment or MongoDB Atlas cluster using X.509 certificate authentication with the MongoDB MCP server.
To learn more, see X.509.
Prerequisites
Complete one of the following procedures to set up X.509 authentication for your MongoDB deployment:
Note
If you need to configure your MongoDB instance to support TLS/SSL, see Configure MongoDB for TLS/SSL.
Configuration Options
To connect to a MongoDB deployment with X.509, configure the following options in your MCP server configuration:
CLI Option Name | OS Environment Variable Name | Type | Necessity | Description |
|---|---|---|---|---|
|
| string | Required | Set the username to the subject from your client certificate. The username must match the distinguished subject name of the certificate. If you omit this parameter, the MongoDB deployment infers the username from the X.509 certificate. |
|
| string | Required | Set to |
|
| string | Required | Set to |
|
| boolean | Optional | Set to |
|
| string | Optional | Specifies the .pem file that contains both the TLS / SSL certificate and key.
Specify the file name of the .pem file using relative or absolute paths.
Required when using |
|
| string | Optional | Available on Windows and macOS as an alternative to |
|
| string | Optional | Specifies the .pem file that contains the root certificate chain from the
Certificate Authority. This file is used to validate the certificate
presented by the |
|
| string | Optional | Specifies the .pem file that contains the Certificate Revocation List. Specify the file name of the .pem file using relative or absolute paths. |
|
| string | Optional | Disables the specified TLS protocols. To enable a disabled protocol, specify |
|
| boolean | Optional | Disables the validation of the hostnames in the certificate presented
by the |
|
| boolean | Optional | Bypasses the validation checks for the certificates presented by the
|