MongoDB MCP Server

MongoDB MCP Server is an MCP server that provides tools and prompts for interacting directly with a MongoDB database. Built using Node.js and Mongoose, this server allows developers and data engineers to manage user records within a MongoDB instance using standard Model Context Protocol clients like Claude for Desktop and Cursor. The server handles common database tasks through dedicated operations such as creating user profiles, looking up specific users by their unique email addresses, and retrieving paginated lists of stored users. It includes comprehensive error management and graceful shutdown routines that ensure database connections close cleanly during process termination signals. Designed with a single-file architecture, it serves both as a functional database adapter and as an educational reference implementation for connecting local or remote MongoDB instances to large language model interfaces.

Category: Databases & Data Stores

Tags: database, mongodb, nosql, query

Visit MongoDB MCP Server

How to install and configure MongoDB MCP Server

  1. Ensure Node.js and MongoDB (v8.0 or higher) are installed and running. 2. Clone the repository and install dependencies: bash git clone https://github.com/jb-7-jay/learn-mcp-server-mongo cd learn-mcp-mongo npm install 3. Copy the example environment file and set your database connection: bash cp .env.example .env 4. Update MONGODB_URI in .env if your configuration differs from mongodb://localhost:27017. 5. Register the server in Claude Desktop by editing ~/Library/Application Support/Claude/claude_desktop_config.json: json { "mcpServers": { "mcp-mongo": { "command": "node", "args": ["/absolute/path/to/server.js"] } } } 6. Restart Claude for Desktop to load the tools.

What you can do with MongoDB MCP Server

  • Creating new user records directly through conversational prompts with validated name, email, and age attributes. - Retrieving specific user profiles from MongoDB by searching for a unique email address via natural language. - Listing stored database users with customizable pagination limits to inspect records without executing manual queries. - Guiding team members through new user onboarding prompts using interactive predefined MCP prompt workflows. - Testing and debugging local MongoDB queries through Cursor's AI interface during application development.

Key facts

  • https://github.com/jb-7-jay/learn-mcp-server-mongo
  • Databases & Data Stores
  • database, mongodb, nosql, query

Part of MCP Servers

Related MCP servers

  • MCP Memory Keeper — MCP Memory Keeper is an MCP server that provides persistent context management and memory storage for Claude AI coding assistants.…
  • MCP Notes — MCP Notes is an MCP server that provides note-taking and note-management capabilities to AI models using Amazon Web Services DynamoDB…
  • MCP Neo4j Server — MCP Neo4j Server is an MCP server that provides an integration between the Neo4j graph database and Model Context Protocol…
  • MCP Memory Toolkit — MCP Memory Toolkit is an MCP server that provides persistent memory capabilities for Claude and other compatible assistants using ChromaDB.…
  • MCP Memory Server — MCP Memory Server is an MCP server that integrates Claude Desktop with Azure Cosmos DB and OpenAI embeddings to provide…
  • MCP MS SQL Server — MCP MS SQL Server is an MCP server that provides a standardized Model Context Protocol interface for AI models to…

What tools are included with MongoDB MCP Server?

The server includes three primary tools for user management: create-user to add a new document with name, email, and age; get-user to locate an individual record using an email address; and list-users to view stored documents with pagination support.

Which MCP clients work with MongoDB MCP Server?

The server is built to work with any client supporting the Model Context Protocol, including Claude for Desktop and the Cursor code editor. Setup requires referencing the node executable and the absolute path to server.js in your client configuration.

What are the system prerequisites?

You need the latest LTS release of Node.js and MongoDB version 8.0 or higher running locally or accessible via a remote connection string. A supported client like Claude for Desktop or Cursor is also required.

How do I configure custom MongoDB credentials?

Copy the provided .env.example file to .env in the project directory, then update the MONGODB_URI variable with your custom MongoDB connection string before launching the server.

  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories