Provides a bridge between MongoDB databases and conversational interfaces, enabling comprehensive database operations, collection management, schema inspection, and Atlas cloud service interactions with authentication and telemetry support.
Determine which authentication method you want to use:
- If you want to connect directly to a MongoDB instance, you’ll need a MongoDB connection string.
- If you want to use MongoDB Atlas tools (for organization, clusters, or database users), you’ll need to create a Service Account API client ID and secret from MongoDB Atlas.
Obtain your MongoDB connection string (for direct database access):
- If you are using MongoDB Atlas:
- Log in to MongoDB Atlas.
- Select your project and cluster.
- Click Connect.
- Choose Connect your application.
- Copy the connection string (looks like
mongodb+srv://username:password@cluster.mongodb.net/myDatabase
).
- Replace
username
, password
, and myDatabase
with your actual database credentials.
- If you are using a self-hosted MongoDB:
- Your connection string will be in the format:
mongodb://username:password@host:port/database
.
To use Atlas API tools, obtain API credentials:
- Create a Service Account in MongoDB Atlas:
- Log in to MongoDB Atlas.
- Navigate to Access Manager > Organization Access.
- Click Add New > Applications > Service Accounts.
- Enter a name, description, and expiration (e.g., “MCP, MCP Server Access, 7 days”).
- Assign only the minimum necessary permissions for your use case.
- Click Create.
- Save Client Credentials:
- After creation, you’ll see the Client ID and Client Secret.
- Copy and save the Client Secret immediately; it will not be shown again.
- Add your IP address to the Atlas API access list.
- Still in the Atlas dashboard, go to API Access/Access List.
- Add your current IP address or a range to allow API access.
- Assign minimum permissions for required operations:
- For basic reading, “Project Read Only” (Project level) is generally sufficient.
- For advanced tooling, follow the roles table in the README.
Fill in values in the FastMCP connection interface:
- Click the Install Now button in your environment.
- Use the FastMCP interface to add your keys:
- For MongoDB connection string: Enter it into the field labeled
MDB_MCP_CONNECTION_STRING
.
- For Atlas API: Enter your
MDB_MCP_API_CLIENT_ID
and MDB_MCP_API_CLIENT_SECRET
in the provided fields.
- Only one method is required: either a connection string (for direct DB access) or API credentials (for Atlas operations).
Finish Setup:
- Save changes in FastMCP.
- The server will now have access to your MongoDB database or Atlas project according to the credentials provided.
Summary Table of Required Information:
Option |
FastMCP Field(s) |
Where to get it |
Direct MongoDB |
MDB_MCP_CONNECTION_STRING |
MongoDB Atlas UI or self-hosted config |
Atlas API (recommended) |
MDB_MCP_API_CLIENT_ID and MDB_MCP_API_CLIENT_SECRET |
Atlas Service Account setup in Atlas UI |