Registry / database / mongodb-atlas-mcp-server

mongodb-atlas-mcp-server

JSON →
library1.7.0jsnpmunverified

An MCP server wrapping the mongodb-atlas-api-client to expose MongoDB Atlas functionality as MCP tools. Version 1.7.0 provides tools for managing database users, clusters, projects, cloud backups, organizations, access lists, events, Atlas Search, Atlas users, alerts, and Data Lakes. Release cadence is monthly. Key differentiator: enables AI agents and editors to interact with MongoDB Atlas through a standardized protocol, reducing the need for custom API code.

npm install mongodb-atlas-mcp-server
INSTALL
IMPORT
SIG · MONGODB-ATLAS-MCP-
M
mongodb-atlas-mcp-server
databasejavascriptv1.7.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { mcpServer } from 'mongodb-atlas-mcp-server';
const { mcpServer } = require('mongodb-atlas-mcp-server');
Package exports an MCP server instance. ESM-only; CommonJS require() fails.
tools
import { tools } from 'mongodb-atlas-mcp-server/tools.js';
const tools = require('mongodb-atlas-mcp-server').tools;
Tool definitions are available as a named export from the tools subpath.
handlers
import { handler } from 'mongodb-atlas-mcp-server/handlers.js';
import { handler } from 'mongodb-atlas-mcp-server';
Handlers are not exported from the main entry; must import from subpath.

Creates and starts the MCP server using stdio transport, authenticating with MongoDB Atlas API keys.

import { mcpServer } from 'mongodb-atlas-mcp-server'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; const transport = new StdioServerTransport(); const server = mcpServer(transport); await server.start(); // Requires env vars: MONGODB_ATLAS_PUBLIC_KEY, MONGODB_ATLAS_PRIVATE_KEY, MONGODB_ATLAS_GROUP_ID (optional)
Debug
Known issues
breakingRequires Node.js 18+ and ESM; no CommonJS support
fix
Use Node.js 18+, set "type": "module" in package.json, or use .mjs extension
affects: >=1.0.0
deprecatedproject_whitelist_* tools are legacy; use project_access_list_* instead
fix
Replace whitelist tool calls with access list equivalents
affects: >=1.0.0
gotchaAPI keys must have appropriate Atlas roles; insufficient permissions cause cryptic errors
fix
Grant Organization Owner or Project Owner roles to the API key
affects: >=1.0.0
gotchaEnvironment variables MONGODB_ATLAS_PUBLIC_KEY and MONGODB_ATLAS_PRIVATE_KEY must be set; no fallback
fix
Set these env vars before starting the server
affects: >=1.0.0
gotchaTool names follow underscore_case; not camelCase
fix
Use tool names like user_get, cluster_create, etc.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'mongodb-atlas-mcp-server'
Missing or incorrect import path
fix
Ensure package is installed: npm install mongodb-atlas-mcp-server
SyntaxError: Cannot use import statement outside a module
Running ESM code in a CommonJS project without proper configuration
fix
Add "type": "module" to package.json or rename file to .mjs
MONGODB_ATLAS_PUBLIC_KEY not set
Environment variable not defined before starting server
fix
export MONGODB_ATLAS_PUBLIC_KEY='your-public-key' and MONGODB_ATLAS_PRIVATE_KEY='your-private-key'
Unauthorized: You are not authorized for this action
Atlas API key lacks required permissions
fix
Assign Organization Owner or Project Owner role to the API key in Atlas
Upgrade
Version history
1.7.0latest on npm
Audit
Dependencies
mongodb-atlas-api-clientrequiredUnderlying API client used for all MongoDB Atlas API calls
Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
mongodb-atlas-mcp-server — npm install mongodb-atlas-mcp-server · libregistry