MongoDB MCP server enterprise setup: official server, OAuth and audit logging

The official MongoDB MCP server supports OAuth 2.1 user-delegated access and per-user audit attribution on the Atlas-hosted server, with the Organization Owner enabling AI client access first. The local server has no equivalent built-in identity layer.

On this page

Can an organization approve the MongoDB MCP server for enterprise use?

Yes, for the Atlas-hosted server, with conditions. The Atlas-hosted MongoDB MCP server authenticates each AI client with OAuth 2.1 Authorization Code flow with PKCE, so access is user-delegated and every tool call is attributed to the individual who authorized the client. The local server that runs through the mongodb plugin against self-managed deployments does not give you that identity layer: it runs under the database credentials configured on the machine, so per-user attribution has to come from your own database and host controls. Approve the Atlas-hosted path for enterprise use and treat the local path as a separate review.

The Atlas prerequisites come first. An Organization Owner must enable AI client access in the App Connections tab, because it is disabled by default for existing organizations and for new organizations created by an existing Atlas user. Only users holding ORG_OWNER, GROUP_OWNER, GROUP_DATA_ACCESS_ADMIN, GROUP_DATA_ACCESS_READ_WRITE, GROUP_DATA_ACCESS_READ_ONLY or GROUP_STREAM_PROCESSING_OWNER can authorize a client. An AI client acts under the authorizing user's existing role and cannot exceed it, and a user cannot delegate a subset of their permissions. Confirm which people hold these roles today, since a read-write user who authorizes a client gives that client read-write reach.

Before approval, verify the items the vendor documentation does not settle for your organization: the maximum token lifetime your Organization Owners set (access ends after 7 days of inactivity or 30 days from grant, and the owner can shorten that), which Atlas Administration API calls appear in your audit log (read-only calls are not recorded), and whether your Atlas plan and audit log retention meet your policy. Check the remote MCP security page against your identity provider setup and confirm the client versions your staff will use support the specified protocol version, 2025-11-25.

Enterprise capabilities by deployment: Atlas-hosted versus local server

This table compares what each MongoDB MCP server deployment provides for enterprise setup, sorted into built in, needs Atlas configuration or an outside component, and not available. Read each row against the deployment you plan to run, because the Atlas-hosted and local paths use different sign-in, credentials and logging. Plan availability can vary, so confirm each entry with MongoDB before approval.

CapabilityBuilt inNeeds Atlas configuration or outside componentNot available
OAuth 2.1 user-delegated sign-inAtlas-hosted server uses the Authorization Code flow with PKCEEach user signs in to Atlas; no separate identity provider setup is documentedLocal server does not use this sign-in path (confirm with MongoDB)
Organization Owner enablementNot enabled by default for existing organizationsOwner turns on AI client access in the App Connections tabAI clients cannot connect to the organization until enabled
Per-user audit attributionTool calls are attributed to the user who authorized the AI clientConfirm audit log retention and export options with MongoDBRead-only Atlas Administration API calls are not recorded in the audit log
Token lifetime controlAccess ends after 7 days of inactivity or 30 days from grantOrganization Owner can shorten the maximum token lifetimeOwners cannot extend beyond the documented limits (confirm with MongoDB)
Local stderr and disk loggingLocal server logs to disk and to the AI client by defaultStderr logger must be enabled, which suits container deploymentsAtlas-hosted server logging is not covered by this local setting
Atlas toolsAvailable on the Atlas-hosted server and the local Atlas deployment toolsAtlas tools need Service Account Atlas API credentialsNot every tool is available on both servers; check the tools page
Database toolsAvailable for querying and managing data through the serverServer needs network access to the target MongoDB deploymentNot every database tool appears on both servers (confirm with MongoDB)
Node.js requirementLocal server runs on Node.js v22.13.0 or laterYour build or runtime host must provide the supported Node.js versionNode 20.x support is deprecated for the local server

How the Atlas-hosted server ties each AI call to a named user

The Atlas-hosted server authorizes each AI client through OAuth 2.1 with the Authorization Code flow and PKCE, and it implements version 2025-11-25 of the Model Context Protocol specification. The authorizing user signs in through Atlas and approves the client, so every tool call carries that individual's identity. The AI client does not hold a shared database account. It acts under the authorizing user's existing Atlas role and cannot exceed it, and you cannot hand it a narrower subset of that user's permissions. The practical consequence is that the access decision sits in Atlas, not in the AI client. Reviewers should confirm which roles their staff hold on each project, because the client inherits those roles as they are, including any elevated ones such as ORG_OWNER or GROUP_OWNER.

Because enforcement happens in Atlas, the set of people who can connect is defined by the roles listed on the admin enablement page, and the audit trail is tied to the approving user. Tool calls are attributed to that individual, and Atlas audit events carry delegation context. Read-only Atlas Administration API calls are not recorded in the audit log, so reviewers should not treat the audit log as a complete record of every read. Organization Owners can also shorten the maximum token lifetime below the default window, which is a useful lever for contractors or high-privilege users. Confirm the current token settings in the Atlas console before rollout, since they are an organization-level choice.

The local server works differently. It runs on the user's own machine and connects to self-managed deployments, so there is no Atlas OAuth grant and no Atlas-side identity for each call. Access depends entirely on the database credentials in the connection string and, for any Atlas tools, the Service Account Atlas API credentials the organization provides. Anyone who can read the client configuration on that machine can therefore reach whatever those credentials allow. Reviewers should decide which credentials are issued to developer machines, scope them to the minimum database role, and confirm how they are stored and rotated. For the attribution gap this creates, see the audit section below.

Decisions to make before enabling AI client access

The MongoDB MCP server gives an AI client a route into your data, and the choices below decide how far that route reaches. Each card names a setting an owner must settle before access is switched on, and the source to confirm it against.

Atlas-hosted or local per team

The mongodb-atlas plugin connects to the Atlas-hosted server over OAuth, while the mongodb plugin runs the server locally against self-managed deployments. Decide which teams use which path, because the two do not expose the same tools. Confirm the tool list for each path in the MongoDB tools documentation before approving a team's setup.

MongoDB tools list

Which Atlas roles may authorize clients

Only users holding ORG_OWNER, GROUP_OWNER, GROUP_DATA_ACCESS_ADMIN, GROUP_DATA_ACCESS_READ_WRITE, GROUP_DATA_ACCESS_READ_ONLY or GROUP_STREAM_PROCESSING_OWNER can authorize an AI client. Limit that list to people who need it, since a client can never exceed the role of the user who authorized it. Review the role assignments before the Organization Owner enables access.

Manage AI client access

Maximum token lifetime

Remote access ends after 7 days of inactivity or 30 days from grant, whichever applies first. Organization Owners can shorten the maximum token lifetime below that ceiling. Decide a shorter value for high-sensitivity projects and confirm with your security team how often users must re-authorize.

Remote MCP security

Holders of Atlas API service account credentials

Atlas tools need Service Account Atlas API credentials, which are separate from the individual user sign-in used for remote access. Name a single accountable owner for these credentials, store them in your secrets tooling, and scope the service account to the projects it must reach. Confirm rotation and revocation steps with your Atlas administrators.

Where local server logs go

The local server writes logs to disk and to the AI client by default. A stderr logger is also available and suits containers, where logs are collected by the runtime rather than written to a file. Decide the logger set for each environment, and confirm who can read the log files on developer machines and where container logs are shipped.

Configuration options

Node.js runtime for local installs

The local server requires Node.js v22.13.0 or later, and Node 20.x support is deprecated. Assign ownership for the runtime version on each developer machine or image, and pin it through your standard software management. Confirm the current requirement in the README before each rollout, since the local server is launched with npx and can pull the latest release.

Server README

How the answer changes by deployment and team structure

When every database sits in Atlas and one identity provider signs staff in to the organization, the Atlas-hosted server is the simplest path. Each AI client connects over OAuth 2.1 with the Authorization Code flow and PKCE, and it acts under the authorizing user's existing Atlas role. The audit story is strongest here because tool calls are attributed to the individual who authorized the client, and Atlas audit events carry that delegation context.

  • Role model: the AI client cannot exceed the user's Atlas role, and a user cannot hand over a subset of their permissions, so the role model is the same as the human's.
  • Enablement: confirm that an Organization Owner has turned on AI client access in the App Connections tab, since it is disabled by default for existing organizations.
  • Token lifetime: remote access ends after 7 days of inactivity or 30 days from grant, and Organization Owners can shorten the maximum token lifetime.
  • Audit gaps: read-only Atlas Administration API calls are not recorded in the audit log, so note that gap in your evidence file.
  • Tool coverage: not every tool is available on both the Atlas Managed MCP Server and the local server, so check the tools list for the server you plan to approve.

Before approving this shape, confirm which Atlas roles your staff hold and whether those roles already match the least privilege you want for an AI client.

Order of work for a production rollout

This sequence moves the rollout from Atlas organization ownership to per-developer local checks, so each control is confirmed by the person who owns it before any staff member connects an AI client. The end state is a written record of who enabled access, which roles may authorize clients, how long grants last and how activity is attributed.

  1. Confirm the Atlas organization and its Owner

    Identify the Atlas organization that will hold the rollout and name the Organization Owner who can change AI client settings for it. Confirm that the Owner is a named, accountable person and not a shared login, because that Owner controls the enablement decision in the next step. Done when the security lead has the Owner's name, the organization identifier and a written record of who holds the Owner role.

  2. Decide enablement in App Connections

    The Organization Owner decides whether AI client access is enabled in the App Connections tab. Access is disabled by default for existing organizations and for new organizations an existing Atlas user creates, so no client can connect until the Owner turns it on. Done when the approval is recorded with the date, the Owner's name and the scope of who may connect, and when someone other than the Owner has confirmed the setting.

  3. Map the Atlas roles allowed to authorize clients

    List the Atlas roles permitted to authorize an AI client: ORG_OWNER, GROUP_OWNER, GROUP_DATA_ACCESS_ADMIN, GROUP_DATA_ACCESS_READ_WRITE, GROUP_DATA_ACCESS_READ_ONLY and GROUP_STREAM_PROCESSING_OWNER. Because a client acts under the authorizing user's role and cannot exceed it, remove people whose role is broader than their job needs before they connect. Done when each eligible user is matched to a role that a reviewer has approved in writing.

  4. Set the token lifetime and access review cadence

    Review the remote access window, which ends after 7 days of inactivity or 30 days from grant, and decide whether the Organization Owner should shorten the maximum token lifetime for this organization. Assign an owner for reviewing active grants and for revoking access when someone changes role or leaves. Done when the chosen lifetime and the review owner are documented and the Owner has applied any shortened setting.

  5. Test attribution in an isolated project

    Using a test project with no production data, have one authorized user connect an AI client and run a few harmless read operations. Then check the Atlas audit events to confirm that each tool call is attributed to that individual user and carries delegation context. Note that read-only Atlas Administration API calls are not recorded in the audit log, so those activities need a different control or an accepted gap. Done when the reviewer can trace a test action to one named person.

  6. Verify local logging and Node.js on each host

    On each developer host running the local server, confirm the Node.js version meets the README minimum of v22.13.0 or later, since Node 20.x support is deprecated. Confirm where logs are written: by default the local server logs to disk and to the AI client, and a stderr logger is available for container use. Done when each host's Node.js version and log destination are recorded, and the log location is covered by the same retention rules as other developer logs.

How an AI client request reaches Atlas under a named user

The request starts with a user who authorizes the AI client through OAuth 2.1 Authorization Code flow with PKCE. Atlas then checks that user's existing role and whether an Organization Owner has enabled AI client access in App Connections. The Atlas-hosted MCP server runs the tool under that same role, and the Atlas audit log attributes the call to the individual user with delegation context. The local path is separate: the self-managed MCP server uses your own database credentials, and its logs go to disk and to the AI client by default, so review both paths before approval.

Atlas-hosted requests carry a user identity, while local requests use shared database credentials.

Evidence a security reviewer should request for this control

This table lists the records a reviewer should ask for before approving the official MongoDB MCP server, with the source of each artifact and the question it answers. Read it as a request list: each row shows where the evidence comes from and what it can and cannot prove about the setup.

ArtifactWhere it comes fromWhat it proves
App Connections enablement recordAtlas organization settings, App Connections tab, as recorded by the Organization OwnerWhether AI client access is enabled for the organization, and that an Organization Owner made the change
Roles permitted to authorize clientsAtlas user and role listing for the organization and projectsWhich users can grant AI client access: ORG_OWNER, GROUP_OWNER, and the group data access roles listed in the Atlas documentation
Token lifetime settingsOrganization security configuration for remote MCP access, confirmed with the Organization OwnerThe maximum token lifetime in effect, compared with the default 7 days of inactivity and 30 days from grant
Sample audit events with user attributionAtlas audit log export for a test session run by a named userThat tool calls are tied to the individual who authorized the client, and that delegation context appears in the event
Local log configuration per hostConfiguration file or environment settings on each machine or container running the local serverWhere logs go (disk, the AI client, or stderr) and whether any host logs sensitive values
Node.js version inventoryAsset inventory or endpoint management export for hosts that run the local serverThat each host meets the Node.js v22.13.0 minimum from the README and does not run deprecated Node 20.x
Documented gap for read-only Administration API callsVendor documentation and a written statement from the platform owner on what the audit log omitsWhich read-only management actions are not recorded, so the reviewer can plan compensating monitoring

Questions buyers and reviewers ask before approving the MongoDB MCP server

Does the MongoDB MCP server support SSO with our identity provider?

The Atlas-hosted server signs users in through Atlas OAuth 2.1 with the Authorization Code flow and PKCE, so the AI client never receives a shared database password. The sources supplied for this page do not describe how a company identity provider federates into Atlas sign-in, so confirm that path with MongoDB and with your Atlas administrators. Ask whether your Atlas organization is connected to your IdP for user login, and whether an AI client authorization is tied to a user account that your offboarding process disables. For the local server, authentication depends on the database credentials or connection string you configure, not on SSO. Treat the local server as a separate access path that needs its own review.

What does the MongoDB MCP server cost to run?

The MCP server itself is open source under the Apache-2.0 license, so the software has no license fee. The costs that matter sit elsewhere: the MongoDB Atlas plan and cluster that hosts your data, any Atlas API Service Account used by Atlas tools, and the AI client subscription your staff use. Pricing for Atlas tiers and the Atlas-hosted MCP server is not part of the sources for this page, so ask MongoDB sales or check the current Atlas plan details before budgeting. For the local server, add the engineering time to run the setup, maintain Node.js on the hosts that run it, and review logs. Ask any quote to separate recurring Atlas charges from one-time implementation effort.

How long does it take to enable the MongoDB MCP server for our organization?

The time depends on how your Atlas organization is structured, not on a fixed duration supplied for this page. AI client access is disabled by default for existing organizations, so an Organization Owner must turn it on in the App Connections tab before any client can connect. Then each user who needs access must authorize their own AI client under an Atlas role that already grants the data access they need. Time also depends on how many projects and roles you review, how you set the token lifetime, and whether the local server must be installed on developer machines. Confirm the steps and any approval gates with your Atlas Organization Owner before setting a rollout date.

Can our own team set up the MongoDB MCP server without outside help?

Yes, for the built-in settings. An Organization Owner can enable AI client access, authorized users connect their own clients, and the local server uses an interactive setup command, npx -y mongodb-mcp-server@latest setup. The local server requires Node.js v22.13.0 or later, and Node 20.x support is deprecated. Work that needs an owner includes deciding which roles may authorize clients, setting a shorter maximum token lifetime if you want one, choosing a logging destination, and collecting and reviewing logs. Atlas audit events attribute tool calls to the individual user who authorized the client, so someone must own the review process. Your team can run this alone if it has clear owners for access, logs and periodic review.

What if we need the MCP server to reach only local, self-managed databases?

The local mongodb plugin runs the server on a machine you control and connects it to self-managed deployments, so the Atlas OAuth flow and the Atlas audit trail do not apply to those connections. The Atlas-hosted server is not required for local work. Because the local server logs to disk and to the AI client by default, decide where those logs go and who reads them before rollout. A stderr logger is also available and is useful in containers. Check which tools are available on the Local MCP server, since not every tool is offered on both the Atlas Managed and Local servers. Confirm the database credentials each developer uses, and make sure they are not broader than the task needs.

Does DeployOpen help organizations roll out the MongoDB MCP server?

DeployOpen is a Chainscore Labs company that tests AI agent rollouts for security, including tool and file permissions, data exposure, credential handling, and SSO and admin settings. Its AI agent rollout security review delivers a findings report with fixes and a retest, and most engagements are fixed-scope with scope, deliverables and timelines agreed in writing before work starts. DeployOpen does not issue audit reports or certifications, and it does not publish a price list, so a quote follows from the written scope. Ongoing support and continuous testing are available as retainers. DeployOpen is not an official MongoDB partner or reseller unless that is stated separately.

Who can authorize an AI client to connect to our Atlas data?

Users holding the ORG_OWNER, GROUP_OWNER, GROUP_DATA_ACCESS_ADMIN, GROUP_DATA_ACCESS_READ_WRITE, GROUP_DATA_ACCESS_READ_ONLY or GROUP_STREAM_PROCESSING_OWNER roles can authorize an AI client. The AI client acts under that user's existing Atlas role and cannot exceed it, and you cannot delegate a subset of those permissions. This means a read-only Atlas role limits what the client can do for that user. Review which people hold these roles before enabling access, because any authorized user can connect a client. Remote access ends after 7 days of inactivity or 30 days from grant, and Organization Owners can shorten the maximum token lifetime.

How DeployOpen helps approve the MongoDB MCP server safely

DeployOpen reviews how the MongoDB MCP server is set up in your environment, from local or Atlas-hosted connection to OAuth access and audit attribution. The work ends in a written scope, configuration evidence and a retest, so your security and IT teams can decide whether to approve the setup.

How we scope

  • Agree in writing which deployment paths are covered: the local mongodb server, the mongodb-atlas remote server, or both.
  • Confirm which Atlas roles and projects staff will use to authorize AI clients, and who holds Organization Owner rights.
  • Define what the review checks for App Connections settings, token lifetimes and audit log attribution before work starts.

How we build

  • Review the Atlas AI client access settings and the authorizing user's roles against your access policy.
  • Test the setup for read-only controls, disabled destructive tools and the database user privileges behind the connection.
  • Check where connection strings, Atlas API credentials and telemetry settings sit on each developer machine.

How we hand over

  • Deliver a findings report with severity, evidence and specific fixes for each gap in the MongoDB MCP server setup.
  • Document the approved configuration, including admin enablement steps, logger settings and the audit events your team should monitor.
  • Retest the setup after fixes are applied and record the results for your security review file.

How we support

  • Engagements are fixed-scope, so changes after the agreed scope are quoted as separate written work.
  • Ongoing support, upgrades and continuous testing are available as a retainer when the MongoDB MCP server version or Atlas configuration changes.
  • DeployOpen prepares controls and evidence for your compliance assessment. Independent auditors issue any audit report or certification.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.