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.
create_atlas_cluster
- Create a new MongoDB Atlas cluster in an existing projectsetup_atlas_network_access
- Configure network access for an Atlas projectcreate_atlas_user
- Create a new database user with atlasAdmin roleget_atlas_connection_strings
- Retrieve connection strings for a clusterlist_atlas_projects
- List all Atlas projects accessible with the provided API keylist_atlas_clusters
- List all clusters in a specific Atlas projectInstall the package using npm:
npm install mcp-mongodb-atlas
Before using the tool, you need MongoDB Atlas API keys:
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"
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:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Configure Cursor by adding a new server in "Cursor settings" > "MCP":
atlas
(or any name you prefer)npx mcp-mongodb-atlas
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": []
}
}
}
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"
}
}
}
}
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.
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"
]
}
}
}
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.
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.