Supported platforms
Prerequisites
- A MongoDB instance or Atlas cluster reachable from CloudThinker over the network.
- Admin access to create a dedicated database user and assign roles.
- The MongoDB connection string with credentials.
Setup
Select your MongoDB platform for specific connection instructions.- Self-hosted MongoDB
- MongoDB Atlas
1
Connect as admin
Connect to your MongoDB instance using the Mongo shell (
mongosh) with administrative privileges.Replace <admin-user>, <admin-password>, and <your-host> with your credentials. The /admin database is required.2
Switch to the admin database
Ensure you are on the
admin database where users are created:3
Create a read-only user
Create a dedicated user for CloudThinker using standard MongoDB built-in roles:The
clusterMonitor role is recommended for performance metrics analysis.4
Configure network access
Ensure CloudThinker can reach your database:
- Add CloudThinker IPs to your firewall or security group
- Ensure MongoDB is bound to an accessible IP address in
mongod.conf
5
Add the connection in CloudThinker
Navigate to Connections → MongoDB and paste your connection string:Include
tls=true if your deployment enforces TLS encryption. Click Connect. CloudThinker shows a Connected status once it succeeds.Connection details
Required permissions
Agent capabilities
Once connected, Tony can:Verify the connection
Example prompts
Troubleshooting
Authentication failed
Authentication failed
- Verify username and password are correct
- Ensure the user is created on the
admindatabase, or append?authSource=adminto your connection string - For Atlas: confirm the user was created with the correct privileges under Database Access
Connection refused or timeout
Connection refused or timeout
- Check that CloudThinker IPs are added to your Atlas Network Access list or your firewall
- For local MongoDB, ensure
bindIpinmongod.confis not set to only127.0.0.1
Security
- Least privilege — grant only the permissions the agents need for your use case; start read-only and widen later.
- Read-only by default — use read-only credentials unless you want agents to make changes through this connection.
- Rotate credentials — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
- Revoke on offboarding — remove the credential at the provider when you delete a connection or a teammate leaves.
- TLS required — always use
tls=truein the connection string to encrypt data in transit. - Minimal roles — grant only
readAnyDatabaseandclusterMonitor; never grant write or admin roles.
Related
Tony Agent
Database-focused optimization agent
PostgreSQL Connection
Setup instructions for PostgreSQL databases