MongoDB MCP Server logo

MongoDB MCP Server

by mongodb-developer

The MongoDB MCP Server provides read-only access to MongoDB databases, enabling LLMs to inspect collection schemas and execute aggregation pipelines. It facilitates interaction between LLMs and MongoDB data.

View on GitHub

Last updated: N/A

What is MongoDB MCP Server?

The MongoDB MCP Server is a Model Context Protocol server designed to allow Large Language Models (LLMs) to interact with MongoDB databases. It provides capabilities to inspect collection schemas and execute aggregation pipelines in a read-only manner.

How to use MongoDB MCP Server?

To use the server, configure it within an application like Claude Desktop by adding the provided JSON configuration to the 'mcpServers' section. Ensure the MONGODB_URI environment variable is set to a valid MongoDB connection string. Then, use the 'aggregate' and 'explain' tools with the required input parameters to query and analyze your MongoDB data.

Key features of MongoDB MCP Server

  • Read-only access to MongoDB databases

  • Collection schema inspection

  • Aggregation pipeline execution

  • Execution plan analysis

  • Automatic document limit and timeout for safety

Use cases of MongoDB MCP Server

  • Enabling LLMs to answer questions based on MongoDB data

  • Generating insights from MongoDB data using LLMs

  • Validating data quality using LLMs and aggregation pipelines

  • Automating data analysis tasks with LLMs

FAQ from MongoDB MCP Server

What is the default document limit?

The default document limit is 1000 if no limit stage is specified in the aggregation pipeline.

What is the default timeout?

The default timeout for all operations is 30 seconds.

Is the server read-only?

Yes, the server provides read-only access to MongoDB databases.

How is the schema inferred?

The schema is derived from sampling collection documents.

What kind of license does this server use?

This MCP server is licensed under the MIT License.