IM

isaacphi/mcp-gdrive

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

282 stars 104 forks 品質 59 トレンド 18MIT

Google Driveからの読み込みおよびGoogle Sheets編集のためのモデルコンテキストプロトコル(MCP)サーバー

概要

このMCPサーバーはGoogle Driveと連携し、ファイルのリスト作成、読み取り、検索に加え、Google Sheetsへの読み書きも可能です。 このプロジェクトには、Anthropic PBCが元々開発し、このリポジトリのMITライセンスの下でライセンスされたコードが含まれています。 - : Google Driveでファイルを検索。- : - クエリ(文字列):検索クエリ。- pageToken(文字列、任意):次のページの結果のためのトークン。- pageSize(番号、任意):ページあたりの結果数(最大100)。- : ファイル名とMIMEタイプの一致ファイルを返します。 - : Google Driveからファイルの内容を読み取る。- : - fileId(文字列):読み取るべきファイルのID。- : 指定されたファイルの内容を返します。 - : 範囲や書式の柔軟なオプションを持つGoogleスプレッドシートからデータを読み取る。- : - SpreadsheetId(文字列):読むべきスプレッドシートのID。- ranges(文字列の配列、任意):A1表記範囲のオプション配列(例:['Sheet1!A1:B10'])。提供されていない場合、シート全体を読み取る。

概要(AI 翻訳)

このMCPサーバーはGoogle Driveと連携し、ファイルのリスト作成、読み取り、検索に加え、Google Sheetsへの読み書きも可能です。

このプロジェクトには、Anthropic PBCが元々開発し、このリポジトリのMITライセンスの下でライセンスされたコードが含まれています。

構成要素

道具

  • gdrive_search

  • 説明:Googleドライブ内のファイルを検索。

  • 入力:

  • query(文字列):検索クエリ。

  • pageToken(文字列、任意):次の結果ページのトークン。

  • pageSize(番号、任意):ページあたりの結果数(最大100件)。

  • Output:ファイル名およびMIMEタイプの対応ファイルを返します。

  • gdrive_read_file

  • 説明:Googleドライブからファイルの内容を読み取る。

  • 入力:

  • fileId(文字列):読み込むファイルのID。

  • Output:指定されたファイルの内容を返します。

  • gsheets_read

  • 説明:範囲や書式の柔軟なオプションを持つGoogleスプレッドシートからデータを読み取ることができます。

  • 入力:

  • spreadsheetId(文字列):読むべきスプレッドシートのID。

  • ranges(文字列の配列、任意):A1記法の範囲のオプション配列(例:['Sheet1!A1:B10'])。提供されない場合は、シート全体を読み込みます。

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Google Drive server

This MCP server integrates with Google Drive to allow listing, reading, and searching files, as well as the ability to read and write to Google Sheets.

This project includes code originally developed by Anthropic, PBC, licensed under the MIT License from this repo.

Components

Tools

  • gdrive_search

    • Description: Search for files in Google Drive.
    • Input:
      • query (string): Search query.
      • pageToken (string, optional): Token for the next page of results.
      • pageSize (number, optional): Number of results per page (max 100).
    • Output: Returns file names and MIME types of matching files.
  • gdrive_read_file

    • Description: Read contents of a file from Google Drive.
    • Input:
      • fileId (string): ID of the file to read.
    • Output: Returns the contents of the specified file.
  • gsheets_read

    • Description: Read data from a Google Spreadsheet with flexible options for ranges and formatting.
    • Input:
      • spreadsheetId (string): The ID of the spreadsheet to read.
      • ranges (array of strings, optional): Optional array of A1 notation ranges (e.g., ['Sheet1!A1:B10']). If not provided, reads the entire sheet.
      • sheetId (number, optional): Specific sheet ID to read. If not provided with ranges, reads the first sheet.
    • Output: Returns the specified data from the spreadsheet.
  • gsheets_update_cell

    • Description: Update a cell value in a Google Spreadsheet.
    • Input:
      • fileId (string): ID of the spreadsheet.
      • range (string): Cell range in A1 notation (e.g., 'Sheet1!A1').
      • value (string): New cell value.
    • Output: Confirms the updated value in the specified cell.

Resources

The server provides access to Google Drive files:

  • Files (gdrive:///)
    • Supports all file types
    • Google Workspace files are automatically exported:
      • Docs → Markdown
      • Sheets → CSV
      • Presentations → Plain text
      • Drawings → PNG
    • Other files are provided in their native format

Getting started

  1. Create a new Google Cloud project
  2. Enable the Google Drive API
  3. Configure an OAuth consent screen (“internal” is fine for testing)
  4. Add OAuth scopes https://www.googleapis.com/auth/drive.readonly, https://www.googleapis.com/auth/spreadsheets
  5. In order to allow interaction with sheets and docs you will also need to enable the Google Sheets API and Google Docs API in your workspaces Enabled API and Services section.
GitHub で README 全文を見る

インストール

npx -y @isaacphi/mcp-gdrive
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "gdrive": { "command": "npx", "args": ["-y", "@isaacphi/mcp-gdrive"], "env": { "CLIENT_ID": "<CLIENT_ID>", "CLIENT_SECRET": "<CLIENT_SECRET>", "GDRIVE_CREDS_DIR": "/path/to/config/directory" } } } }