gdrive-mcp
gdrive-mcp
Google Drive フォルダを Streamable HTTP で公開するMCP(Model Context Protocol)サーバーです。Vercel 上で実行し、GitHub でホストすることを想定しています。
次の 2 つのツールを提供します:
ツール | 説明 |
| 設定された Drive フォルダ内のファイル/フォルダを一覧表示します(検索可能) |
| テキストコンテンツを読み取ります。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 のセットアップ(サービス アカウント)
Google Cloud Console にアクセスして、プロジェクトを作成します。
Google Drive API を有効にします:
APIs & Services→Libraryで "Google Drive API" を検索して [Enable] をクリックします。サービス アカウントを作成します:
IAM & Admin→Service Accounts→Create Service Account。そのアカウントの JSON キーを作成します: サービス アカウントを開く →
Keys→Add Key→Create New Key→ JSON。ファイルをダウンロードします。サービス アカウントのメールアドレスを確認します(
name@project.iam.gserviceaccount.comのような形式です)。Drive フォルダをそのメールアドレスと共有します:
Google Drive でフォルダを開く → 右クリック →
Share。サービス アカウントのメールアドレスを貼り付け、閲覧者アクセス権を付与します。
フォルダ 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.jsonPowerShell:
[Convert]::ToBase64String([IO.File]::ReadAllBytes("service-account.json"))
3. Vercel へのデプロイ
オプション A — Vercel + GitHub(推奨)
このリポジトリを GitHub にプッシュします。
Vercel で Add New → Project から GitHub リポジトリをインポートします。
環境変数(
DRIVE_FOLDER_ID、GOOGLE_SERVICE_ACCOUNT_KEY)を追加します。デプロイします。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 --prod4. 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 main5. 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 の共有設定によって行われます。
環境変数
変数 | 必須 | 説明 |
| はい | Google Drive のフォルダ ID |
| はい | Base64 エンコードされたサービス アカウントの JSON キー |
This server cannot be installed
Maintenance
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
- FlicenseNot gradedqualityCmaintenanceA 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.262
- FlicenseNot gradedqualityCmaintenanceEnables 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.
- FlicenseNot gradedqualityCmaintenanceEnables Google Drive file operations (list, search, read, create) via MCP using OAuth2 authentication with token persistence.
- FlicenseNot gradedqualityBmaintenanceA 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.
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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