Docs Menu
Docs Home
/ /

Connect with LDAP

Note

Starting in MongoDB 8.0, LDAP authentication and authorization is deprecated. LDAP is available and will continue to operate without changes throughout the lifetime of MongoDB 8. LDAP will be removed in a future major release.

You can connect to your MongoDB Enterprise deployment or MongoDB Atlas cluster using Lightweight Directory Access Protocol (LDAP) authentication with the MongoDB MCP server.

To learn more, see the following resources:

  • LDAP on MongoDB Enterprise.

  • LDAP on MongoDB Atlas

To connect to a MongoDB deployment with LDAP, configure the following options in your MCP server configuration:

CLI Option Name
OS Environment Variable Name
Type
Necessity
Description

username

MDB_MCP_USERNAME

string

Required

Set the username to a username that respects the security.ldap.authz.queryTemplate, or any configured security.ldap.userToDNMapping template.

password

MDB_MCP_PASSWORD

string

Required

Password for the specified LDAP user.

authenticationDatabase

MDB_MCP_AUTHENTICATION_DATABASE

string

Required

Set to $external for LDAP authentication.

authenticationMechanism

MDB_MCP_AUTHENTICATION_MECHANISM

string

Required

Set to PLAIN to use LDAP authentication.

Back

OIDC

On this page