Robtic MongoDB Atlas Bot is a self-hosted Discord bot that lets your server members create and manage their own MongoDB Atlas databases entirely through Discord — no Atlas dashboard, no manual setup.
When a user requests a database, the bot:
- Calls the MongoDB Atlas API to create a dedicated database user with scoped
readWriteaccess - Generates a secure connection string
- Delivers the credentials privately via DM so no one else sees them
Everything is managed through a clean panel UI posted in a channel using /setup. Admins keep full control — only users with Manage Guild permission can deploy the panel.
| Feature | Description |
|---|---|
| Create Database | Provision a new MongoDB Atlas database with auto-generated credentials |
| Show Database | View your current database info and access management actions |
| Reset Password | Generate a new secure password for your database user |
| IP Access Manager | Whitelist an IP address in your Atlas project's access list |
| Delete Database | Soft-delete with a 15-day recovery window before permanent removal |
| Recover Database | Restore a database that is pending deletion |
| Auto Cleanup | Daily job that permanently purges expired soft-deleted databases |
| Audit Logging | All actions are logged to a designated Discord channel |
Coming Soon — A full walkthrough video showing how to set up and use the bot will be available shortly. Stay tuned in our Discord server.
- Bun v1.0 or later (recommended)
or Node.js v18+ - A Discord Application with a bot token
- A MongoDB Atlas account with an existing cluster
- An Atlas API key with Project Owner or Project Data Access Admin permissions
git clone https://github.com/robticorg/mongodb-atlas-discord-bot.git
cd mongodb-atlas-discord-bot# Recommended
bun install
# Or with npm
npm installCopy the example file and fill in your values:
cp .env.example .envThen open .env and fill in each value (see the Environment Variables section below).
# Development (auto-restarts on file changes)
bun dev
# Production
bun startnpm users: Replace
bunwithnpm run— e.g.npm run start/npm run dev
Below is every variable in .env.example with instructions on where to find each one.
# ── Discord ──────────────────────────────────────────────────────────────────
DISCORD_TOKEN=
DISCORD_CLIENT_ID=
# ── MongoDB Atlas API ─────────────────────────────────────────────────────────
ATLAS_PUBLIC_KEY=
ATLAS_PRIVATE_KEY=
ATLAS_PROJECT_ID=
ATLAS_CLUSTER_NAME=
# ── Logging ───────────────────────────────────────────────────────────────────
LOG_GUILD_ID=
LOG_CHANNEL_ID=
# ── Internal ──────────────────────────────────────────────────────────────────
DATABASE_FILE=database.sqliteYour bot's secret token used to log in to Discord.
- Go to the Discord Developer Portal
- Select your application (or create a new one)
- Navigate to Bot in the left sidebar
- Click Reset Token → copy the token
Keep this secret. Never commit it to source control.
Your application's client (app) ID, used to register slash commands.
- Go to the Discord Developer Portal
- Select your application
- On the General Information page, copy the Application ID
The public key of your MongoDB Atlas API key pair. This is the "username" for API authentication.
- Log in to cloud.mongodb.com
- In your Organization, go to Access Manager → API Keys
- Click Create API Key
- Set a description, assign at least Organization Member role
- On the project level, go to Project Settings → Access Manager → API Keys and grant the key Project Owner (or Project Data Access Admin) access
- Copy the Public Key
The private key of the same Atlas API key pair. Shown only once at creation time.
Copy it immediately after creating the API key — it cannot be retrieved again.
The ID of the Atlas project (also called "Group ID") that contains your cluster.
- In Atlas, open your project
- Go to Project Settings
- Copy the Project ID shown at the top of the page
The exact name of your Atlas cluster as it appears in the Atlas dashboard.
- In Atlas, click Clusters in the left sidebar
- Use the cluster name shown in bold (e.g.
Cluster0)
The name is case-sensitive.
The Discord server (guild) ID where audit logs will be posted.
- Enable Developer Mode in Discord: User Settings → Advanced → Developer Mode
- Right-click your server name in the sidebar
- Click Copy Server ID
The ID of the channel where the bot will send audit log messages.
- With Developer Mode enabled, right-click the target channel
- Click Copy Channel ID
Path to the SQLite file used for local state. Defaults to database.sqlite in the project root. You can leave this as-is unless you need a custom path.
When creating your bot invite link, the bot requires the following permissions:
- Send Messages
- Embed Links
- Read Message History
- Use External Emojis
Generate an invite URL from the OAuth2 → URL Generator page in the Developer Portal, selecting the bot and applications.commands scopes.
Need help? There are two ways to reach us:
Join our Discord server for real-time support, announcements, and to connect with other users:
For private inquiries or business contact, reach out at:
This project is licensed under the MIT License — see the LICENSE file for details.
© 2026 Robtic Organization
