MongoDB MCP Server for LLMs

by vivek1612
Verified
MIT License
340
  • Apple

Integrations

  • Enables direct interaction with MongoDB databases, offering tools for collection schema inspection, document querying and filtering, index management, and document operations (insertion, updates, deletion).

🗄️ 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
윈도우 : %APPDATA%/Claude/claude_desktop_config.json

지엑스피1

Smithery를 통해 설치

Smithery를 통해 Claude Desktop에 MongoDB MCP 서버를 자동으로 설치하려면:

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

필수 조건

  • 노드.js 18+
  • 엔피엑스
  • Docker 및 Docker Compose(로컬 샌드박스 테스트에만 해당)
  • MCP 클라이언트(예: Claude 데스크톱 앱)

테스트 샌드박스 설정

연결할 Mongo DB 서버가 없고 샘플 샌드박스를 생성하려는 경우 다음 단계를 따르세요.

  1. Docker Compose를 사용하여 MongoDB를 시작합니다.
docker-compose up -d
  1. 테스트 데이터로 데이터베이스를 시드합니다.
npm run seed

Claude Desktop 구성

Claude Desktop 구성 파일에 다음 구성을 추가하세요.

MacOS : ~/Library/Application\ Support/Claude/claude_desktop_config.json
윈도우 : %APPDATA%/Claude/claude_desktop_config.json

로컬 개발 모드:

{ "mcpServers": { "mongodb": { "command": "node", "args": [ "dist/index.js", "mongodb://root:example@localhost:27017/test?authSource=admin" ] } } }

테스트 샌드박스 데이터 구조

시드 스크립트는 샘플 데이터를 사용하여 세 개의 컬렉션을 생성합니다.

사용자

  • 개인 정보(이름, 이메일, 나이)
  • 좌표가 포함된 중첩 주소
  • 관심의 배열
  • 회원 가입 날짜

제품

  • 제품 세부 정보(이름, 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 : 단일 문서 삭제

인덱스 도구

  • createIndex : 새로운 인덱스를 생성합니다
  • dropIndex : 인덱스 제거
  • indexes : 컬렉션의 인덱스를 나열합니다.

📜 라이센스

이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여되었습니다. 자세한 내용은 라이선스 파일을 참조하세요.

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

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

LLM이 MongoDB 데이터베이스와 직접 상호 작용할 수 있도록 하는 모델 컨텍스트 프로토콜 서버로, 사용자는 컬렉션을 쿼리하고, 스키마를 검사하고, 자연어로 데이터를 관리할 수 있습니다.

  1. ✨ Features
    1. Demo Video
      1. 🚀 Quick Start
        1. Installing via Smithery
        2. Prerequisites
        3. Test Sandbox Setup
        4. Configure Claude Desktop
        5. Test Sandbox Data Structure
      2. 🎯 Example Prompts
        1. Basic Operations
        2. Advanced Queries
        3. Index Management
        4. Document Operations
      3. 📝 Available Tools
        1. Query Tools
        2. Index Tools
      4. 📜 License
        ID: a5lx0dulpo