Run it yourself, or get a cluster
Use the hosted playground, run it on your machine against a local MongoDB, or point it at a real Atlas cluster: your own free one, or a temporary ephemeral one. Agents can use it over MCP or the REST API.
Atlas CLI flags change between releases: check atlas <command> --help before relying on these.
Which one should I use?
- Just try it, nothing to install: Use the hosted playground
- Call it from an AI agent, a script or CI: Use it from an agent (MCP)
- Work offline with Atlas Search and Vector Search, no account: Run locally with the Atlas CLI (no account, includes Atlas Search)
- Run everything in containers: Docker Compose
- A desktop app on a local MongoDB: Desktop app (Tauri)
- Keep your data in the cloud, free: Free-forever Atlas cluster (M0)
- A temporary cloud cluster for a demo or workshop: Ephemeral Atlas cluster (temporary, expires in 7 days)
Use it now
Use the hosted playground
Nothing to install. The web app, the REST API and the MCP server are the same service.
- Open the web app
- Run a script through the API
curl -s -X POST https://mongoplayground.com/api/v1/run -H 'content-type: application/json' -d '{"script": "db.collection.find({age: {$gt: 40}})", "config": "db = { collection: { documents: [{name: \"Ada\", age: 36}, {name: \"Linus\", age: 55}] } }"}'
Use it from an agent (MCP)
A stateless Streamable HTTP MCP server. Tools: run_query, validate_query, explain_query, share_query, get_shared, export_playground, list_examples, get_setup_guide, get_limits.
- Claude Code
claude mcp add --transport http mongodb-playground https://mongoplayground.com/mcp
- Any MCP client (JSON config)
{"mcpServers": {"mongodb-playground": {"type": "http", "url": "https://mongoplayground.com/mcp"}}}
Run it on your machine
Run locally with the Atlas CLI (no account, includes Atlas Search)
A local MongoDB in Docker with Atlas Search and Vector Search, then the API and web app on your machine.
- Install the Atlas CLI
brew install mongodb-atlas-cli
- Create a local deployment
atlas local setup playground --port 27017 --force
- Run the API (it also serves the web app)
MONGODB_URI='mongodb://localhost:27017/?directConnection=true' cargo run -p playground-api
- Open it
- Delete the deployment when you are done
atlas local delete playground --force
Docker Compose
The API, the web app and an Atlas Local MongoDB (search works) in one command.
- Start it
docker compose up --build
Desktop app (Tauri)
Runs queries in-process against a local MongoDB. No network service.
- Run it
cd web && npm install && npm run tauri dev
Use a real Atlas cluster
Free-forever Atlas cluster (M0)
A free cluster in your own Atlas account: 512 MB, no credit card, one per project. It stays until you delete it, so your data persists.
- Register for Atlas
- Or from the terminal: sign in and create a free cluster
atlas setup
- Allow your IP address
atlas accessLists create --currentIp
- Get the connection string
atlas clusters connectionStrings describe <cluster-name>
- Optional: load the sample datasets (then use Data: Atlas sample data)
atlas clusters sampleData load <cluster-name>
- Point the API at it
MONGODB_URI='<connection string>' cargo run -p playground-api
- When you are done, delete the cluster if you do not want to keep it
atlas clusters delete <cluster-name> --force
Ephemeral Atlas cluster (temporary, expires in 7 days)
A temporary free Atlas cluster created from the terminal. Atlas pauses it 2 days after creation and deletes it 7 days after creation unless you claim it into an Atlas account, which turns it into a normal free cluster with no expiry. Until it is claimed you can read and write data, but you cannot scale it, add database users or change network access. It runs on AWS us-east-1 and accepts connections from any IP address, so keep sensitive data out. This is a preview Atlas API: it can change, and creating one means you accept the MongoDB Cloud Terms of Service.
- Check that your Atlas CLI has the command (upgrade the CLI if it is missing)
atlas api ephemeralClusters createEphemeralCluster --help
- Create the cluster. The request body is described in the Atlas Admin API docs; the response has the connection and claim details
atlas api ephemeralClusters createEphemeralCluster --file request.json
- Request body reference (preview API)
- Point the API at it, using the connection string from the response
MONGODB_URI='<connection string from the response>' cargo run -p playground-api
- Look it up again later
atlas api ephemeralClusters getEphemeralCluster --help
- Keep it or let it go: claim it within 7 days using the claim details, or do nothing and Atlas deletes it. There is nothing to clean up
All pages are available as Markdown: see llms.txt.