Google Sheets MCP
Provides tools for reading and editing Google Sheets, including retrieving spreadsheet metadata and sheet formats, reading explicit A1 ranges with formulas, creating spreadsheets, writing to ranges, and performing batch updates for formatting and allowed structural operations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Google Sheets MCP read the values in Sheet1!A1:C10 from my budget spreadsheet"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Google Sheets MCP
Пять инструментов для чтения и редактирования Google Sheets. Небольшой собственный MCP на FastMCP и официальном Google SDK. Удаления, очистка и уменьшение сетки блокируются до обращения к Google.
Быстрый старт
Установить uv, затем:
git clone https://github.com/heist1337/sheets-mcp.git
cd sheets-mcp
cp .env.example .env
# Указать путь к Google credentials в .env.
uv run --locked --env-file .env google-sheets-mcpПо умолчанию используется stdio: обычно эту команду запускает MCP-клиент. Python и зависимости устанавливает uv.
Related MCP server: vnsh-mcp
Подключение к агенту
Скопировать mcp.example.json в настройки MCP-клиента, заменив путь к checkout и приватному env-файлу. Запуск — одна команда; постоянно работающий сервис не требуется.
Инструмент | Действие |
| Метаданные, листы, форматы и свойства |
| Явный A1-диапазон; формулы по умолчанию |
| Создание таблицы при наличии соответствующих прав Google |
| Запись в согласованный диапазон; RAW по умолчанию |
| Форматирование и разрешённые структурные операции |
Обычное редактирование может заменить содержимое. Сначала прочитать цель; после таймаута записи проверить результат, прежде чем повторять запрос. Автоматических повторов записи и HTTP redirects нет.
Авторизация
GOOGLE_APPLICATION_CREDENTIALS — путь к service-account JSON либо стандартные
Google Application Default Credentials. Таблицы должны быть доступны этому
аккаунту; его права могут отличаться от прав пользователя.
Для пользовательского доступа задать GOOGLE_OAUTH_TOKEN_FILE. Первичный вход
использует штатный Google OAuth Desktop flow:
uv run google-sheets-mcp --authorize --client-secrets /private/client.json --token-file /private/oauth-token.jsonJSON с type=service_account — другой тип credentials, не OAuth Desktop client.
Создание новых файлов ограничивается правами и storage quota Google-аккаунта.
Секреты хранить вне Git с правами 0600; каталог — 0700.
HTTP и Docker
Для общего endpoint задать MCP_TOKEN длиной от 32 символов:
uv run --locked --env-file .env google-sheets-mcp --transport http --port 18091URL: http://127.0.0.1:18091/mcp/, заголовок Authorization: Bearer <MCP_TOKEN>.
По умолчанию сервер слушает loopback. Для доступа извне нужен приватный транспорт/HTTPS.
docker build -t google-sheets-mcp .
docker run --rm -i --env-file .env \
-v /private/credentials.json:/run/secrets/google.json:ro \
-e GOOGLE_APPLICATION_CREDENTIALS=/run/secrets/google.json google-sheets-mcpКонтейнер работает непривилегированным UID 1000; смонтированный файл должен быть доступен этому UID. Docker Desktop не требуется.
Перенос и разработка
Перенести checkout, приватный env-файл и Google credentials; обновить пути. Нет зависимости от Personal Context, Windmill, PostgreSQL или другого MCP.
uv sync --locked
uv run ruff check src tests
uv run python -m unittest discover -b -s tests
uv buildЭто самостоятельный адаптер на официальном Google SDK.
Available Tools
5 toolssheets_batch_updateSheets Batch UpdateBDestructive
Apply approved formatting/structure operations. Deletion, clearing, grid shrinking and unknown requests are rejected. Other edits can still overwrite data.
Inputs: requests (required), spreadsheet_id (required), parameters. Returns: object
sheets_createSheets CreateBDestructive
Create a spreadsheet only on explicit user request. On timeout check for prior creation before retry.
Inputs: parameters (required). Returns: object
sheets_getSheets GetBRead-onlyIdempotent
Read spreadsheet metadata. Grid data requires explicit ranges; inspect before editing.
Inputs: spreadsheet_id (required), parameters. Returns: object
sheets_readSheets ReadARead-onlyIdempotent
Read one explicit A1 range; formulas are preserved by default. A range is not a full workbook.
Inputs: range (required), spreadsheet_id (required), parameters. Returns: object
sheets_writeSheets WriteADestructive
Replace values in the approved A1 range. Default RAW; read back before retrying uncertain writes.
Inputs: range (required), values (required), spreadsheet_id (required), parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
sheets_get and sheets_read both read, but one targets metadata and the other an explicit A1 value range. sheets_write and sheets_batch_update both mutate, but one replaces values while the other applies formatting/structure operations; descriptions clarify the boundary.
All tools use the consistent sheets_ snake_case prefix followed by an action verb. batch_update is a compound action but remains predictable within the same pattern.
Five tools are well-scoped for a Google Sheets server: create, inspect metadata, read ranges, write values, and batch-update structure/formatting. Each tool has a clear role without excessive surface area.
The core create/read/write/format lifecycle is covered, but deletion, clearing, appending rows, and sheet-level lifecycle operations are missing or explicitly rejected. These gaps create dead ends for common cleanup and data-entry workflows.
Maintenance
Related MCP Connectors
Read and write Google Sheets rows via SheetDB APIs; per-API agent permissions, approved deletes.
Google Sheets via Apify: write Apify datasets or JSON rows to a sheet, or read a sheet as JSON.
Write rows to Google Sheets (append, replace, update by key) or read a tab. No OAuth needed.
Connect AI assistants to Google Sheets through controlled tools for reading and updating rows.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to remotely execute shell commands and transfer files on SSH hosts, including jump-host tunneling, background tasks, resumable transfers, and optional approval of destructive commands, while SSH credentials remain in the local process. It runs over stdio or a streamable HTTP daemon and supports auditing, allow/deny lists, and multiple authentication methods.ISC
- AlicenseNot gradedqualityAmaintenanceLets agents create, read, update, list, and restore shared encrypted workspaces and artifacts, exchanging a single link that both people and other AI agents can open and edit. Content is encrypted client-side with version-checked writes, so concurrent writers can't silently clobber each other and links can be shared as read-only or editable.19 npmMIT
- AlicenseAqualityBmaintenanceEnables coding agents to browse, read, search, and write files inside a locked workspace, run asynchronous shell commands, and batch read operations, all with validated caching, health diagnostics, and a SQLite audit trail.38836 npm1AGPL 3.0
- AlicenseAqualityBmaintenanceEnables agent hosts to perform guarded, undoable filesystem operations confined to registered workspaces: atomic whole-file writes, file and directory create/copy/move/delete, staged literal text and line-range edits, patch application, and search, all journaled with content-addressed blobs. Every mutation returns an operation id and undo availability so history can be inspected and safely reverted with conflict detection, while credential-shaped targets are refused and errors come back as structured data with stable codes.2530 PyPIMIT