MongoDB
OfficialProvides a bridge between MongoDB databases and conversational interfaces, enabling comprehensive da...
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, andmyDatabasewith 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.
- Your connection string will be in the format:
- If you are using MongoDB Atlas:
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.
- Create a Service Account in MongoDB Atlas:
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_IDandMDB_MCP_API_CLIENT_SECRETin the provided fields.
- For MongoDB connection string: Enter it into the field labeled
- 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 |
How to Install MongoDB
Install MongoDB MCP server with one click through FastMCP. Choose your preferred AI development tool below:
Claude Desktop
Click "Claude Desktop" in Quick Start
Cursor IDE
Click "Cursor IDE" in Quick Start
VS Code
Click "VS Code" in Quick Start
MongoDB is an officially maintained MCP server, verified by the FastMCP team.
Alternatives to MongoDB
Looking for similar MCP servers? Browse other servers in the same categories on FastMCP, or check out the similar servers listed above.
Quick Start
Choose Connection Type for
Authentication Required
Please sign in to use FastMCP hosted connections
Run MCP servers without
local setup or downtime
Access to 1,000+ ready-to-use MCP servers
Skip installation, maintenance, and trial-and-error.
No local setup or infra
Run MCP servers without Docker, ports, or tunnels.
Always online
Your MCP keeps working even when your laptop is off.
One secure URL
Use the same MCP from any agent, anywhere.
Secure by default
Encrypted connections. Secrets never stored locally.
Configuration for
Environment Variables
Please provide values for the following environment variables:
HTTP Headers
Please provide values for the following HTTP headers:
started!
The MCP server should open in . If it doesn't open automatically, please check that you have the application installed.
Copy and run this command in your terminal:
Make sure Gemini CLI is installed:
Visit Gemini CLI documentation for installation instructions.
Make sure Claude Code is installed:
Visit Claude Code documentation for installation instructions.
Installation Steps:
Configuration
Installation Failed
Related Articles
Best MCP Servers for Database & Supabase in 2026
Jan 3, 2026
Discover the best database MCP servers for Supabase, PostgreSQL, MySQL, MongoDB and more. One-click install for Claude Desktop, Cursor, and VS Code.
Building MCP Servers with .NET: From Development to Publication
Jul 17, 2025
Building MCP Servers with .NET: From Development to Publication
More for Database
View All →Supabase MCP Server
Connect Supabase projects directly with AI assistants using the Model Context Protocol (MCP). This server standardizes communication between Large Language Models and Supabase, enabling AI to manage tables, query data, and interact with project features like edge functions, storage, and branching. Customize access with read-only or project-scoped modes and select specific tool groups to fit your needs. Integrated tools cover account management, documentation search, database operations, debugging, and more, empowering AI to assist with development, monitoring, and deployment tasks in your Supabase environment efficiently and securely.
Svelte
Official Svelte documentation access and code analysis server that provides up-to-date reference material, playground link generation, and intelligent autofixer capabilities for detecting common patterns, anti-patterns, and migration opportunities in Svelte 5 and SvelteKit projects.