HM

hellotinah/mcp

Developer tools

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

35 stars 11 forks 品質 57 トレンド 12

MCPコード例

概要

GoogleスプレッドシートとGoogleフォームと連携するためのツール、リソース、およびプロンプトを提供するシンプルなMCPサーバー。 - list spreadsheet - Googleスプレッドシート - read sheet - Googleスプレッドシートからデータを読みます - write sheet - Googleシートにデータを書き込む - append sheet - Googleスプレッドシートにデータを追加する - create spreadsheet - 新しいスプレッドシートを作成 - Create form - 新しいGoogleフォームを作成する - シート://{spreadsheet id}/{range name} - リソースとしてアクセスシートデータ - analytics sheet data - シートデータを分析するためのテンプレート - create report template - レポートスプレッドシートを作成するためのテンプレート - form to sheet - フォームからシートワークフローのテンプレート 1。 Google Cloud Console 2に移動します。 新しいプロジェクトを作成するか、既存のプロジェクト3を選択します。 以下の API を有効にする: - Google Sheets API - Google のフォーム API - Google Drive API 4. 「認証」→「認証」→「OAuth クライアント ID」5. アプリケーションタイプ 6 として「デスクトップ アプリ」を選択します。 資格情報 JSON ファイルをダウンロード 7. 資格情報として保存します.

概要(AI 翻訳)

GoogleスプレッドシートとGoogleフォームと連携するためのツール、リソース、およびプロンプトを提供するシンプルなMCPサーバー。

##特徴

ツール

  • [list_spreadsheets] - Googleスプレッドシートのリスト
  • [read_sheet - Googleシートからデータを読み込みます
  • [write_sheet - Googleシートにデータを書き込みます
  • [append_sheet - Googleシートにデータを追加する
  • [create_spreadsheet - 新しいスプレッドシートを作成する
  • [create_form - 新しいGoogleフォームを作成します

リソース

  • [sheet://{spreadsheet_id}/{range_name} - リソースとしてアクセスシートデータ

プロンプト

  • analyze_sheet_data - シートデータを分析するためのテンプレート
  • [create_report_template - レポートスプレッドシートを作成するためのテンプレート
  • [form_to_sheet - シートワークフローのテンプレート

セットアップ

##1. 仮想環境を作成する

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

##3. Google API認証情報の取得

1。 Googleクラウドコンソールに行く 2. 新規プロジェクトを作成するか、既存のプロジェクトを選択 3. 以下の API を有効にします。

  • GoogleスプレッドシートAPI
  • GoogleのフォームAPI
  • GoogleドライブAPI
  1. 「認証」→「認証」→「OAuthクライアントID」に移動
  2. アプリケーションタイプとして「デスクトップアプリ」を選択
  3. 資格情報JSONファイルのダウンロード
  4. このディレクトリの[credentials.jsonとして保存する

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

README

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

Google Sheets & Forms MCP Server

A simple MCP server that provides tools, resources, and prompts for working with Google Sheets and Google Forms.

Features

Tools

  • list_spreadsheets - List your Google Spreadsheets
  • read_sheet - Read data from a Google Sheet
  • write_sheet - Write data to a Google Sheet
  • append_sheet - Append data to a Google Sheet
  • create_spreadsheet - Create a new spreadsheet
  • create_form - Create a new Google Form

Resources

  • sheet://{spreadsheet_id}/{range_name} - Access sheet data as a resource

Prompts

  • analyze_sheet_data - Template for analyzing sheet data
  • create_report_template - Template for creating report spreadsheets
  • form_to_sheet - Template for form-to-sheet workflow

Setup

1. Create virtual environment

cd gsheets-mcp-server
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

2. Install dependencies

pip install -r requirements.txt

3. Get Google API Credentials

  1. Go to Google Cloud Console
  2. Create a new project or select existing one
  3. Enable the following APIs:
    • Google Sheets API
    • Google Forms API
    • Google Drive API
  4. Go to “Credentials” → “Create Credentials” → “OAuth client ID”
  5. Choose “Desktop app” as application type
  6. Download the credentials JSON file
  7. Save it as credentials.json in this directory

4. Test the server with MCP Inspector

npx @modelcontextprotocol/inspector python gsheets_server.py

Claude Desktop Configuration

Add this to your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "gsheets": {
      "command": "python",
      "args": [
        "/FULL/PATH/TO/gsheets-mcp-server/gsheets_server.py"
      ],
      "env": {
        "GOOGLE_CREDENTIALS_PATH": "/FULL/PATH/TO/gsheets-mcp-server/credentials.json"
      }
    }
  }
}

Important: Replace /FULL/PATH/TO/ with the actual absolute path to this directory.

First Run

On first run, the server will open a browser window for Google authentication. After you authorize the app, a token.pickle file will be created to store your credentials for future use.

Example Usage in Claude Desktop

Once configured, you can ask Claude:

  • “List my spreadsheets”
  • “Read the data from spreadsheet ID ‘abc123’ in range ‘Sheet1!A1:C10’”
  • “Create a new spreadsheet called ‘Q1 Report’”
  • “Append this data to my sheet: [[‘Name’, ‘Email’], [‘John’, ‘[email protected]’]]”
  • “Use the analyze_sheet_data prompt”
  • “Show me the sheet resource for spreadsheet ‘abc123’”

Getting Spreadsheet IDs

The spreadsheet ID is in the URL:

https://docs.google.com/spreadsheets/d/SPREADSHEET_ID_HERE/edit

Troubleshooting

  • Authentication fails: Delete token.pickle and run again
GitHub で README 全文を見る

インストール

npx @modelcontextprotocol/inspector python gsheets_server.py
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "gsheets": { "command": "python", "args": [ "/FULL/PATH/TO/gsheets-mcp-server/gsheets_server.py" ], "env": { "GOOGLE_CREDENTIALS_PATH": "/FULL/PATH/TO/gsheets-mcp-server/credentials.json" } } } }