database
MongoDB Atlas MCP Integration for LangGraph
Connect MongoDB Atlas to LangGraph through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.
Connect MongoDB Atlas to LangGraph
Run KosmoKrator integration calls from LangGraph nodes while preserving local credentials and permissions.
Use a graph node that calls the KosmoKrator CLI for deterministic steps or an MCP client for dynamic tool selection. The gateway is local, scoped to this integration, and starts with
--write=deny so LangGraph can inspect read-capable tools without receiving write access by default.
MongoDB Atlas MCP Config for LangGraph
Headless CLI calls fit repeatable graph edges; MCP fits exploratory agent nodes.
{
"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 LangGraph
LangGraph 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. |