Use the MongoDB Atlas CLI from KosmoKrator to call MongoDB Atlas tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.
MongoDB Atlas can be configured headlessly with `kosmokrator integrations:configure mongodb`.
# Install KosmoKrator first if it is not available on PATH.curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash# Configure and verify this integration.kosmokrator integrations:configure mongodb --set api_key="$MONGODB_API_KEY" --set cluster_url="$MONGODB_CLUSTER_URL" --enable --read allow --write ask --jsonkosmokrator integrations:doctor mongodb --jsonkosmokrator integrations:status --json
Credentials
Authentication type: API keyapi_key. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
Key
Env var
Type
Required
Label
api_key
MONGODB_API_KEY
Secret secret
yes
API Key
cluster_url
MONGODB_CLUSTER_URL
URL url
yes
Cluster URL
Call MongoDB Atlas Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to MongoDB Atlas.
mongodb.mongodb_find
Read read
Query documents from a MongoDB Atlas collection. Supports filtering, projection, sorting, pagination (limit/skip). Returns an array of matching documents.
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"}}).
Use these parameter tables when building CLI payloads without calling integrations:schema first.
mongodb.mongodb_find
Query documents from a MongoDB Atlas collection. Supports filtering, projection, sorting, pagination (limit/skip). Returns an array of matching documents.
Array of documents to insert (e.g., [{"name": "Alice"}, {"name": "Bob"}]).
mongodb.mongodb_update_one
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"}}).
Headless calls still follow the integration read/write permission policy. Configure read/write defaults
with integrations:configure. Add --force only for trusted automation that should bypass that policy.