A Model Context Protocol (MCP) server that provides access to the MongoDB Atlas API. This server wraps the mongodb-atlas-api-client package to expose MongoDB Atlas functionality through MCP tools. This MCP server exposes most of the mongodb-atlas-api-client surface as MCP tools. - userget — Get a database user by username - usergetall — List all database users - usercreate — Create a database user
Add this skill
npx mdskills install montumodi/mongodb-atlas-mcp-serverComprehensive MCP server exposing 70+ MongoDB Atlas API operations with clear examples and setup docs
1# MongoDB Atlas MCP Server23A Model Context Protocol (MCP) server that provides access to the MongoDB Atlas API. This server wraps the [mongodb-atlas-api-client](https://www.npmjs.com/package/mongodb-atlas-api-client) package to expose MongoDB Atlas functionality through MCP tools.45## Features67This MCP server exposes most of the mongodb-atlas-api-client surface as MCP tools.89### Database Users10- `user_get` — Get a database user by username11- `user_get_all` — List all database users12- `user_create` — Create a database user13- `user_update` — Update a database user14- `user_delete` — Delete a database user1516### Clusters17- `cluster_get` — Get cluster details18- `cluster_get_all` — List clusters19- `cluster_create` — Create cluster20- `cluster_update` — Update cluster21- `cluster_delete` — Delete cluster22- `cluster_get_advanced_configuration` — Get processArgs (advanced config)23- `cluster_update_advanced_configuration` — Update processArgs (advanced config)24- `cluster_test_primary_failover` — Initiate a test primary failover2526### Projects27- `project_get_by_id` — Get project by ID28- `project_get_by_name` — Get project by name29- `project_get_all` — List projects30- `project_create` — Create project31- `project_delete` — Delete project32- `project_get_teams` — List teams for a project33- `project_remove_user` — Remove a user from a project34- `project_assign_teams` — Assign teams to a project3536### Cloud Backups37- `cloud_backup_get_snapshots` — List cloud backup snapshots (replicaset)38- `cloud_backup_get_snapshot` — Get a specific snapshot39- `cloud_backup_get_restore_job` — Get a snapshot restore job40- `cloud_backup_create_restore_job` — Create a snapshot restore job4142### Organizations43- `organization_get_by_id` — Get organization by ID44- `organization_get_all` — List organizations45- `organization_get_users` — List users in an organization46- `organization_get_projects` — List projects in an organization47- `organization_delete` — Delete organization48- `organization_rename` — Rename organization49- `organization_invite` — Invite users to organization5051### Project Access Lists (current)52- `project_access_list_get_all` — List IP access list entries53- `project_access_list_get` — Get a specific access list entry54- `project_access_list_create` — Add entries to access list55- `project_access_list_update` — Upsert access list entries (POST semantics)56- `project_access_list_delete` — Delete an access list entry5758### Project Whitelist (legacy)59- `project_whitelist_get_all` — List whitelist entries60- `project_whitelist_get` — Get a whitelist entry61- `project_whitelist_create` — Add whitelist entries62- `project_whitelist_update` — Update whitelist entries63- `project_whitelist_delete` — Delete a whitelist entry6465### Events66- `events_get_all` — List project events67- `events_get` — Get event by ID (project scope)68- `events_get_by_org` — Get event by ID for an organization69- `events_get_all_by_org` — List organization events7071### Atlas Search72- `atlas_search_get_all` — List indexes for a collection73- `atlas_search_create` — Create an index74- `atlas_search_get` — Get index by ID75- `atlas_search_update` — Update index by ID76- `atlas_search_delete` — Delete index by ID77- `atlas_search_get_all_analyzers` — List analyzers78- `atlas_search_upsert_analyzer` — Create/Update analyzers7980### Atlas Users (Account-level)81- `atlas_user_get_by_name` — Get Atlas user by username82- `atlas_user_get_by_id` — Get Atlas user by ID83- `atlas_user_get_all` — List Atlas users for the project84- `atlas_user_create` — Create Atlas user85- `atlas_user_update` — Update Atlas user8687### Alerts88- `alert_get_all` — List project alerts89- `alert_get` — Get alert by ID90- `alert_acknowledge` — Acknowledge alert9192### Data Lake93- `datalake_get` — Get Data Lake by name94- `datalake_get_all` — List Data Lakes95- `datalake_create` — Create Data Lake96- `datalake_update` — Update Data Lake97- `datalake_delete` — Delete Data Lake98- `datalake_get_logs_stream` — Get query logs (returns base64-encoded gzip data)99100### Cloud Provider Access101- `cloud_provider_access_get_all` — List cloud provider access roles102- `cloud_provider_access_create` — Create a role103- `cloud_provider_access_update` — Update a role (roleId + body)104- `cloud_provider_access_delete` — Delete a role (cloudProvider + roleId)105106## Installation1071081. Clone this repository:109```bash110git clone https://github.com/montumodi/mongodb-atlas-mcp-server.git111cd mongodb-atlas-mcp-server112```1131142. Install dependencies:115```bash116npm install117```118119## Configuration120121Before using the server, you need to set up environment variables with your MongoDB Atlas API credentials:122123### Required Environment Variables124125- `MONGODB_ATLAS_PUBLIC_KEY` - Your MongoDB Atlas API public key126- `MONGODB_ATLAS_PRIVATE_KEY` - Your MongoDB Atlas API private key127- `MONGODB_ATLAS_PROJECT_ID` - Your MongoDB Atlas project/group ID128129### Optional Environment Variables130131- `MONGODB_ATLAS_BASE_URL` - Atlas API base URL (defaults to `https://cloud.mongodb.com/api/atlas/v1.0`)132133### Getting Atlas API Keys1341351. Log in to [MongoDB Atlas](https://cloud.mongodb.com/)1362. Go to **Organization Settings** → **Access Manager** → **API Keys**1373. Click **Create API Key**1384. Assign appropriate permissions (Project Read/Write access recommended)1395. Copy the public and private keys1406. Find your Project ID in the project settings141142### Example Configuration143144```bash145export MONGODB_ATLAS_PUBLIC_KEY="your-public-key"146export MONGODB_ATLAS_PRIVATE_KEY="your-private-key"147export MONGODB_ATLAS_PROJECT_ID="your-project-id"148```149150Or create a `.env` file:151```env152MONGODB_ATLAS_PUBLIC_KEY=your-public-key153MONGODB_ATLAS_PRIVATE_KEY=your-private-key154MONGODB_ATLAS_PROJECT_ID=your-project-id155```156157## Usage158159### Running the Server160161```bash162npm start163```164165### Using with MCP Clients166167This server implements the Model Context Protocol and can be used with any MCP-compatible client. The server communicates over stdin/stdout.168169### Example Tool Usage170171#### Get All Clusters172```json173{174 "name": "cluster_get_all",175 "arguments": {176 "options": {177 "itemsPerPage": 10178 }179 }180}181```182183#### Create a Database User184```json185{186 "name": "user_create",187 "arguments": {188 "body": {189 "username": "newuser",190 "password": "securepassword123",191 "roles": [192 {193 "databaseName": "myapp",194 "roleName": "readWrite"195 }196 ],197 "databaseName": "admin"198 }199 }200}201```202203#### Get Project Events204#### Get Data Lake Logs (example)205Note: The logs are returned as base64-encoded gzip data in the `text` response. Decode base64 and then gunzip to read.206```json207{208 "name": "datalake_get_logs_stream",209 "arguments": { "dataLakeName": "MyDataLake" }210}211```212```json213{214 "name": "events_get_all",215 "arguments": {216 "options": {217 "itemsPerPage": 20,218 "eventType": ["CLUSTER"]219 }220 }221}222```223224## Error Handling225226The server provides detailed error messages for:227- Missing or invalid API credentials228- Network connectivity issues229- Invalid parameters230- MongoDB Atlas API errors231232## Development233234### Running in Development Mode235```bash236npm run dev237```238239### Testing240```bash241npm test242```243244## Dependencies245246- **@modelcontextprotocol/sdk** - MCP SDK for server implementation247- **mongodb-atlas-api-client** - MongoDB Atlas API client library248249## API Reference250251This server exposes MongoDB Atlas API functionality through MCP tools. For detailed information about the underlying Atlas API, refer to:252253- [MongoDB Atlas API Documentation](https://docs.atlas.mongodb.com/reference/api/)254- [mongodb-atlas-api-client Documentation](https://www.npmjs.com/package/mongodb-atlas-api-client)255256## Contributing2572581. Fork the repository2592. Create a feature branch2603. Make your changes2614. Add tests if applicable2625. Submit a pull request263264## License265266MIT267268## Support269270For issues and questions:271- Check the [MongoDB Atlas API Documentation](https://docs.atlas.mongodb.com/reference/api/)272- Review the [mongodb-atlas-api-client](https://github.com/montumodi/mongodb-atlas-api-client) documentation273- Open an issue in this repository274
Full transparency — inspect the skill content before installing.