Skip to main content
Glama
rock913

MongoDB MCP Server for LLMs

by rock913

🗄️ LLMS 向け MongoDB MCP サーバー

Node.js 18歳以上 ライセンス: MIT 鍛冶屋のバッジ

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

✨ 特徴

  • 🔍 コレクションスキーマ検査

  • 📊 ドキュメントのクエリとフィルタリング

  • 📈 インデックス管理

  • 📝 ドキュメント操作(挿入、更新、削除)

Related MCP server: MongoDB MCP Server for LLMs

デモビデオ

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ファイルを参照してください。

A
license - permissive license
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    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.
    27
    175
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    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.
    27
    2
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    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.
    27
    MIT
  • F
    license
    B
    quality
    C
    maintenance
    A MongoDB MCP Server that allows AI agents and MCP clients to interact with MongoDB databases through standardized tools for CRUD operations, schema discovery, and collection management.
    8

View all related MCP servers

Related MCP Connectors

  • GibsonAI MCP server: manage your databases with natural language

  • MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.

  • MCP server for AI dialogue using various LLM models via AceDataCloud

View all MCP Connectors

Latest Blog Posts

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/rock913/mongo-mcp'

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