google-spreadsheet-mcp
MCP server enabling AI agents to read, write, and manage Google Sheets, including sheet manipulation, row/column operations, dropdowns, checkboxes, and conditional formatting.
README
Google Spreadsheet MCP Server
Google スプレッドシートを操作するための MCP (Model Context Protocol) サーバーです。 Claude Code などの AI エージェントからスプレッドシートの読み書きが可能になります。
機能
データ操作
| ツール | 説明 |
|---|---|
get_sheet_metadata |
スプレッドシートのタイトルとシート(タブ)一覧を取得 |
read_values |
指定範囲のデータを読み込み |
append_values |
指定範囲の末尾にデータを追記 |
update_values |
指定範囲のデータを上書き更新 |
シート管理
| ツール | 説明 |
|---|---|
add_sheet |
新しいシート(タブ)を追加 |
delete_sheet |
シート(タブ)を削除 |
rename_sheet |
シート(タブ)の名前を変更 |
行列操作
| ツール | 説明 |
|---|---|
insert_rows |
指定位置に空の行を挿入 |
insert_columns |
指定位置に空の列を挿入 |
delete_rows |
指定範囲の行を削除 |
delete_columns |
指定範囲の列を削除 |
入力規則
| ツール | 説明 |
|---|---|
set_dropdown |
ドロップダウンリストを設定(固定値) |
set_dropdown_range |
ドロップダウンリストを設定(セル範囲参照) |
set_checkbox |
チェックボックスを設定 |
get_validations |
入力規則一覧を取得 |
delete_validation |
指定範囲の入力規則を削除 |
条件付き書式
| ツール | 説明 |
|---|---|
add_conditional_format |
カスタム数式による条件付き書式を追加 |
get_conditional_formats |
条件付き書式ルール一覧を取得 |
delete_conditional_format |
指定したインデックスの条件付き書式を削除 |
セットアップ
1. GCP プロジェクト設定
- Google Cloud Console でプロジェクトを作成
- Google Sheets API を有効化
APIs & Services → Enable APIs → 「Google Sheets API」を検索 → 有効化
2. OAuth クライアント ID 作成
- APIs & Services → Credentials → Create Credentials → OAuth client ID
- アプリケーションの種類: ウェブアプリケーション
- 名前を入力(例:
sheets-mcp) - 承認済みのリダイレクトURI:
http://localhost:8080/callbackを追加 - Create → JSON をダウンロード →
credentials/client_secret.jsonとして保存
3. ビルド
pnpm install
pnpm run build
4. Claude Code 設定
.mcp.json をプロジェクトルートに作成:
{
"mcpServers": {
"google-spreadsheet": {
"command": "node",
"args": ["/path/to/google-spreadsheet-mcp/dist/index.js"],
"env": {
"CLIENT_SECRET_PATH": "/path/to/credentials/client_secret.json",
"TOKEN_PATH": "/path/to/credentials/token.json"
}
}
}
}
5. 初回認証
初回起動時にブラウザが開き、Google アカウントでの認証を求められます。
認証後、トークンが TOKEN_PATH に保存され、以降は自動的に認証されます。
Note: 自分の Google アカウントで認証するため、既にアクセス権のあるスプレッドシートはすべて操作可能です。
使用例
シート情報を取得
https://docs.google.com/spreadsheets/d/xxx/edit のシート情報を取得して
データを読み込み
このスプレッドシートのシート1 A1:C10 を読み込んで
データを追記
シート1 に以下のデータを追加して:
- 山田, 25, エンジニア
- 佐藤, 30, デザイナー
データを更新
A1:B2 を以下に更新して:
- 名前, 年齢
- 田中, 28
シートを追加
「売上データ」という名前のシートを追加して
シートの名前を変更
シート1 を「顧客リスト」に名前変更して
ドロップダウンを設定
D列にドロップダウンを設定して。選択肢は「承認」「却下」「保留」
チェックボックスを設定
E列にチェックボックスを設定して
条件付き書式を追加
D列が「承認」の場合は行全体を緑色にして
制限事項
- 新規スプレッドシートの作成は非対応
- 書式設定はカスタム数式による条件付き書式のみ対応(フォント変更等は非対応)
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.