← Library

Tool · intermediate

Connect an AI coding tool to Atlas without sharing credentials

A practical guide to MongoDB Atlas App Connections, delegated MCP access, and the boundary between interactive AI clients and automated agents.

The fastest way to connect an AI tool to a database is usually the wrong one: copy a powerful credential into a configuration file and hope it never leaves the machine. On August 26, MongoDB announced Atlas App Connections, a different path for supported AI clients: authorize the client in a browser, then let it use Atlas through the MongoDB MCP Server on your behalf.

This is not a magic “AI is safe now” button. It is a narrower identity and permission boundary. That makes it worth understanding before adding another database credential to an agent setup.

What App Connections changes

Atlas App Connections uses OAuth to connect a registered AI client to Atlas as an individual user. The client cannot exceed that user’s existing Atlas permissions, and an Organization Owner can put the organization’s AI clients in read-only or read-and-write mode. MongoDB documents the flow and its permission model in the MCP access model guide.

The practical difference is attribution. The AI client is not a new person with a shared password; it acts as the user who authorized it. Atlas can record the authorizing user and AI client in audit events for supported actions. The organization access guide also documents the default access lifetime, revocation path, and organization-level controls.

That removes one category of secret handling. It does not remove the need to review what the client can do, which tools it exposes, or what data your prompt asks it to read.

Pick the access model first

App Connections is for interactive work where you are present in the AI client. If you are building an agent that must run a multi-step workflow without a person approving each action, MongoDB’s programmatic MCP configuration is the better boundary. The two models use the same MCP server and tools, but they have different identities, permission ownership and administrator controls.

QuestionApp ConnectionsMCP configuration
Who acts?The Atlas user who authorized the client.A dedicated MCP configuration and its service account.
Best fitInteractive coding, exploration and query writing.Automated agents and production workflows.
How is access granted?Browser consent from a supported AI client’s marketplace.Administrator provisioning through the MCP Configuration API.
Where do permissions come from?The user’s Atlas roles, reduced by the organization’s AI client mode.Roles and controls assigned to the MCP configuration.

The decision is simple: choose App Connections when a human is driving the session and you want actions attributed to that human. Choose a programmatic configuration when the workflow needs its own identity, lifecycle and audit boundary. Do not give a scheduled job your personal delegated access just because the interactive setup was quicker.

Try the read-only path

Start with a test Atlas project and read-only access. You do not need to provision an MCP server yourself for the managed Atlas path.

  1. Confirm the scope. Use an Atlas-hosted cluster and a supported AI client. App Connections does not cover MongoDB deployments outside Atlas or arbitrary clients that MongoDB has not registered.

  2. Ask for the smallest organization setting. An Organization Owner opens Atlas Organization Settings, selects App Connections, enables AI client access, and starts with the read mode.

  3. Install the official connector. Add MongoDB from the AI client’s marketplace or connector directory. The exact menu depends on the client; use MongoDB’s current setup documentation rather than copying a random MCP configuration from a forum post.

  4. Authorize in the browser. Start the connection from the AI client, inspect the consent screen, and approve only when the named client and requested scope are what you expect.

  5. Test a harmless read. Ask the client to list collections or explain an index in a non-production project. Confirm that write tools are unavailable before you try anything more ambitious.

Controls worth checking

The OAuth flow is useful because it moves authorization into an explicit, revocable relationship. Keep the rest of the boundary explicit too:

  • Start read-only. The organization mode can remove write tools from the client’s session. Enable read-and-write only for a project and workflow that have earned it.
  • Match Atlas roles to the job. Organization mode can reduce access, but it cannot grant more than the authorizing user’s roles already allow.
  • Watch the scope of the setting. AI client access is controlled at the organization level. MongoDB documents that you cannot enable one AI client while leaving another disabled, or narrow the setting to one project.
  • Review audit events. Ask which actions create audit records and which do not. The documentation notes that read-only Atlas Administration API calls are not recorded, so “we have an audit log” is not the same as “we can replay every tool call.”
  • Have a revocation plan. Users can revoke their own connections, and an Organization Owner can disable AI client access for the organization. Treat both actions as part of incident response, not as an afterthought.

When this tool is the wrong fit

Use the self-managed MongoDB MCP Server when you need to connect to Community Edition, Enterprise Advanced or another deployment outside Atlas. Use a programmatic MCP configuration when your own agent must run unattended, needs its own service identity, or requires per-configuration controls such as an IP access list.

App Connections also has a meaningful product boundary: its organization-level setting applies to AI clients as a group. If your security model requires different permissions for Cursor, Codex and an internal client, delegated App Connections may be too coarse. Make that mismatch visible during design rather than discovering it after enabling the integration.

The takeaway

MongoDB’s announcement is interesting because it treats AI database access as an identity problem, not only an MCP configuration problem. For interactive work, delegated OAuth can be a cleaner starting point than shared credentials. For unattended work, give the agent a separate programmatic identity with separate roles and lifecycle.

The useful first move is small: enable read-only access in a test project, inspect the consent and audit behavior, then decide whether the boundary is strong enough for your real workflow. If it is not, the experiment still saved you from making a personal credential the architecture.

Knowledge retrieval

What are you working through?

Start typing to search every guide, video, tool and snippet.