Skip to main content
Glama

MongoDB MCP Server for LLMs

by spirita1204
MIT License
340
  • Apple

🗄️ LLMS 向け MongoDB MCP サーバー

LLMがMongoDBデータベースと直接やり取りできるようにするモデルコンテキストプロトコル(MCP)サーバー。コレクションのクエリ、スキーマの検査、そして自然言語によるシームレスなデータ管理を実現します。

✨ 特徴

  • 🔍 コレクションスキーマ検査
  • 📊 ドキュメントのクエリとフィルタリング
  • 📈 インデックス管理
  • 📝 ドキュメント操作(挿入、更新、削除)

デモビデオ

https://github.com/user-attachments/assets/2389bf23-a10d-49f9-bca9-2b39a1ebe654

🚀 クイックスタート

開始するには、mongodb 接続 URL を見つけて、次の構成を Claude Desktop 構成ファイルに追加します。

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

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

Smithery経由でインストール

Smithery経由で Claude Desktop 用の MongoDB MCP Server を自動的にインストールするには:

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

前提条件

  • Node.js 18歳以上
  • npx
  • Docker および Docker Compose (ローカル サンドボックス テストのみ)
  • MCP クライアント (例: Claude デスクトップ アプリ)

テストサンドボックスのセットアップ

接続するmongo dbサーバーがなく、サンプルサンドボックスを作成したい場合は、次の手順に従ってください。

  1. Docker Compose を使用して MongoDB を起動します。
docker-compose up -d
  1. データベースにテストデータを入力します。
npm run seed

Claudeデスクトップの設定

この構成を Claude Desktop 構成ファイルに追加します。

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

ローカル開発モード:
{ "mcpServers": { "mongodb": { "command": "node", "args": [ "dist/index.js", "mongodb://root:example@localhost:27017/test?authSource=admin" ] } } }

テストサンドボックスのデータ構造

シード スクリプトは、サンプル データを含む 3 つのコレクションを作成します。

ユーザー
  • 個人情報(名前、メールアドレス、年齢)
  • 座標を含むネストされた住所
  • さまざまな興味
  • 会員期間
製品
  • 製品の詳細(名前、SKU、カテゴリ)
  • ネストされた仕様
  • 価格と在庫情報
  • タグと評価
注文
  • 注文の詳細と商品
  • ユーザーリファレンス
  • 配送と支払い情報
  • ステータス追跡

🎯 プロンプトの例

機能を確認するには、Claude と一緒に次のプロンプトを試してください。

基本操作

"What collections are available in the database?" "Show me the schema for the users collection" "Find all users in San Francisco"

高度なクエリ

"Find all electronics products that are in stock and cost less than $1000" "Show me all orders from the user john@example.com" "List the products with ratings above 4.5"

インデックス管理

"What indexes exist on the users collection?" "Create an index on the products collection for the 'category' field" "List all indexes across all collections"

ドキュメント操作

"Insert a new product with name 'Gaming Laptop' in the products collection" "Update the status of order with ID X to 'shipped'" "Find and delete all products that are out of stock"

📝 利用可能なツール

サーバーは、データベースとの対話用に次のツールを提供します。

クエリツール

  • find : フィルタリングと投影によるドキュメントのクエリ
  • listCollections : 利用可能なコレクションを一覧表示する
  • insertOne : 単一のドキュメントを挿入する
  • updateOne : 単一のドキュメントを更新する
  • deleteOne : 1つのドキュメントを削除する

インデックスツール

  • createIndex : 新しいインデックスを作成する
  • dropIndex : インデックスを削除する
  • indexes : コレクションのインデックスを一覧表示する

📜 ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

LLM が MongoDB データベースと直接対話し、コレクションをクエリし、スキーマを検査し、自然言語を通じてシームレスにデータを管理できるようにするモデル コンテキスト プロトコル (MCP) サーバー。

  1. ✨ 特徴
    1. デモビデオ
      1. 🚀 クイックスタート
        1. Smithery経由でインストール
        2. 前提条件
        3. テストサンドボックスのセットアップ
        4. Claudeデスクトップの設定
        5. テストサンドボックスのデータ構造
      2. 🎯 プロンプトの例
        1. 基本操作
        2. 高度なクエリ
        3. インデックス管理
        4. ドキュメント操作
      3. 📝 利用可能なツール
        1. クエリツール
        2. インデックスツール
      4. 📜 ライセンス

        Related MCP Servers

        • -
          security
          A
          license
          -
          quality
          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.
          Last updated -
          340
          75
          TypeScript
          MIT License
          • Apple
        • A
          security
          A
          license
          A
          quality
          A Model Context Protocol server that provides access to MongoDB databases. This server enables LLMs to inspect collection schemas and execute read-only queries.
          Last updated -
          8
          817
          217
          TypeScript
          MIT License
          • Apple
        • -
          security
          A
          license
          -
          quality
          A Model Context Protocol (MCP) server that enables LLMs to interact directly the documents that they have on-disk through agentic RAG and hybrid search in LanceDB. Ask LLMs questions about the dataset as a whole or about specific documents.
          Last updated -
          12
          31
          TypeScript
          MIT License
          • Apple
        • -
          security
          A
          license
          -
          quality
          A Model Context Protocol server that enables LLMs to interact directly with MongoDB databases, allowing users to query collections, inspect schemas, and manage data through natural language.
          Last updated -
          340
          TypeScript
          MIT License
          • Apple

        View all related MCP servers

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/spirita1204/mongo-mcp'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server