Skip to main content
Glama

gdrive-mcp

이 MCP(Model Context Protocol) 서버는 Google Drive 폴더를 Streamable HTTP로 노출하며, Vercel에서 실행되고 GitHub에 호스팅되도록 구축되었습니다.

두 가지 도구를 제공합니다:

도구

설명

list_files

구성된 Drive 폴더 내의 파일/폴더를 나열합니다(선택적 검색 가능)

read_file

텍스트 콘텐츠를 읽고 Google Docs/Sheets/Slides를 자동으로 내보냅니다

아키텍처

  • server.ts — Node.js HTTP 서버 진입점(Streamable HTTP MCP 엔드포인트).

  • src/mcp.ts — MCP 서버 정의 및 도구.

  • src/drive.ts — 서비스 계정을 사용하는 Google Drive 클라이언트.

인증은 Google 서비스 계정을 통해 읽기 전용(drive.readonly)으로 수행됩니다.


Related MCP server: gdrive-mcp-server

1. Google Cloud 설정(서비스 계정)

  1. Google Cloud Console로 이동하여 프로젝트를 생성합니다.

  2. Google Drive API 사용 설정: APIs & Services → Library → "Google Drive API" 검색 → Enable.

  3. 서비스 계정 생성: IAM & Admin → Service Accounts → Create Service Account.

  4. 서비스 계정의 JSON 키 생성: 서비스 계정을 엽니다 → Keys → Add Key → Create New Key → JSON. 파일을 다운로드합니다.

  5. 서비스 계정 이메일을 기록해 둡니다(name@project.iam.gserviceaccount.com 형식).

  6. 해당 이메일로 Drive 폴더를 공유합니다:

    • Google Drive 폴더 열기 → 마우스 오른쪽 버튼 → Share.

    • 서비스 계정 이메일을 붙여넣고 Viewer 액세스 권한을 부여합니다.

  7. 폴더 ID를 복사합니다(URL에서 /folders/ 뒤의 부분).


2. 로컬 설정

git clone <your-repo-url>
cd gdrive-mcp
npm install

.env 파일을 생성합니다(.env.example 복사):

DRIVE_FOLDER_ID=1XM-0CtgvW3PGDekC8qLa2ghxRyvTfjwD
GOOGLE_SERVICE_ACCOUNT_KEY=<base64 of service-account.json>

서비스 계정 키를 base64로 인코딩합니다:

  • Linux/macOS: base64 -w0 service-account.json

  • PowerShell: [Convert]::ToBase64String([IO.File]::ReadAllBytes("service-account.json"))


3. Vercel 배포

옵션 A — Vercel + GitHub (권장)

  1. 이 저장소를 GitHub에 푸시합니다.

  2. Vercel → **Add New ** → Project에서 GitHub 저장소 가져옵니다.

  3. 환경 변수(DRIVE_FOLDER_ID, GOOGLE_SERVICE_ACCOUNT_KEY)를 추가합니다.

  4. 배포합니다. MCP 엔드포인트는 다음과 같습니다:

    https://<your-project>.vercel.app

옵션 B — Vercel CLI

npm i -g vercel
vercel login
vercel env add DRIVE_FOLDER_ID
vercel env add GOOGLE_SERVICE_ACCOUNT_KEY
vercel --prod

4. GitHub에 푸시(첫 번째)

git init
git add .
git commit -m "Add gdrive-mcp server"
git branch -M main
git remote add origin https://github.com/<you>/gdrive-mcp.git
git push -u origin main

5. MCP 클라이언트 연결

클라이언트를 Streamable HTTP transport로 배포된 URL에 연결하세요. 예제 claude_desktop_config.json:

{
  "mcpServers": {
    "gdrive": {
      "type": "http",
      "url": "https://<your-project>.vercel.app"
    }
  }
}

일반 MCP 구성 형식을 사용하는 클라이언트의 경우:

{
  "mcpServers": {
    "gdrive": {
      "url": "https://<your-project>.vercel.app"
    }
  }
}

이 엔드포인트는 **stateless(상태 비저장)**이므로 각 요청이 새 transport를 생성합니다. 서버리스 환경에 적합합니다. 액세스는 서비스 계정에 대한 Google Drive 공유 설정을 통해 제어됩니다.

환경 변수

변수

필수

설명

DRIVE_FOLDER_ID

예

Google Drive 폴더 ID

GOOGLE_SERVICE_ACCOUNT_KEY

예

Base64로 인코딩된 서비스 계정 JSON 키

Related MCP Connectors

Related MCP Servers

  • 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.
    13 npm
    2
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables MCP-compatible AI assistants to interact with a user's Google Drive, including listing, searching, reading, creating, updating, and deleting files, with authentication via Google OAuth.
    -
  • F
    license
    Not graded
    quality
    B
    maintenance
    A read-only MCP server that exposes a configured Google Drive folder to MCP clients, enabling them to list, search, and extract content from various file formats like Excel, CSV, PDF, DOCX, and images.
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables interacting with Google Drive folders through an MCP server, allowing listing, searching, and reading files using tools like list_files, search_files, get_file, and read_file.
    -