Google Drive MCP Server
Google ドライブ MCP サーバー
Google ドライブとのシームレスな統合を提供する強力なモデル コンテキスト プロトコル (MCP) サーバー。AI モデルが Google ドライブからファイルを検索、一覧表示、読み取ることができます。
🚀 機能
ツール
1. gdrive_search
強力な全文検索機能を使用して、Google ドライブ内のファイルを検索します。
入力:
{ "query": "string (your search query)" }出力: 次のファイルのリスト:
ファイル名
MIMEタイプ
ファイルID
最終更新日時
ファイルサイズ
2. gdrive_read_file
Google ドライブのファイル ID を使用してファイルの内容を直接読み取ります。
入力:
{ "file_id": "string (Google Drive file ID)" }出力: 適切な形式に変換されたファイルの内容
自動ファイル形式処理
サーバーは、さまざまな Google Workspace ファイル形式をインテリジェントに処理します。
📝 Googleドキュメント → Markdown
📊 Google スプレッドシート → CSV
📊 Google プレゼンテーション → プレーンテキスト
🎨 Google 描画 → PNG
📄 テキスト/JSON ファイル → UTF-8 テキスト
📦 その他のファイル → Base64エンコード
Related MCP server: Google Drive MCP Server
🛠️ はじめに
前提条件
Node.js (v16 以上)
npmまたはyarn
Google Cloud プロジェクト
Google Workspace または個人の Google アカウント
Google Cloud の詳細な設定
Google Cloud プロジェクトを作成する
Google Cloud Consoleにアクセスする
「新しいプロジェクト」をクリックします
プロジェクト名を入力します(例:「MCP GDrive Server」)
「作成」をクリック
プロジェクトが作成されるまで待って選択します
GoogleドライブAPIを有効にする
APIライブラリへ移動
「Google Drive API」を検索
「Google Drive API」をクリックします
「有効にする」をクリックします
APIが有効になるまで待ちます
OAuth同意画面の設定
OAuth同意画面に移動する
ユーザータイプを選択:
Google Workspace を使用している場合は「内部」
個人の Google アカウントの場合は「外部」
「作成」をクリック
必須フィールドに入力します。
アプリ名:「MCP GDrive Server」
ユーザーサポートメール: あなたのメールアドレス
開発者連絡先メールアドレス: あなたのメールアドレス
「保存して続行」をクリックします
「スコープ」ページで:
「スコープの追加または削除」をクリックします
https://www.googleapis.com/auth/drive.readonlyを追加します。「更新」をクリック
「保存して続行」をクリックします
概要を確認し、「ダッシュボードに戻る」をクリックします。
OAuthクライアントIDを作成する
資格情報へ移動
上部の「認証情報を作成」をクリックします
「OAuthクライアントID」を選択
アプリケーションの種類を選択:「デスクトップアプリ」
名前:「MCP GDrive サーバー デスクトップ クライアント」
「作成」をクリック
ポップアップで:
「JSONをダウンロード」をクリックします
ファイルを保存する
「OK」をクリック
プロジェクトで資格情報を設定する
# Create credentials directory mkdir credentials # Move and rename the downloaded JSON file mv path/to/downloaded/client_secret_*.json credentials/gcp-oauth.keys.json
インストール
# Clone the repository
git clone https://github.com/felores/gdrive-mcp-server.git
cd gdrive-mcp-server
# Install dependencies
npm install
# Build the project
npm run build認証
資格情報ディレクトリを作成し、OAuth キーを配置します。
mkdir credentials # Move your downloaded OAuth JSON file to the credentials directory as gcp-oauth.keys.json認証コマンドを実行します。
node dist/index.js authブラウザでOAuthフローを完了する
資格情報は
credentials/.gdrive-server-credentials.jsonに保存されます。
🔧 使用方法
コマンドラインツールとして
# Start the server
node dist/index.jsデスクトップアプリとの統合
次の構成をアプリのサーバー設定に追加します。
{
"mcpServers": {
"gdrive": {
"command": "node",
"args": ["path/to/gdrive-mcp-server/dist/index.js"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "path/to/gdrive-mcp-server/credentials/gcp-oauth.keys.json",
"MCP_GDRIVE_CREDENTIALS": "path/to/gdrive-mcp-server/credentials/.gdrive-server-credentials.json"
}
}
}
}path/to/gdrive-mcp-serverインストール ディレクトリへの実際のパスに置き換えます。
使用例
ファイルを検索:
// Search for documents containing "quarterly report" const result = await gdrive_search({ query: "quarterly report" });ファイルの内容を読み取る:
// Read a specific file using its ID const contents = await gdrive_read_file({ file_id: "your-file-id" });
🔒 セキュリティ
すべての機密資格情報は
credentialsディレクトリに保存されますOAuth の認証情報とトークンはバージョン管理から除外されます
Google ドライブへの読み取り専用アクセス
安全なOAuth 2.0認証フロー
🤝 貢献する
貢献を歓迎します!お気軽にプルリクエストを送信してください。
📝 ライセンス
このMCPサーバーはMITライセンスに基づいてライセンスされています。詳細はLICENSEファイルをご覧ください。
🔍 トラブルシューティング
問題が発生した場合:
Google Cloud プロジェクトの設定を確認する
必要なすべてのOAuthスコープが有効になっていることを確認する
資格情報が
credentialsディレクトリに適切に配置されていることを確認しますGoogle ドライブのファイル権限とアクセス権を確認する
📚 追加リソース
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
- AlicenseNot gradedqualityCmaintenanceIntegrates with Google Drive to enable listing, searching, and reading files, plus reading and writing to Google Sheets.9,027284MIT
- AlicenseNot gradedqualityDmaintenanceIntegrates with Google Drive to enable listing, reading, and searching over files, with automatic export of Google Workspace documents to appropriate formats.4,907MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI models to search, list, and read files from Google Drive with automatic format conversion for Google Workspace documents.4,907MIT
- AlicenseNot gradedqualityDmaintenanceEnables listing, reading, and searching over files in Google Drive, with automatic export of Google Workspace files.4,9074MIT
Related MCP Connectors
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Securely search and manage workspace context files for AI agents and teams.
Search, browse, and read your Dropbox files. Find documents by name or content, list folders, and…
Appeared in Searches
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/felores/gdrive-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server