1M

1rb/mongo-mcp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

15 stars 9 forks Качество 55 Тренд 21

MCP server that provide tools to LLMs such as claude in cursor to interact with MongoDB

Обзор

A Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases. Query collections, inspect schemas, and manage data seamlessly through natural language. The Model Context Protocol (MCP) is an open standard developed by Anthropic that creates a universal way for AI systems to connect with external data sources and tools. MCP establishes a standardized communication channel between: - : AI assistants like Claude that consume data (e.g., Claude Desktop, Cursor.

README

Показан фрагмент оригинального README. Открыть оригинал.

🗄️ MongoDB MCP Server for LLMS

A Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases. Query collections, inspect schemas, and manage data seamlessly through natural language.

📚 What is Model Context Protocol (MCP)?

The Model Context Protocol (MCP) is an open standard developed by Anthropic that creates a universal way for AI systems to connect with external data sources and tools. MCP establishes a standardized communication channel between:

  • MCP Clients: AI assistants like Claude that consume data (e.g., Claude Desktop, Cursor.ai)
  • MCP Servers: Services that expose data and functionality (like this MongoDB server)

Key benefits of MCP:

  • Universal Access: Provides a single protocol for AI assistants to query data from various sources
  • Standardized Connections: Handles authentication, usage policies, and data formats consistently
  • Sustainable Ecosystem: Promotes reusable connectors that work across multiple LLM clients

✨ Features

  • 🔍 Collection schema inspection
  • 📊 Document querying and filtering
  • 📈 Index management
  • 📝 Document operations (insert, update, delete)
  • 🔒 Secure database access through connection strings
  • 📋 Comprehensive error handling and validation

📋 Prerequisites

Before you begin, ensure you have:

You can verify your Node.js installation by running:

node --version  # Should show v18.0.0 or higher

🚀 Quick Start

To get started, find your MongoDB connection URL and add this configuration to your Claude Desktop config file:

MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "mongodb": {
      "command": "npx",
      "args": [
        "mongo-mcp",
        "mongodb://:@:/?authSource=admin"
      ]
    }
  }
}

Installing via Smithery

Smithery.ai is a registry platform for MCP servers that simplifies discovery and installation. To install MongoDB MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install mongo-mcp --client claude

Cursor.ai Integration

To use MongoDB MCP with Cursor.ai:

  1. Open Cursor.ai and navigate to Settings > Features
Открыть полный README на GitHub

Установка

npx mongo-mcp mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "mongodb": { "command": "npx", "args": [ "mongo-mcp", "mongodb://<username>:<password>@<host>:<port>/<database>?authSource=admin" ] } } }