
isaacphi/mcp-gdrive
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Сервер Model Context Protocol (MCP) для чтения с Google Drive и редактирования Google Sheets
Обзор
Этот MCP-сервер интегрируется с Google Drive, позволяя отображать, читать и искать файлы, а также читать и записывать в Google Sheets. В этот проект входит код, изначально разработанный компанией Anthropic, PBC, лицензированный по лицензии MIT из этого репозиториума. - : Поиск файлов в Google Drive. - : - запрос (строка): поисковый запрос. - pageToken (строка, по желанию): Токен для следующей страницы результатов. - pageSize (число, необязательно): Количество результатов на странице (максимум 100). - : Возвращает имена файлов и MIME-типы соответствующих файлов. - : Чтение содержимого файла с Google Drive. - : - fileId (строка): ID файла для чтения. - : Возвращает содержимое указанного файла. - : Чтение данных из Google Spreadsheet с гибкими параметрами диапазонов и форматирования. - : - spreadsheetId (строка): ID таблицы для чтения. - диапазоны (массив строк, по необходимости): Необязательный массив диапазонов обозначения A1 (например, ['Sheet1! A1:B10']). Если не указано, читает весь лист.
Обзор (машинный перевод)
Этот MCP-сервер интегрируется с Google Drive, позволяя отображать, читать и искать файлы, а также читать и записывать в Google Sheets.
В этот проект входит код, изначально разработанный компанией Anthropic, PBC, лицензированный по лицензии MIT из этого репозиториума.
Компоненты
Инструменты
-
gdrive_search
-
Описание: Поиск файлов в Google Drive.
-
Ввод:
-
query(строка): Поисковый запрос. -
pageToken(строка, по желанию): Токен для следующей страницы результатов. -
pageSize(число, необязательно): Количество результатов на странице (максимум 100). -
Output: Возвращает имена файлов и MIME-типы соответствующих файлов.
-
gdrive_read_file
-
Описание: Прочитайте содержимое файла с Google Drive.
-
Ввод:
-
fileId(строка): ID файла для чтения. -
Output: Возвращает содержимое указанного файла.
-
gsheets_read
-
Описание: Читайте данные из Google Spreadsheet с гибкими параметрами диапазонов и форматирования.
-
Ввод:
-
spreadsheetId(строка): ID таблицы для чтения. -
ranges(массив строк, по выбору): Необязательный массив диапазонов обозначения A1 (например,['Sheet1!A1:B10']). Если не предусмотрено, читается весь лист.
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
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
- Create a new Google Cloud project
- Enable the Google Drive API
- Configure an OAuth consent screen (“internal” is fine for testing)
- Add OAuth scopes
https://www.googleapis.com/auth/drive.readonly,https://www.googleapis.com/auth/spreadsheets - 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.
Установка
npx -y @isaacphi/mcp-gdriveКонфигурация
{
"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"
}
}
}
}