Data & Storage · Integration
MongoDB
Add MongoDB to your product for your customers, and give your AI agents governed access to it.
A MongoDB integration embedded in your product means a customer's documents stay in their own cluster while your app inserts, updates and reads them, and runs aggregation pipelines to summarise them. Collections, documents and indexes are the units you work with, and no SQL is involved: filters and pipeline stages do that job instead. The genuinely awkward part is that MongoDB enforces no fixed schema, so two documents in one collection can carry different fields, and a field your product depends on may simply be absent from older records. Treating that as per-tenant mapping with sensible fallbacks beats discovering it in production. fastn keeps each connection string and credential set per tenant and maintains the driver surface.
In your product
Embedded for your customers. Per-tenant auth, no per-customer code, maintained by fastn.
Have each customer connect their own cluster, so your product inserts and queries documents in collections they already operate.
Run an aggregation pipeline on the customer's side so a summary comes back small instead of pulling a whole collection over the wire.
Map the field names and nesting a customer's documents actually use, including the fields older records are missing.
React to an inserted or updated document so your product notices a change without polling the collection.
For your AI agents
Governed, audited access for the agents you build, through the MCP server.
An agent filters a collection to answer a question, restricted to that tenant's own database and logged.
An agent updates a document within the permissions granted, and the fields it changed are recorded.
An agent runs a permitted aggregation pipeline, and the stages it used are recorded alongside the answer.
Example prompt
Run an aggregation over the orders collection for this month and group the totals by status.
Set up MongoDB in 4 steps
- 01Enable the MongoDB connector from your fastn dashboard.
- 02Have each customer authorise their own MongoDB account, so calls run under their credentials rather than a shared key.
- 03Decide which records, datasets and fields your product needs, map those fields, then enable the actions and triggers you want.
- 04Call it from your product and expose it to your agents through the same governed connection.
Why teams use the MongoDB integration
What you get by embedding it with fastn instead of building it yourself.
- Ship a MongoDB integration without building it. Your customers connect their own MongoDB account inside your product and work their records, datasets and fields there, with no per-customer code on your side.
- Handle the part that actually costs time: schemas differ per customer and change without notice, and volumes can be large. fastn owns the auth, token refresh, rate limits, pagination and breaking-change fixes, so a MongoDB update is not your on-call problem.
- One integration serves your product and your agents. The same governed MongoDB connection powers in-product features and gives AI agents scoped, audited access, so you read and write your customers' data where it already lives without wiring it twice.
Used by these teams
Compare with
Often used alongside
Tools the same teams tend to run next to MongoDB, across other categories.
MongoDB integration FAQ
How do I add a MongoDB integration to my product?
Enable the MongoDB connector in your fastn dashboard, then let each customer authenticate their own MongoDB account. fastn handles the OAuth flow, token storage and refresh per tenant, so there is no MongoDB client code in your app and no per-customer branch in your codebase. Setup is 4 steps.
Do my customers each connect their own MongoDB account?
Yes. Every connection is scoped to the individual customer, so each authorises their own MongoDB account and only ever sees their own records, datasets and fields. That per-tenant isolation is the point of an embedded integration: you support the long tail of customer setups without maintaining an integration per customer.
Can AI agents use this MongoDB integration?
Yes. The same connection is exposed to your agents through the fastn MCP gateway, with permissions scoped per tenant and every call audited. An agent filters a collection to answer a question, restricted to that tenant's own database and logged.
Who maintains the MongoDB integration?
fastn does. When MongoDB changes an endpoint, deprecates a field or alters its auth, the fix lands in the connector rather than in your backlog, and your customers' connections keep working.
Does the MongoDB integration adapt when a customer's schema changes?
Schema and field mapping is configuration per customer, so a change on their side is a mapping update rather than a code change and a release on yours.
How are large MongoDB reads handled?
Pagination and throttling are handled for you, and initial backfills are rate-limited so a large import does not exhaust a customer's API allowance.
What can I build with the MongoDB integration?
A common starting point: have each customer connect their own cluster, so your product inserts and queries documents in collections they already operate. Teams also use it for the other use cases listed above, and expose it to agents for governed reads and writes.
How much does the MongoDB integration cost?
It is included. Pricing is based on connected accounts, not on how many connectors you enable, so adding MongoDB does not change your per-connector cost. You can start free with 3 connected accounts.
Add MongoDB to your product
Start free with 3 connected accounts. No sales call required, and no per-customer integration code.