v0.6.0: MCP Server
Mongoose Studio v0.6.0 adds an HTTP-based Model Context Protocol (MCP) server at <mount>/mcp.
More teams want to access data through agents and LLM clients like ChatGPT.com and Claude Web.
However, giving your agent direct access to production with mongosh is risky.
The much debated "my agent dropped my prod database" case is just one potential issue. An agent can also overload production with an unindexed query or too many queries in parallel. Agents still need to respect the user's roles and should not be able to execute actions that the user driving the agent can't. Finally, even OpenAI recommends not letting your agent read your MongoDB connection string directly.
Going forward, we're thinking of Mongoose Studio as a safe, auditable execution sandbox for both agents and humans, with guardrails such as rate limits, role-based access control, query timeouts through maxTimeMS, and data fuzzing. The new MCP server is one way to access this execution sandbox, but we're also building a web based shell and TUI as clients of the core sandbox.
Connect Codex
Mount Mongoose Studio as usual using Express - Mongoose Studio only supports MCP on Express currently.
Then point your agent or LLM client at its MCP endpoint.
For Codex, add the following to .codex/config.toml in your project.
Replace 3001 with whichever port your app with Mongoose Studio is mounted on.
Replace myprod.app with the public URL of your deployed application - only add the prod MCP server if you have a Mongoose Studio API key.
[mcp_servers.mongoose_studio_local]
url = "http://localhost:3001/studio/mcp"
[mcp_servers.mongoose_studio_prod]
url = "https://myprod.app/studio/mcp"
You can confirm the connection with codex mcp list.
For production, log in using codex mcp login mongoose_studio_prod.
The Codex CLI will open the following OAuth screen in your browser.
The OAuth screen allows you to grant the MCP server a subset of the permissions your user has.
Even if you are logged in as a Mongoose Studio user with admin permissions, you can configure the MCP server to be read-only.
You can also enforce a read preference and set a maxTimeMS for your OAuth session to prevent runaway queries - the maxTimeMS option tells MongoDB to treat queries that run for more than maxTimeMS as an error.
What Agents Can Do
The MCP server exposes Mongoose's Model, Dashboard, and Script actions:
- Model actions allow read/write of individual documents and document data, like
Model.updateDocumentto update a document orModel.getDocumentsto run a query. - Dashboard actions allow CRUD on dashboards, including executing dashboards.
- Script actions allow creating scripts to run in Mongoose Studio's sandbox.
In particular, agents can use Script.createScript to save a script in Mongoose Studio.
Creating a script does not execute it.
The response includes a review URL where you can open the script in Mongoose Studio, edit it, dry run it in a transaction that is aborted when the run finishes, or run it yourself.
Mongoose Studio deliberately uses this informal URL handoff instead of formal URL elicitation.
Support for formal URL elicitation is mixed across coding agents and clients, so we went with the informal approach for better support.
The available actions reflect the caller's Mongoose Studio role. For example, readonly users can inspect documents and create a script for review, but cannot change documents or delete dashboards.
Local Development and Production Authentication
Without an API key, MCP is enabled by default and requires no login.
It uses Mongoose Studio's existing bindIp protection: by default it accepts only localhost connections, and you can add trusted addresses with the bindIp option.
That enables easy local MCP with no authentication, but prevents any remote addresses from connecting, so you can run Mongoose Studio locally on coffee shop WiFi.
You can also set mcp: false to disable MCP.
For a production deployment with an apiKey, you need to explicitly set mcp: true and provide the public URL where Mongoose Studio is mounted.
app.use('/studio', await studio('/studio/api', mongoose, {
apiKey: process.env.MONGOOSE_STUDIO_API_KEY,
mcp: true,
publicUrl: 'https://myproduct.app/studio'
}));
In this configuration, Mongoose Studio is the OAuth protected resource and the Mongoose Studio mothership is the authorization server. Users need to authorize the MCP server via OAuth first.
What's Next
We've just started work on the MCP server - there's a lot of opportunities to add more delightful utilities. Here's a preview of some of the things we're working on:
- MCP Apps and/or URL elicitation based visualizations. There are a lot of cases where markdown output just isn't enough. However, support for MCP Apps and URL elicitation is inconsistent across clients. The fact that Mongoose Studio is web-based makes our informal URL elicitation uniquely powerful - your agent can already structure Mongoose Studio URLs to display data in different formats, like displaying the results of a query on a map.
- Rate limiting, data fuzzing, and collection-level access control in the sandbox. Configuring
maxTimeMS, role-based access control, and script dry runs have been enough to alleviate most of our concerns about agents executing scripts directly against production. But we're run into a few cases where the agent executes more queries in parallel than we're comfortable with, or cases where the agent starts reading potentially sensitive data from the database (access tokens, API keys, etc.). - Web-based shell as a replacement for the current Chat tab. The Chat tab was amazing when we first introduced it in mid-2025; but in 2026 it isn't anywhere near as sophisticated as a modern coding agent. MCP and MCP Apps will ideally allow replacing the Chat tab with your preferred LLM client, and allow us to repurpose the Chat tab into a web-based shell/TUI with LLM code generation built in.
Want to follow along? Follow @mongoosestudio_ on X for updates, experiments, and release notes.
If Mongoose Studio is useful to your team, give us a star on GitHub.