MongoDB MCP Server logo

MongoDB MCP Server

by MCP-Mirror

The MongoDB MCP Server provides read-only access to MongoDB databases, enabling LLMs to inspect collection schemas and execute aggregation pipelines. It allows for querying and analyzing data within MongoDB using tools like 'aggregate' and 'explain'.

View on GitHub

Last updated: N/A

What is MongoDB MCP Server?

A Model Context Protocol (MCP) server that provides read-only access to MongoDB databases. It allows Large Language Models (LLMs) to inspect collection schemas and execute aggregation pipelines for data analysis.

How to use MongoDB MCP Server?

To use this server with an application like Claude Desktop, configure the 'mcpServers' section with the provided JSON snippet, ensuring to replace placeholders like '<yourcluster>' with your actual MongoDB connection URI. The server then exposes tools like 'aggregate' and 'explain' that can be used to query and analyze data within MongoDB.

Key features of MongoDB MCP Server

  • Read-only access to MongoDB

  • Collection schema inspection

  • Aggregation pipeline execution

  • Query explanation

  • Automatic document limit

  • Default operation timeout

Use cases of MongoDB MCP Server

  • Data analysis with LLMs

  • Schema exploration for AI applications

  • Query optimization using explain plans

  • Integrating MongoDB data with Claude Desktop

  • Building AI-powered applications on top of MongoDB data

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 for operations?

The default timeout for all operations is 30 seconds.

Is the server read-only?

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

How is the schema inferred?

The schema is derived from sampling collection documents.

What is the license?

This MCP server is licensed under the MIT License.