MongoDB Atlas MCP server

Integrates with MongoDB Atlas to enable creating and managing database resources including clusters, network access, users, and connection strings using TypeScript and the MongoDB Atlas API.
Back to servers
Provider
MongoDB Inc.
Release date
Mar 10, 2025
Language
TypeScript
Package
Stats
1.4K downloads
10 stars

The MongoDB Atlas MCP Server provides tools for managing MongoDB Atlas projects through the Model Context Protocol (MCP) interface. It offers functionality for creating and managing clusters, users, and network access in MongoDB Atlas.

Features

MCP Tools

  • create_atlas_cluster - Create a new MongoDB Atlas cluster in an existing project
  • setup_atlas_network_access - Configure network access for an Atlas project
  • create_atlas_user - Create a new database user with atlasAdmin role
  • get_atlas_connection_strings - Retrieve connection strings for a cluster
  • list_atlas_projects - List all Atlas projects accessible with the provided API key
  • list_atlas_clusters - List all clusters in a specific Atlas project

Installation

Install the package using npm:

npm install mcp-mongodb-atlas

Setting Up API Keys

Before using the tool, you need MongoDB Atlas API keys:

  1. Log in to your MongoDB Atlas account
  2. Go to Access Manager > API Keys
  3. Create a new API key with the appropriate permissions
  4. Save the public and private keys

Usage Options

Command Line Tool

Run the Atlas Project Manager directly from the command line:

# Using environment variables
export ATLAS_PUBLIC_KEY="your-public-key"
export ATLAS_PRIVATE_KEY="your-private-key"
npx mcp-mongodb-atlas

# Or passing keys as arguments
npx mcp-mongodb-atlas "your-public-key" "your-private-key"

With VSCode's Cline Extension

To use with Cline in VSCode, add the server config to your MCP settings file:

{
  "mcpServers": {
    "atlas": {
      "command": "npx",
      "args": ["mcp-mongodb-atlas"],
      "env": {
        "ATLAS_PUBLIC_KEY": "your-public-key",
        "ATLAS_PRIVATE_KEY": "your-private-key"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

The MCP settings file location depends on your operating system:

  • macOS: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  • Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
  • Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

With Cursor

Configure Cursor by adding a new server in "Cursor settings" > "MCP":

  1. Name: atlas (or any name you prefer)
  2. Command: npx mcp-mongodb-atlas
  3. Arguments: provide your API keys as arguments
npx mcp-mongodb-atlas <public_key> <private_key>

Alternatively, set up the ~/.cursor/mcp.json file:

{
  "mcpServers": {
    "atlas": {
      "command": "npx",
      "args": ["mcp-mongodb-atlas"],
      "env": {
        "ATLAS_PUBLIC_KEY": "your-public-key",
        "ATLAS_PRIVATE_KEY": "your-private-key"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

With Claude Desktop

To use with Claude Desktop, add the server config:

On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "atlas": {
      "command": "npx",
      "args": ["mcp-mongodb-atlas"],
      "env": {
        "ATLAS_PUBLIC_KEY": "your-public-key",
        "ATLAS_PRIVATE_KEY": "your-private-key"
      }
    }
  }
}

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later