MongoDB
Connect AI agents and workflows to MongoDB, Atlas or self-managed: find and aggregate documents, insert, update and delete them, and act on change streams.
Book a demoMongoDB for AI agents and workflows.
engini lets your AI agents and workflows work in MongoDB, on Atlas or on your own servers: find documents with filters and projections, run aggregation pipelines, count and list collections, insert, update, replace and delete documents, and start a workflow the moment a change stream reports a change. The data behind your product reaches your CRM, ERP and support tools, and they reach it back. Connect from Claude, ChatGPT or Cursor over MCP, from your code, or build in Workflow Studio.
Cursor, your code
audit log
in engini
What your agent can do in MongoDB. Every tool is one you allow or leave out.
The MongoDB tools in engini, grouped by what they change. Read tools are safe to hand out widely. Write and delete tools go only to the agents that need them.
Read
Read documents with a filter, projection, sort and limit.
Run an aggregation pipeline and get the results.
Count what matches, or list the values of a field.
Read what is in the cluster.
Write
Add documents.
Change documents with update operators, or replace them.
Update a document if it exists, or insert it.
Add an index to a collection.
Delete
Remove documents that match a filter.
Triggers
An insert, update, replace or delete in a collection you watch, from its change stream.
Documents added, by an increasing field such as createdAt.
A trigger starts a workflow, and a workflow can include an AI agent step. In Code, a trigger delivers the event to your own endpoint.
Connect your AI agent to MongoDB. Four ways in, one set of permissions.
Claude, ChatGPT, Cursor
Create an MCP server in engini with your MongoDB connection and only the tools you choose. Add its address to your client and sign in through engini. There is no key to copy.
MCP client setup →Python and TypeScript
Hand your agent a toolset of MongoDB tools. The SDK gives OpenAI and Anthropic models the tools in the format they expect and runs the ones they pick.
SDK guide →For coding agents
The engini CLI connects MongoDB and runs its tools from a terminal, with machine-readable output, so an AI coding agent can drive it without getting stuck.
CLI guide →Any language
Every MongoDB tool is an endpoint. Call it with exact inputs from a scheduled job or a sync, with no model in the loop.
API reference →.cursor/mcp.json. Claude Code: claude mcp add.// .cursor/mcp.json: Cursor, connected to MongoDB through engini
{
"mcpServers": {
"engini-mongodb": {
"url": "<your engini MCP server address>"
}
}
}
Create the MCP server in engini with your MongoDB connection and the tools this agent may use, then paste its address. The client signs in through engini on first use. Claude, VS Code and other clients take the same address: see the MCP client setup guide.
Each request runs through the MongoDB tools in the agent's toolset or MCP server. If a tool is not allowed, the agent cannot call it.
What teams build on MongoDB. Agents and workflows, across systems.
Product data in the CRM
Sign-ups and usage from MongoDB become HubSpot or Salesforce contacts and account fields, so sales sees who is active.
Usage into invoices
Monthly usage aggregated in MongoDB becomes Stripe invoice items or NetSuite invoices.
Account details on the ticket
When a ticket arrives, an agent finds the user in MongoDB and adds plan, usage and recent errors as a note.
Changes that start work
A change stream on the orders collection starts fulfillment, posts to Slack and updates the ERP the moment an order is placed.
Every integration runs both ways, so any of these flows can also run in reverse. These are examples, not the limit: any flow between MongoDB and another system engini connects is available.
You decide what each agent may do in MongoDB. engini enforces it on every call.
Only the tools you allow
A toolset lists the MongoDB tools an agent may call and the connection each one uses. Give one agent read tools only and another the write it needs. engini refuses any call outside the toolset.
Scoped when you set them up
An MCP server exposes only the connections and tools chosen when it is created, and engini shows who uses each server.
Whose permissions apply
Connect a person's own MongoDB account and engini acts as that person, with their MongoDB permissions. Use a shared integration account and it acts as that account. Every run is recorded under the user who started it.
Kept out of prompts
Your agent never needs your credentials: engini stores them and adds them when it runs each call, so keys stay out of prompts and tool inputs.
Every call on record
Every call lands in History and the audit log, which you can export or stream to your SIEM.
Test before production
Workspaces keep teams apart, and development, staging and production environments keep a test agent away from live data.
MongoDB in a private network.
If MongoDB runs in your data center or a private VPC, install the engini On-Prem Agent next to it. It opens every connection itself, out to engini over HTTPS on port 443, so you open no inbound ports. Atlas clusters connect directly, with engini's addresses on the access list.
On-Prem Agent guide →Connect MongoDB in three steps. Then decide what each agent may do.
Sign in to MongoDB
Create a database user with only the roles the workflows need, such as read on one database for a read-only agent, then add a MongoDB connection with the connection string and that user.
Choose the tools
Add the connection to an MCP server or a toolset with only the tools each agent needs.
Build or ask
Use the connection as a step in a workflow, or ask your agent to work in MongoDB from Claude, ChatGPT, Cursor or your own code.
MongoDB and engini. Straight answers.
Can an AI agent write to MongoDB, or only read?
Both. engini has tools to insert, update, replace, upsert and delete documents and to create indexes. Whether a given agent may use them is up to you: give it a toolset or an MCP server with read tools only, and it cannot call the rest.
Does it work with Atlas and self-managed MongoDB?
Yes. Connect an Atlas cluster with its connection string, or a self-managed deployment through the On-Prem Agent. Change streams need a replica set or sharded cluster, which Atlas always is.
How do I keep a read-only agent read-only?
Give its toolset the read tools only, and connect a database user with the read role. engini refuses tools outside the toolset, and MongoDB refuses writes the user cannot make.
Does the agent act as me in MongoDB?
It acts as the database user in the connection string, with that user's roles. Every run is recorded under the person who started it.
Can a change in MongoDB start work?
Yes. A change stream on a collection you watch starts a workflow the moment a document is inserted, updated, replaced or deleted, and a scheduled trigger can check for new documents instead. A workflow can include an AI agent step.