Google Apps Script MCP Server

$Drag and drop google-apps-script-mcp-STABLE-FIXED.dxt into Claude Desktop Extensions tab
README.md

Comprehensive management of Google Apps Script projects and deployments.

Google Apps Script MCP Server 🔒✨

世界初のGoogle Apps Script完全操作MCPサーバー - JSON-RPC Protocol完全準拠版

🚨 最新情報 - CRITICAL FIX v1.1.0 STABLE

🎉 重要な問題を完全解決!

JSON-RPC Protocol汚染エラー完全修正
プロセス早期終了エラー根本解決
99%軽量化達成: 647KB → 4.82KB
Claude Desktop v0.11.6 完全対応

詳細: CRITICAL-FIX-REPORT.md を参照

✨ 特徴

🔒 **セキュリティファースト設計**

  • スクリプトプロパティ暗号化: AES-256-GCM暗号化で機密情報を安全に保存
  • セキュリティ監査: 自動的な脆弱性チェック・推奨事項の提示
  • バックアップ・復元: チェックサム検証付きの安全なデータ管理
  • アクセス制御: 適切な権限管理とAPIスコープ制限

🚀 **完全なGAS操作**

  • プロジェクト管理: 作成・更新・削除・一覧取得
  • ファイル操作: スクリプト・HTMLファイルの読み書き・実行
  • デプロイ管理: Webアプリ・アドオン・ライブラリ公開
  • トリガー管理: 時間・イベント・フォーム連動
  • ログ・監視: 実行ログ・エラー監視・パフォーマンス分析

🛡️ **高度なセキュリティ機能**

  • 暗号化プロパティ管理: APIキー・パスワードの安全な保存
  • セキュリティ監査: 機密情報の検出・暗号化推奨
  • 安全なバックアップ: 暗号化されたデータの保護
  • 復元機能: チェックサム検証による完全性保証

🔧 インストール

🚀 クイックスタート - DXTファイル(推奨)

Claude Desktop v0.11.6以降で最も簡単な方法:

  1. DXTファイルをダウンロード

    google-apps-script-mcp-STABLE-FIXED.dxt (4.82KB)
    
  2. Claude Desktopでインストール

    • Claude Desktop設定を開く
    • 「Extensions」タブを選択
    • DXTファイルをドラッグ&ドロップまたは選択
    • 「Install」をクリック
  3. 即座に利用開始!

    • 7つのClaspツールが自動で利用可能
    • 設定不要、依存関係も自動解決
    • JSON-RPC Protocol 100%準拠

🛠️ 手動インストール(開発者向け)

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

2. Google Cloud設定

**推奨: Service Account認証**
  1. Google Cloud Consoleでプロジェクトを作成
  2. Google Apps Script API を有効化
  3. Service Accountを作成してキーをダウンロード
  4. 環境変数を設定:
# Service Accountキー(JSON文字列)
export GOOGLE_SERVICE_ACCOUNT_KEY='{"type":"service_account","project_id":"your-project",...}'

# または、ファイルパス指定
export GOOGLE_SERVICE_ACCOUNT_KEY="/path/to/service-account-key.json"

# 暗号化キー(推奨)
export ENCRYPTION_KEY="your-hex-encryption-key"
**代替: OAuth2.0認証**
export GOOGLE_CREDENTIALS_PATH="/path/to/credentials.json"
export GOOGLE_AUTH_CODE="your-authorization-code"

3. Claude.ai MCP設定

.envファイルまたは環境変数を設定後、Claude.aiの設定に以下を追加:

{
  "mcpServers": {
    "google-apps-script-mcp": {
      "command": "node",
      "args": ["src/index-security.js"],
      "cwd": "/path/to/google-apps-script-mcp",
      "env": {
        "GOOGLE_SERVICE_ACCOUNT_KEY": "your-service-account-key",
        "ENCRYPTION_KEY": "your-encryption-key"
      }
    }
  }
}

🔒 セキュリティツール

**スクリプトプロパティ管理**

// APIキーを暗号化して保存
await setSecureProperty("script-id", "API_KEY", "your-secret-key", true);

// 暗号化されたAPIキーを取得
const apiKey = await getSecureProperty("script-id", "API_KEY", true);

// 全プロパティを一覧表示(マスキング付き)
await listProperties("script-id", true, true);

**セキュリティ監査**

// セキュリティ監査を実行
const audit = await auditProperties("script-id");
// → 機密情報の検出、暗号化推奨、統計情報

// プロパティをバックアップ
const backup = await backupProperties("script-id", false);
// → チェックサム付きバックアップ

// バックアップから復元
await restoreProperties("script-id", backup, true);
// → チェックサム検証付き復元

🚀 基本的な使用方法

**プロジェクト作成**

// 新しいGASプロジェクトを作成
const project = await createGasProject("My New Project");
console.log(`プロジェクトID: ${project.scriptId}`);

**スクリプトファイル管理**

// スクリプトファイルを作成
await createGasFile(scriptId, "main.js", "SERVER_JS", `
function myFunction() {
  console.log("Hello from GAS!");
}
`);

// ファイル内容を取得
const fileContent = await getGasFile(scriptId, "main.js");

**関数実行**

// GAS関数を実行
const result = await executeGasFunction(scriptId, "myFunction", []);
console.log("実行結果:", result);

**Webアプリデプロイ**

// Webアプリとしてデプロイ
const deployment = await deployGasWebApp(scriptId, null, "appsscript", "初回デプロイ");
console.log(`WebアプリURL: ${deployment.url}`);

🔒 セキュリティのベストプラクティス

**1. 暗号化の活用**

// ❌ 平文でAPIキーを保存(危険)
await setSecureProperty(scriptId, "api_key", "secret123", false);

// ✅ 暗号化してAPIキーを保存(安全)
await setSecureProperty(scriptId, "api_key", "secret123", true);

**2. 定期的なセキュリティ監査**

// 月1回実行推奨
const audit = await auditProperties(scriptId);
if (audit.suspiciousKeys.length > 0) {
  console.warn("暗号化が必要なキーが見つかりました:", audit.suspiciousKeys);
}

**3. バックアップの実施**

// 重要なプロパティは定期的にバックアップ
const backup = await backupProperties(scriptId, false); // 復号化してバックアップ
// 安全な場所に保存...

📋 利用可能なツール(STABLE版)

**🔧 Claspツール(7種類)**

  1. dependency_check - システム環境検証とClasp CLIセットアップ確認

Tools (12)

dependency_checkSystem environment verification and Clasp CLI setup confirmation.
setSecurePropertyEncrypt and save script properties like API keys safely.
getSecurePropertyRetrieve encrypted script properties.
listPropertiesList all properties with optional masking.
auditPropertiesPerform security audit to detect sensitive information and recommend encryption.
backupPropertiesCreate a backup of properties with checksum verification.
restorePropertiesRestore properties from a backup with checksum validation.
createGasProjectCreate a new Google Apps Script project.
createGasFileCreate a script or HTML file within a project.
getGasFileRetrieve the content of a specific GAS file.
executeGasFunctionExecute a specific function within a GAS project.
deployGasWebAppDeploy a GAS project as a web app, addon, or library.

Environment Variables

GOOGLE_SERVICE_ACCOUNT_KEYrequiredService Account JSON key string or file path
ENCRYPTION_KEYHex encryption key for AES-256-GCM
GOOGLE_CREDENTIALS_PATHPath to OAuth2 credentials JSON
GOOGLE_AUTH_CODEOAuth2 authorization code

Configuration

claude_desktop_config.json
{"mcpServers": {"google-apps-script-mcp": {"command": "node", "args": ["src/index-security.js"], "cwd": "/path/to/google-apps-script-mcp", "env": {"GOOGLE_SERVICE_ACCOUNT_KEY": "your-service-account-key", "ENCRYPTION_KEY": "your-encryption-key"}}}}

Try it

Create a new Google Apps Script project named 'Inventory Manager'
Add a main.js file to my GAS project that logs 'Hello World' and execute it
Securely store my OpenAI API key in the script properties with encryption
Run a security audit on my GAS project to check for unencrypted secrets
Deploy my current script as a web app and give me the URL

Frequently Asked Questions

What are the key features of Google Apps Script MCP Server?

Security-first design with AES-256-GCM encryption for script properties. Full project lifecycle management including creation, file operations, and deletion. Automated security auditing to detect vulnerabilities and sensitive data. Web app, add-on, and library deployment management. Checksum-verified backup and restoration of project data.

What can I use Google Apps Script MCP Server for?

Developers needing to manage multiple Google Apps Script projects via CLI or AI. Teams requiring secure management of API keys and secrets within GAS environments. Automating the deployment of GAS-based web applications and add-ons. Performing security compliance audits on existing Google Apps Script codebases.

How do I install Google Apps Script MCP Server?

Install Google Apps Script MCP Server by running: Drag and drop google-apps-script-mcp-STABLE-FIXED.dxt into Claude Desktop Extensions tab

What MCP clients work with Google Apps Script MCP Server?

Google Apps Script MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Use Google Apps Script MCP Server with Conare

Manage MCP servers visually, upload persistent context, and never start from zero with Claude Code & Codex.

Try Free