Skip to main content
Glama
shyinlim

Mindmup2GoogleDriveMCP

by shyinlim

MindMup2 Google Drive MCP 서버

AI 클라이언트(Claude Code, Cursor)가 Google Drive에 저장된 MindMup 2 .mup 마인드맵을 검색, 읽기 및 탐색할 수 있게 해주는 MCP(Model Context Protocol) 서버입니다. 3MB에 달하는 JSON 트리를 모델에 한꺼번에 넘기지 않아도 됩니다. 대용량 맵은 자동으로 트리 개요로 요약되며, AI는 node_path를 통해 특정 섹션을 자세히 탐색할 수 있습니다.

호환성: Claude Code, Cursor (HTTP 전송). 지원되지 않음: Claude Desktop (stdio 전용).

💫 결과

ezgif-5b4a0eb3a275f8.gif

Related MCP server: Google-Workspace-MCP-Server

✨ 기능

  • 전체 Google Drive에서 MindMup 파일 검색 (읽기 전용)

  • 대용량 마인드맵을 위한 트리 탐색 + 섹션 드릴다운 — 작은 파일은 전체 내용을 반환하고, 큰 파일은 드릴다운 가능한 개요를 반환합니다.

  • X-Client-Id 헤더를 통한 클라이언트별 캐시 격리 — 서로 다른 사용자/도구가 캐시된 콘텐츠를 공유하지 않습니다.

  • fastmcp run --reload 및 바인드 마운트 소스를 통한 핫 리로드 개발 모드

  • /health/ping 엔드포인트가 내장된 FastMCP 서버

  • 개발 및 운영 환경을 위한 Docker Compose 지원

🗺️ 엔드투엔드 흐름

1. Set up Google Cloud service account     →  download JSON key
2. Share your Drive folder with the SA     →  Viewer access
3. Base64-encode the JSON key              →  for X-Google-Credential header
4. Run the server  (Docker or Python)      →  http://127.0.0.1:9805
5. Configure your MCP client (Claude/Cursor) with the base64 credential
6. Verify  →  curl http://127.0.0.1:9805/health

🔧 사용 가능한 MCP 도구

도구

설명

list_files

Google Drive에서 MindMup 파일을 나열합니다(기본적으로 폴더 및 .mup이 아닌 파일은 필터링됨). id, name, folder_url, size, modified_time을 반환합니다.

read_mindmap

file_id 또는 file_name으로 MindMup 파일을 읽습니다(둘 중 하나 필수; 이름은 첫 번째 부분 일치 항목 사용). 작은 파일(<100KB AI-dict)은 content_type: "full"을 반환합니다. 대용량 파일은 tree_outline, section_stats, suggested_start_paths가 포함된 content_type: "outline_only"를 반환합니다.

search_mindmap

키워드로 노드를 검색합니다. 매개변수: file_id, keyword, 선택적 node_path(하위 트리 범위), max_results=30, normalize_whitespace=True. node_path, title_preview, breadcrumb, children_count가 포함된 노드를 반환합니다.

get_mindmap_section

node_path(점으로 구분된 정수, 루트는 1, 예: "1.2.3")로 섹션을 자세히 탐색합니다. 선택적 max_depth, offset=0, limit=0. `content_type: "full"

"outline_only"

"paginated"

"truncated"`를 반환하며, 섹션이 여전히 너무 크면 자동으로 전환됩니다.

AI 에이전트를 위한 권장 워크플로우: list_filesread_mindmapoutline_only인 경우, search_mindmap(키워드별) 또는 get_mindmap_section(suggested_start_pathsnode_path별) 사용.

🚀 시작하기

사전 요구 사항

  • Python 3.12+

  • Docker & docker-compose (make run-dev-docker / make run-prod에 필요) ; makefile 참조

  • Google Cloud Platform 계정

  • HTTP 전송을 지원하는 MCP 클라이언트 (Claude Code 또는 Cursor)

Google Drive API 설정

단계

설명

이미지

1

Google Cloud Console로 이동하여 새 프로젝트를 생성합니다(무료 티어면 충분하며, Drive API에 대한 결제는 필요하지 않습니다).

2

Google Drive API를 활성화합니다.

3

서비스 계정 자격 증명 생성:- "IAM 및 관리자" → "서비스 계정" → "서비스 계정 만들기"- 프로젝트 수준 역할 필요 없음(Drive 공유가 인증을 처리함)- SA 열기 → "키" 탭 → "키 추가" → JSON → 키 파일 다운로드.

google_service_acc.jpg

4

전체 JSON 키 파일을 Base64로 인코딩합니다(헤더 참조 참조).⚠️ JSON 파일을 .gitignore에 추가하세요 — 절대 커밋하지 마십시오.

5

Google Drive 폴더를 SA와 공유:- JSON에서 client_email 값을 복사합니다.- 폴더 우클릭 → 공유 → 이메일 붙여넣기- 뷰어 권한 부여, "알림 보내기" 체크 해제- 공유는 하위 폴더로 전파됩니다.

google_drive_share_list2.jpg

범위 참고: 서버는 auth/drive + auth/drive.file을 요청합니다. 광범위한 범위에도 불구하고, 뷰어 폴더 수준 공유를 사용하면 SA는 사용자가 공유한 항목만 읽을 수 있습니다. 워크스페이스 관리 계정은 외부 공유를 차단할 수 있으므로, 이 경우 관리자에게 해당 도메인에 대한 서비스 계정 공유를 허용하도록 요청하십시오.

서버 실행

Docker (권장):

make run-dev-docker   # dev: hot-reload, source bind-mounted
make run-prod         # prod: no reload

직접 Python (Docker 없음):

pip install -r requirements.txt
python3 run.py
# Optionally: MCP_TRANSPORT=streamable-http python3 run.py

서버 확인

curl http://127.0.0.1:9805/health
# => {"result":"success","time":"...","message":"MCP server is running. ..."}

success가 표시되지 않으면 docker logs <container>(Docker 모드) 또는 stdout(Python 모드)을 확인하십시오.

테스트 실행

pip install -r requirements.txt
pytest

MCP 클라이언트 구성

MCP 클라이언트 구성(~/.claude/mcp.json(Claude Code의 경우) 또는 Cursor MCP 설정)에 추가하십시오:

{
    "mcpServers": {
        "mindmup-gdrive": {
            "type": "http",
            "url": "http://127.0.0.1:9805/mcp",
            "headers": {
                "X-Google-Credential": "ewogICJ0eXBlIjogInNlcnZpY2VfYWNjb3VuXXXXXXXXXXX",
                "X-Client-Id": "shyin-claude-code"
            }
        }
    }
}

헤더 참조

헤더

필수

설명

X-Google-Credential

Base64로 인코딩된 서비스 계정 JSON입니다. base64encode.org를 사용하여 결과를 여기에 붙여넣으십시오. ⚠️ Base64는 인코딩이며 암호화가 아닙니다. MCP 클라이언트 구성은 디스크에 일반 텍스트로 저장되므로 공개 저장소나 암호화되지 않은 클라우드 백업에 동기화하지 마십시오.

X-Client-Id

선택

사용자 + 도구별 고유 식별자(예: shyin-claude-code). 캐시 키 (X-Client-Id, credential_hash, file_id)의 일부로 사용되어 클라이언트 간에 캐시된 콘텐츠를 격리합니다. 생략하면 default로 대체되며(다른 설정되지 않은 클라이언트와 캐시가 공유될 수 있음) 경고가 기록됩니다. 권장 형식: <사용자이름>-<도구이름>. 다른 사용자와의 충돌을 방지하려면 높은 엔트로피 값을 사용하십시오.

🩺 문제 해결

증상

가능한 원인 / 해결 방법

health가 아무것도 반환하지 않음 / 연결 거부

서버가 실행 중이지 않습니다. docker ps 또는 stdout을 확인하십시오. 9805 포트가 이미 사용 중인가요? mcp_deployment/docker-compose-dev.yml을 편집하여 다시 매핑하십시오.

Google Drive authentication failed

잘못된 Base64입니다. 확인 방법: `echo "$CRED"

base64 -d

jq .client_email` — SA 이메일이 출력되어야 합니다.

list_files가 비어 있음

(a) 폴더가 잘못된 이메일과 공유됨 — JSON의 client_email과 일치해야 합니다. (b) 파일이 .mup이 아님 — mindmup_only=False로 호출하여 확인하십시오. (c) 워크스페이스 조직 정책이 외부 공유를 차단함.

Docker 빌드 실패

Docker 데몬이 실행 중인지 확인하십시오. make run-dev-docker를 다시 실행하십시오.

개발 환경에서 변경 사항이 반영되지 않음

핫 리로드는 Python 소스만 감시합니다. 종속성이나 환경 변경 후 컨테이너를 다시 시작하십시오.

🏗️ 프로젝트 구조

├── mcp_deployment/
│   ├── docker-compose-dev.yml
│   ├── docker-compose-prod.yml
│   └── Dockerfile
├── src/
│   ├── core/
│   │   ├── gdrive_client.py    # Google Drive API client
│   │   ├── gdrive_feature.py   # Google Drive feature implementation
│   │   ├── mcp_server.py       # Main MCP server with read tools
│   │   └── mindmup_parser.py   # MindMup parsing + tree navigation
│   ├── model/
│   │   ├── common_model.py     # Common data models
│   │   ├── gdrive_model.py     # Google Drive data models
│   │   └── mindmup_model.py    # Mind map data models (with to_ai_dict)
│   └── utility/
│       ├── enum.py             # Enumerations and constants
│       └── logger.py           # Logging utilities
├── tests/                      # Unit tests
├── plans/                      # Implementation plans
├── run.py                      # Main entry point
├── requirements.txt            # Python dependencies
└── makefile                    # Build and deployment commands

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server that seamlessly interacts with your Google Calendar, Gmail, Drive and so on.
    30
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that enables interaction with Google Drive through the Google Cloud API. It allows users to list, read, and upload files directly from MCP-compatible clients like manus.im or Cursor.
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    A read-only Google Drive MCP server that allows searching files, reading file content (with auto-export for Google Docs, Sheets, Slides), and retrieving file metadata via OAuth authentication.
    8 npm
    2
    -