Skip to main content
Glama

gdrive-mcp

Google Drive フォルダを Streamable HTTP で公開するMCP(Model Context Protocol)サーバーです。Vercel 上で実行し、GitHub でホストすることを想定しています。

次の 2 つのツールを提供します:

ツール

説明

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 & ServicesLibrary で "Google Drive API" を検索して [Enable] をクリックします。

  3. サービス アカウントを作成します: IAM & AdminService AccountsCreate Service Account

  4. そのアカウントの JSON キーを作成します: サービス アカウントを開く → KeysAdd KeyCreate New Key → JSON。ファイルをダウンロードします。

  5. サービス アカウントのメールアドレスを確認します(name@project.iam.gserviceaccount.com のような形式です)。

  6. Drive フォルダをそのメールアドレスと共有します:

    • Google Drive でフォルダを開く → 右クリック → Share

    • サービス アカウントのメールアドレスを貼り付け、閲覧者アクセス権を付与します。

  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. VercelAdd New → Project から GitHub リポジトリをインポートします。

  3. 環境変数(DRIVE_FOLDER_IDGOOGLE_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 トランスポートでデプロイされた URL に接続します。claude_desktop_config.json の例:

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

汎用のMCP設定形式を使用するクライアントの場合:

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

このエンドポイントはステートレスなので、リクエストごとに新しいトランスポートが作成されます。サーバーレスに最適です。 アクセス制御は、サービス アカウントに対する Google Drive の共有設定によって行われます。

環境変数

変数

必須

説明

DRIVE_FOLDER_ID

はい

Google Drive のフォルダ ID

GOOGLE_SERVICE_ACCOUNT_KEY

はい

Base64 エンコードされたサービス アカウントの JSON キー

A
license - permissive license
Not graded
quality - not tested
B
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

  • 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.
    26
    2
  • F
    license
    Not graded
    quality
    C
    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
    C
    maintenance
    Enables Google Drive file operations (list, search, read, create) via MCP using OAuth2 authentication with token persistence.
  • 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.

View all related MCP servers

Related MCP Connectors

  • Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.

  • Google Docs MCP Pack — read, create, and edit Google Docs via OAuth.

  • Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.

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/shafinaz-ops/gdrive-mcp'

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