Skip to main content
Glama
README.md
# Google Sheets MCP Server

Googleスプレッドシートと連携するMCP(Model Context Protocol)サーバーです。
ローカル用です。

## 機能

- スプレッドシートの読み取り
- スプレッドシートへの書き込み
- 行の追加
- スプレッドシート情報の取得
- 新しいシートの作成

## 前提
```
node -v
v24.8.0
```

## セットアップ

### 1. 依存関係のインストール

```bash
npm install
```

### 2. Google Cloud認証の設定

1. [Google Cloud Console](https://console.cloud.google.com/)でプロジェクトを作成
2. Google Sheets APIを有効化
3. サービスアカウントを作成し、JSONキーファイルをダウンロード
4. ダウンロードしたキーファイルを`key/`ディレクトリに配置(`mkdir key`)

### 3. ビルド

```bash
npm run build
```

### 4. 起動

```bash
npm run start
```

## 使用方法

### Cursorでの使用

`mcp.json`を設定してCursorで使用できます:

```json
{
  "mcp": {
    "servers": {
      "google-sheets": {
        "command": "node",
        "args": ["プロジェクトまでの絶対パス/dist/index.js"],
        "env": {
          "GOOGLE_APPLICATION_CREDENTIALS": "プロジェクトまでの絶対パス/key/your-service-account-key.json"
        }
      }
    }
  }
}
```

**重要**: `GOOGLE_APPLICATION_CREDENTIALS`のパスは、ダウンロードしたサービスアカウントキーファイルの実際のパスに変更してください。
**重要**: スプレットシートの右上にある「共有」からサービスアカウントのメールアドレスを追加

## 利用可能なツール

- `read_sheet`: スプレッドシートの指定された範囲のデータを読み取る
- `write_sheet`: スプレッドシートの指定された範囲にデータを書き込む
- `append_row`: スプレッドシートの最後に新しい行を追加する
- `get_sheet_info`: スプレッドシートの基本情報を取得する
- `create_sheet`: 新しいシートを作成する

## 注意事項

- サービスアカウントのキーファイルは機密情報です。`.gitignore`に追加して、リポジトリにコミットしないでください
- スプレッドシートにアクセスするには、サービスアカウントのメールアドレスをスプレッドシートの共有設定に追加する必要があります
- 各利用者は自分のGoogle Cloudプロジェクトでサービスアカウントを作成し、キーファイルをダウンロードする必要があります

TDQS

B3.4/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: append_row adds rows, create_sheet creates sheets, get_sheet_info retrieves metadata, read_sheet reads data, and write_sheet writes data. The descriptions clearly differentiate between operations on data versus structure.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern with snake_case naming (e.g., append_row, create_sheet, read_sheet). The verbs are action-oriented and predictable, making the set easy to navigate.

Tool Count4/5

Five tools is reasonable for a Google Sheets server, covering core operations like reading, writing, appending, creating sheets, and getting info. It's slightly lean but functional; minor additions like update or delete operations could enhance it without being necessary.

Completeness4/5

The tools cover essential CRUD-like operations for Google Sheets: create (create_sheet), read (read_sheet, get_sheet_info), and write/append (write_sheet, append_row). A minor gap is the lack of explicit update or delete tools, but agents can work around this using write_sheet for updates.

Maintenance

ActivityInactive
ResponsivenessNo issues