database
MongoDB Atlas MCP Integration for Codex
Connect MongoDB Atlas to Codex through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.
Connect MongoDB Atlas to Codex
Use KosmoKrator as a local MCP proxy for Codex so coding sessions can reach selected integrations with explicit write policy.
Register kosmo mcp:serve as a local stdio server and choose the integration allowlist. The gateway is local, scoped to this integration, and starts with
--write=deny so Codex can inspect read-capable tools without receiving write access by default.
MongoDB Atlas MCP Config for Codex
Keep write access denied or ask-based unless the workspace is trusted.
{
"mcpServers": {
"kosmokrator-mongodb": {
"type": "stdio",
"command": "kosmo",
"args": [
"mcp:serve",
"--integration=mongodb",
"--write=deny"
]
}
}
} Run the Gateway Manually
kosmokrator mcp:serve --integration=mongodb --write=deny Why Use KosmoKrator Here
Expose only MongoDB Atlas instead of a broad multi-service tool list.
Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.
Start read-only, then opt into ask or allow for trusted workspaces.
MongoDB Atlas Tools Visible to Codex
Codex sees stable MCP tool names generated from the MongoDB Atlas integration catalog.
| MCP tool | Source function | Type | Description |
|---|---|---|---|
integration__mongodb__mongodb_find | mongodb.mongodb_find | Read | Query documents from a MongoDB Atlas collection. Supports filtering, projection, sorting, pagination (limit/skip). Returns an array of matching documents. |
integration__mongodb__mongodb_find_one | mongodb.mongodb_find_one | Read | Find a single document in a MongoDB Atlas collection. Returns the first matching document or null if no match is found. |
integration__mongodb__mongodb_insert_one | mongodb.mongodb_insert_one | Write | Insert a single document into a MongoDB Atlas collection. Returns the inserted document ID. |
integration__mongodb__mongodb_insert_many | mongodb.mongodb_insert_many | Write | Insert multiple documents into a MongoDB Atlas collection in a single operation. Returns the inserted document IDs. |
integration__mongodb__mongodb_update_one | mongodb.mongodb_update_one | Write | Update a single document in a MongoDB Atlas collection. Uses a filter to match the document and an update operations object (e.g., {"$set": {"field": "value"}}). |
integration__mongodb__mongodb_delete_one | mongodb.mongodb_delete_one | Write | Delete a single document from a MongoDB Atlas collection. Uses a filter to match the document to delete. |
integration__mongodb__mongodb_aggregate | mongodb.mongodb_aggregate | Read | Run an aggregation pipeline on a MongoDB Atlas collection. Supports all pipeline stages ($match, $group, $sort, $project, $limit, $lookup, etc.). |
integration__mongodb__mongodb_list_collections | mongodb.mongodb_list_collections | Read | List all collections in a MongoDB Atlas database. Useful for discovering what data is available before running queries. |
integration__mongodb__mongodb_get_current_user | mongodb.mongodb_get_current_user | Read | Verify connectivity to MongoDB Atlas and get current user/session information. Useful for testing that credentials are working. |