Skip to main content
Glama
mongodb-developer

MongoDB MCP Server

Official

MongoDB MCP 서버

MongoDB 데이터베이스에 대한 읽기 전용 액세스를 제공하는 모델 컨텍스트 프로토콜 서버입니다. 이 서버를 통해 LLM은 컬렉션 스키마를 검사하고 집계 파이프라인을 실행할 수 있습니다.

구성 요소

도구

  • 골재

    • 연결된 데이터베이스에 대해 MongoDB 집계 파이프라인을 실행합니다.

    • 입력:

      • collection (문자열): 쿼리할 컬렉션

      • pipeline (배열): MongoDB 집계 파이프라인 단계

      • options (객체): 선택적 집계 설정

        • allowDiskUse (부울): 디스크 사용이 필요한 작업 허용

        • maxTimeMS (숫자): 최대 실행 시간(밀리초)

        • comment (문자열): 작업을 식별하는 주석

    • 제한 단계가 지정되지 않은 경우 기본 제한은 1000개 문서입니다.

    • 기본 시간 초과는 30초입니다.

  • 설명하다

    • 집계 파이프라인에 대한 실행 계획 가져오기

    • 입력:

      • collection (문자열): 분석할 컬렉션

      • pipeline (배열): MongoDB 집계 파이프라인 단계

      • verbosity (문자열): 설명의 세부 수준

        • 옵션: "queryPlanner", "executionStats", "allPlansExecution"

        • 기본값: "queryPlanner"

자원

서버는 데이터베이스의 각 컬렉션에 대한 스키마 정보를 제공합니다.

  • 컬렉션 스키마 ( mongodb://<host>/<collection>/schema )

    • 각 컬렉션에 대한 추론된 JSON 스키마 정보

    • 필드 이름과 데이터 유형이 포함됩니다.

    • 스키마는 샘플링 컬렉션 문서에서 파생됩니다.

Related MCP server: MongoDB MCP Server

Claude Desktop과 함께 사용

Claude Desktop 앱과 함께 이 서버를 사용하려면 claude_desktop_config.json 의 "mcpServers" 섹션에 다음 구성을 추가하세요.

지엑스피1

mydb 데이터베이스 이름으로 바꾸고 필요에 따라 연결 문자열을 조정합니다.

사용 예

기본 집계

{
  "collection": "users",
  "pipeline": [
    { "$match": { "age": { "$gt": 21 } } },
    { "$group": {
      "_id": "$city",
      "avgAge": { "$avg": "$age" },
      "count": { "$sum": 1 }
    }},
    { "$sort": { "count": -1 } },
    { "$limit": 10 }
  ],
  "options": {
    "allowDiskUse": true,
    "maxTimeMS": 60000,
    "comment": "City-wise user statistics"
  }
}

질의 설명

{
  "collection": "users",
  "pipeline": [
    { "$match": { "age": { "$gt": 21 } } },
    { "$sort": { "age": 1 } }
  ],
  "verbosity": "executionStats"
}

안전 기능

  • 파이프라인에 제한이 지정되지 않으면 자동으로 1000개 문서로 제한됩니다.

  • 모든 작업에 대한 기본 시간 초과는 30초입니다.

  • 읽기 전용 작업만 가능

  • 수집 샘플에서 안전한 스키마 추론

특허

이 MCP 서버는 MIT 라이선스에 따라 라이선스가 부여됩니다. 즉, MIT 라이선스의 조건에 따라 소프트웨어를 자유롭게 사용, 수정 및 배포할 수 있습니다. 자세한 내용은 프로젝트 저장소의 LICENSE 파일을 참조하세요.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Provides read-only access to legacy MongoDB instances (<4.0) via the Model Context Protocol, enabling AI models to query databases, collections, and run aggregations safely.
    2
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to interact with MongoDB databases through natural language, supporting document CRUD, aggregation, collection listing, and statistics.
    98,382 npm
    Apache 2.0
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to interact with MongoDB databases and MongoDB Atlas, supporting read-only and write operations, Atlas cluster management, and data exploration.
    98,382 npm
    Apache 2.0
  • A
    license
    B
    quality
    C
    maintenance
    Enables AI assistants to interact with MongoDB 3.6+ databases, supporting collection listing, document queries, counting, and aggregations through natural language.
    5
    1
    MIT