Install the package
Add Mongoose Studio to your existing Node.js project. Works with your installed Mongoose models.
npm install @mongoosejs/studioAdd Mongoose Studio to your existing application, then explore your MongoDB data using the Mongoose models and connections you already have. No separate desktop client required.
Choose your framework, copy the code, and open Studio inside the app you already run. Advanced configuration can wait until you need it.
Add Mongoose Studio to your existing Node.js project. Works with your installed Mongoose models.
npm install @mongoosejs/studioChoose the framework you use. Using NestJS? See the NestJS quick start.
Mount Mongoose Studio as middleware in your Express app. The example assumes you've connected Mongoose already; remember to use await.
const mongoose = require('mongoose');
const studio = require('@mongoosejs/studio/express');
// After setting up your Express app and Mongoose connection:
app.use('/studio', await studio('/studio/api', mongoose));/studio if needed, and keep the API path consistent.Deploy Studio alongside a Next.js application on Vercel. There are two small configuration steps.
next.config.jsimport withMongooseStudio from '@mongoosejs/studio/next';
export default withMongooseStudio({
reactStrictMode: true,
});pages/api/studio.js// Import your existing database connection
import db from '../../src/db';
import { vercelAPIRouteHandler } from '@mongoosejs/studio/vercel';
export default vercelAPIRouteHandler(
db, // Mongoose connection or Mongoose global
{
apiKey: process.env.MONGOOSE_STUDIO_API_KEY // optional, for Mongoose Studio Pro
}
);pages/api/studio.js even if the rest of your app uses the App Router. Pages Router API routes work alongside the App Router in the same project.Run your application, then visit the Studio route in your browser.
With the app running on port 3000 and Studio mounted at /studio, open http://localhost:3000/studio. Your port and route may differ.
Authentication is not enabled by default in local development. Do not expose an unauthenticated Studio endpoint publicly. Configure an appropriate Solo or Pro production authentication setup before deploying.
The core installation is complete. Expand the options relevant to your app, or connect AI agents to your workflow.
If your Express app uses mongoose.createConnection(), pass the connection to the middleware rather than the Mongoose global.
const mongoose = require('mongoose');
const studio = require('@mongoosejs/studio/express');
const connection = mongoose.createConnection(
'mongodb://localhost:27017/mydb'
);
app.use('/studio', await studio('/studio/api', connection));Pass options to the middleware for your paid API key and optional AI providers. Store secrets in environment variables, not in frontend code.
const opts = {
apiKey: process.env.MONGOOSE_STUDIO_API_KEY,
model: 'gpt-4o-mini',
openAIAPIKey: process.env.OPENAI_API_KEY,
anthropicAPIKey: process.env.ANTHROPIC_API_KEY,
googleGeminiAPIKey: process.env.GOOGLE_GEMINI_API_KEY
};
app.use('/studio', await studio('/studio/api', mongoose, opts));Only include provider options you use.
Pass your Mongoose Studio Pro API key and optional AI provider keys to the Vercel API route handler. Pass null instead of a connection to use the Mongoose global.
import db from '../../src/db';
import { vercelAPIRouteHandler } from '@mongoosejs/studio/vercel';
export default vercelAPIRouteHandler(db, {
apiKey: process.env.MONGOOSE_STUDIO_API_KEY,
model: 'gpt-4o-mini',
openAIAPIKey: process.env.OPENAI_API_KEY,
anthropicAPIKey: process.env.ANTHROPIC_API_KEY,
googleGeminiAPIKey: process.env.GOOGLE_GEMINI_API_KEY
});See the Next.js / Vercel quick start for App Router and src/ layouts.
Mongoose Studio is free for local development. Solo adds production OAuth authentication for a single user, and Pro adds role-based access control for team use. Choose the appropriate plan and confirm that authentication is enforced before you publish a route to the internet.
Compare Free, Solo, and Pro ↗