Claude-GAS-Bridge
local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Allows execution of custom Google Apps Script code through a bridge that forwards scripts from an MCP client to a GAS Interpreter endpoint, enabling AI agents to run custom scripts in the Google Apps Script environment.
Claude-GAS-Bridge
Node.js を用いて、MCP (Model Context Protocol) クライアント(例: Claude Desktop)と GAS Interpreter(Google Apps Script 側)を接続するブリッジサーバーです。bridge.mjs
内で @modelcontextprotocol/sdk の MCP サーバーを起動し、GAS のWebエンドポイントへ HTTP POST する機能を提供します。
構成概要
bridge.mjs
MCPサーバー本体。execute-gas
というツールを定義し、クライアントから受け取ったGASスクリプトを指定の WebApp(Apps Script)エンドポイントへ転送します。
ツール呼び出し時、タイトル・スクリプト本文・APIキーを JSON で送信する形です。
必要環境
- Node.js 18 以上
@modelcontextprotocol/sdk
が Node 18 以降を推奨しています - GAS Interpreter のデプロイ済み
Google Apps Script で GAS Interpreter を正しくデプロイし、ウェブアプリのURLを取得しておく - (オプション)Claude Desktop 等、MCP クライアント
セットアップ
- ソースを取得Copy
- 依存パッケージをインストール※ Yarn でも可Copy
- GASのデプロイURLを設定
bridge.mjs
内のGAS_ENDPOINT
を、実際のApps ScriptのURLに書き換える。
例:Copy - Node.js でサーバー起動コンソールにCopy
"Bridge server started (Stdio). Waiting for requests..."
と表示されたら待機状態となり、MCPクライアントからの呼び出しを受け付けます。
Claude Desktop との連携 (例)
もし Claude Desktop で利用する場合、claude_desktop_config.json
に以下のように設定します:
- Claude Desktop を再起動
- チャット画面下部のツール一覧(ハンマーアイコン)で
execute-gas
が見えるはずです - 「ChatGPT を通じて GASスクリプトを実行したい」などの指示をすると、
bridge.mjs
がリクエストを受け、GAS Interpreterに転送します
APIキーの管理について
- GAS Interpreter 側が API キーを要求する場合は、ツール呼び出し時に
"apiKey": "..."
を指定するか、bridge.mjs
内部で環境変数を参照して埋め込むなど適宜調整してください。
You must be authenticated.
A bridge server that connects MCP clients (like Claude Desktop) to Google Apps Script, allowing execution of GAS scripts through natural language interfaces.