< Back to all integrations

MongoDB

Data & Infrastructure

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 demo
[ MongoDB + engini ]

MongoDB 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.

MCPPython and TypeScript SDKCLIREST APIWorkflow Studio
Sign-inA MongoDB connection string with a database user
ReachDatabases, collections and documents, aggregation pipelines and indexes
TriggersChange streams, the moment a document changes
[ 01 / What agents can do ]

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

Find Documents, Find One Document

Read documents with a filter, projection, sort and limit.

Read
Aggregate

Run an aggregation pipeline and get the results.

Read
Count Documents, Distinct Values

Count what matches, or list the values of a field.

Read
List Databases, List Collections, Get Indexes

Read what is in the cluster.

Read

Write

Insert One, Insert Many

Add documents.

Write
Update One, Update Many, Replace One

Change documents with update operators, or replace them.

Write
Upsert Document

Update a document if it exists, or insert it.

Write
Create Index

Add an index to a collection.

Write

Delete

Delete One, Delete Many

Remove documents that match a filter.

Delete

Triggers

Document Changed

An insert, update, replace or delete in a collection you watch, from its change stream.

Event
Check for New Documents

Documents added, by an increasing field such as createdAt.

Scheduled

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.

[ 02 / Connect your agent ]

Connect your AI agent to MongoDB. Four ways in, one set of permissions.

MCP

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 →
SDK

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 →
CLI

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 →
REST API

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 →
MCP in four steps
In engini, connect MongoDB and create an MCP server with that connection and the tools this agent may use.
Claude: Settings, Connectors, Add custom connector, then paste the server address.
Cursor: add the address to .cursor/mcp.json. Claude Code: claude mcp add.
Sign in through engini when the client asks. The agent sees only the tools you chose.
Cursor, connected to MongoDB through engini
// .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.

Try asking your agent
“How many orders did we get from Texas this week?”
“Find the user with email dana@acme.com and show their plan.”
“Which accounts have usage over their limit this month?”
“Set the status of order 66f1a2 to shipped.”
“What are the top ten products by revenue, from the orders collection?”
“Which collections have no index on customerId?”

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.

[ 03 / What teams build ]

What teams build on MongoDB. Agents and workflows, across systems.

Product and revenue

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.

MongoDBHubSpotSalesforce
Finance

Usage into invoices

Monthly usage aggregated in MongoDB becomes Stripe invoice items or NetSuite invoices.

MongoDBStripeNetSuite
Support

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.

ZendeskIntercomMongoDB
Engineering

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.

MongoDBSlackNetSuite

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.

[ 04 / Agent Policy ]

You decide what each agent may do in MongoDB. engini enforces it on every call.

Toolsets

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.

MCP servers

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.

Identity

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.

Credentials

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.

Audit

Every call on record

Every call lands in History and the audit log, which you can export or stream to your SIEM.

Environments

Test before production

Workspaces keep teams apart, and development, staging and production environments keep a test agent away from live data.

SOC 2 Type IIISO 27001GDPRSecurity at engini →
[ Behind your firewall ]

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 →
[ 05 / Set up ]

Connect MongoDB in three steps. Then decide what each agent may do.

Step 01

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.

Step 02

Choose the tools

Add the connection to an MCP server or a toolset with only the tools each agent needs.

Step 03

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.

[ 06 / Questions ]

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.