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.

克劳德-加斯-布里奇

这是一个使用 Node.js 连接MCP(模型上下文协议)客户端(例如 Claude Desktop)和 GAS 解释器(Google Apps Script 端)的桥接服务器。
bridge.mjs中,启动@modelcontextprotocol/sdk的 MCP 服务器,并提供向 GAS Web 端点进行 HTTP POST 的功能。

配置概述

claude-gas-bridge/ ├─ bridge.mjs # メインのMCPサーバーコード ├─ package.json ├─ package-lock.json └─ ... (その他ファイル)
  • bridge.mjs
    MCP 服务器本身。定义一个名为execute-gas的工具,将从客户端收到的GAS脚本传输到指定的WebApp(Apps Script)端点。
    调用该工具时,标题、脚本文本和 API 密钥以 JSON 格式发送。

要求

  • Node.js 18 及以上版本
    @modelcontextprotocol/sdk建议使用 Node 18 及以上版本
  • GAS 解释器已部署
    在 Google Apps Script 中正确部署 GAS 解释器并获取 Web 应用的 URL。
  • (可选)MCP 客户端,例如 Claude Desktop

设置

  1. 获取源代码
    git clone <このリポジトリのURL> cd claude-gas-bridge
  2. 安装依赖包
    npm install
    * 纱线也可以接受
  3. 设置 GAS 部署 URL
    bridge.mjs中的GAS_ENDPOINT替换为实际的 Apps Script URL。
    例子:
    const GAS_ENDPOINT = "https://script.google.com/macros/s/AKfycbxxxxx/exec";
  4. 使用 Node.js 启动服务器
    node bridge.mjs
    当控制台显示"Bridge server started (Stdio). Waiting for requests..."服务器处于待机模式,将接受来自 MCP 客户端的调用。

与 Claude Desktop 集成(示例)

如果您使用的是 Claude Desktop,请将以下内容添加到claude_desktop_config.json

{ "mcpServers": { "gas-bridge": { "command": "node", "args": [ "/絶対パス/claude-gas-bridge/bridge.mjs" ] } } }
  1. 重启Claude桌面
  2. 您应该在聊天屏幕底部的工具列表(锤子图标)中看到execute-gas
  3. 当你发出诸如“我想通过 ChatGPT 运行 GAS 脚本”之类的指令时, bridge.mjs会接收请求并将其转发给 GAS 解释器。

管理 API 密钥

  • 如果 GAS 解释器需要 API 密钥,请在调用该工具时指定"apiKey": "..." ,或者引用bridge.mjs中的环境变量并根据需要嵌入。

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

将 MCP 客户端(如 Claude Desktop)连接到 Google Apps Script 的桥接服务器,允许通过自然语言界面执行 GAS 脚本。

  1. 構成概要
    1. 必要環境
      1. セットアップ
        1. Claude Desktop との連携 (例)
          1. APIキーの管理について
            ID: mfqd2f9akw