Docs Menu
Docs Home
/ /

MongoDB MCP Server Prerequisites for Running Atlas Tools

The MCP Server can run Atlas tools that perform various Atlas operations. To run the Atlas tools, your Atlas cluster requires a service account with the appropriate permissions. For a list of the tools, see MongoDB MCP Server Tools.

If you don't need to initially run the Atlas tools, you can omit this task and do it later.

To perform a simple MCP Server configuration, see Configure MCP Server File. You can provide a connection string to your Atlas cluster.

Select the permissions to run the MCP Server Atlas tools and create a service account with those permissions.

Select the minimum permissions for the service account.

Note

Granting the Organization Owner role is rarely necessary and can be a security risk.

The following table shows a subset of the operations you can perform with the MCP Server and the required roles for those operations:

Operation
Safest Role to Assign
Level

List organizations and projects

Organization Member or Organization Read Only

Organization

Create new projects

Organization Project Creator

Organization

View clusters and databases in a project

Project Read Only

Project

Create and manage clusters in a project

Project Cluster Manager

Project

Manage project access lists

Project Network Access Manager

Project

Manage database users

Project Database Access Admin

Project

You should typically use Project level roles for most operations, and assign those roles to the specific projects you need to manage or view. Avoid Organization Owner unless you require full administrative control over all projects and settings in the organization. Write down the permissions you want to use. You'll use them in the next section.

For a full list of roles and privileges, see Atlas User Roles.

Note

The MCP Server doesn't disable or hide tools based on the service account permissions. If the service account doesn't have the permission to access a tool, trying to run the tool may result in an error.

You can use the MCP Server with local Atlas deployments. To use the MCP Server tools with local Atlas deployments, you must install Docker. For an introduction to local Atlas deployments, see Create a Local Atlas Deployment.

To limit access, use a service account with Project level roles. Assign those roles to the specific projects you need to manage or view.

You can also use a service account with Organization level roles. For example, if you need a service account with Organization roles to list all projects or manage multiple projects with one service account.

The following sections provide instructions for creating a service account with either Project or Organization roles.

To create an Atlas service account with Project roles, perform these steps:

1
  1. Log in to Atlas at cloud.mongodb.com.

  2. The instructions assume you have an organization and project already created. Click Project Identity & Access in the sidebar under the SECURITY section.

  3. Click Create Application > Service Account.

  4. Enter a Name.

  5. Enter a Description.

  6. Set a Client Secret Expiration period.

  7. From the Project Permissions menu, select the appropriate roles.

  8. Click Create.

Note

The Atlas user interface is subject to change and the steps may vary. For details, see Grant Programmatic Access to an Organization.

2

After you create your Atlas service account, you'll see a client ID and client secret. Copy and save the client secret. The UI won't display it again.

You'll use the client ID and client secret to set the apiClientId and apiClientSecret in the Connecting with Atlas API Credentials section later.

3

To allow the MCP Server to connect to your Atlas cluster, add an access list entry for the IP address of the computer on which the MCP Server runs. If you run the MCP Server on your local computer, add your local IP address.

  1. Click Add Access List Entry.

  2. Enter your IP address.

  3. Click Save.

If you need a service account with Organization roles, perform these steps:

1
  1. Log in to Atlas at cloud.mongodb.com.

  2. The instructions assume you have an organization already created. Select your organization from the ORGANIZATION section near the top of the page.

  3. Click Applications in the sidebar under the IDENTITY & ACCESS section.

  4. Click Add new > Service Account.

  5. Enter a Name.

  6. Enter a Description.

  7. Set a Client Secret Expiration period.

  8. From the Organization Permissions menu, select the appropriate roles.

  9. Click Create.

Note

The Atlas user interface is subject to change and the steps may vary. For details, see Grant Programmatic Access to an Organization.

2

After you create your Atlas service account, you'll see a client ID and client secret. Copy and save the client secret. The UI won't display it again.

You'll use the client ID and client secret to set the apiClientId and apiClientSecret in the Connecting with Atlas API Credentials section later.

3

To allow the MCP Server to connect to your Atlas cluster, add an access list entry for the IP address of the computer on which the MCP Server runs. If you run the MCP Server on your local machine, add your local IP address.

  1. Navigate to Network Access.

  2. Click Add IP Address.

  3. Enter your IP address.

After you create the service account, you can configure the MCP Server to use the Atlas API credentials. For details, see Connecting with Atlas API Credentials.

Back

Get Started

On this page