google-apps-script-mcp
🚀 世界初のGoogle Apps Script完全操作MCPサーバー - セキュリティ重視のスクリプトプロパティ管理とDXTパッケージ対応
Documentation
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でインストール
3. 即座に利用開始!
🛠️ 手動インストール(開発者向け)
1. 依存関係のインストール
npm install2. 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セットアップ確認
2. `clasp_setup` - Clasp CLI認証セットアップガイダンス
3. `clasp_create` - Google Apps Scriptプロジェクト作成準備
4. `clasp_clone` - 既存プロジェクトクローン準備
5. `clasp_pull` - プロジェクト変更取得準備
6. `clasp_push_and_deploy` - プロジェクトプッシュ&デプロイ準備
7. `clasp_list` - プロジェクト一覧取得
> 注意: STABLE版は基本的なClasp操作の準備・ガイダンスを提供します。実際のClasp実行は別途ローカル環境で行ってください。高度なセキュリティ機能については開発版をご利用ください。
🔒 高度なセキュリティ機能(開発版のみ)
- `set_secure_property` - 暗号化保存
- `get_secure_property` - 復号化取得
- `delete_property` - プロパティ削除
- `list_properties` - プロパティ一覧
- `audit_properties` - セキュリティ監査
- `backup_properties` - バックアップ
- `restore_properties` - 復元
⚙️ 環境変数
| 環境変数 | 説明 | 必須 | デフォルト |
|---|---|---|---|
| `GOOGLE_SERVICE_ACCOUNT_KEY` | Service Accountキー | ○※ | - |
| `GOOGLE_CREDENTIALS_PATH` | OAuth認証情報パス | ○※ | - |
| `GOOGLE_AUTH_CODE` | OAuth認証コード | △ | - |
| `ENCRYPTION_KEY` | 暗号化キー(hex) | 推奨 | 自動生成 |
| `LOG_LEVEL` | ログレベル | - | `info` |
| `MCP_SERVER_NAME` | サーバー名 | - | `google-apps-script-mcp` |
※ いずれか1つが必須
🔐 必要なAPIスコープ
https://www.googleapis.com/auth/script.projects
https://www.googleapis.com/auth/script.processes
https://www.googleapis.com/auth/script.deployments
https://www.googleapis.com/auth/script.metrics
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.metadata.readonly🛠️ 開発・テスト
開発モード起動
npm run devテスト実行
npm testDXTファイル生成
npm run build🔍 トラブルシューティング
認証エラー
❌ Google認証に失敗しました: invalid_client解決方法:
1. Service Accountキーが正しいか確認
2. Google Apps Script APIが有効化されているか確認
3. 必要なスコープが付与されているか確認
暗号化エラー
❌ 暗号化エラー: invalid key length解決方法:
1. 暗号化キーが64文字のhex文字列か確認
2. 新しい暗号化キーを生成: `openssl rand -hex 32`
プロパティアクセスエラー
❌ プロパティ取得エラー: permission denied解決方法:
1. スクリプトIDが正しいか確認
2. APIスコープに`script.projects`が含まれているか確認
📄 ライセンス
MIT License - 詳細は LICENSE ファイルを参照
🤝 コントリビューション
1. このリポジトリをフォーク
2. 機能ブランチを作成 (`git checkout -b feature/amazing-feature`)
3. 変更をコミット (`git commit -m 'Add amazing feature'`)
4. ブランチにプッシュ (`git push origin feature/amazing-feature`)
5. Pull Requestを作成
🔗 関連リンク
🆘 サポート
問題が発生した場合は、Issuesを作成してください。
🔒 Security First - Google Apps Script MCP Server
Frequently asked questions
What is google-apps-script-mcp?
google-apps-script-mcp is 🚀 世界初のGoogle Apps Script完全操作MCPサーバー - セキュリティ重視のスクリプトプロパティ管理とDXTパッケージ対応
How do I install google-apps-script-mcp?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is google-apps-script-mcp open source?
Yes — it is hosted on GitHub at https://github.com/Utakata/google-apps-script-mcp and has 1 stars.
Related MCP tools
🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
Use any LLMs (Large Language Models) for Deep Research. Support SSE API and MCP server.
Enhanced MCP server for interactive user feedback and command execution in AI-assisted development, featuring dual interface support (Web UI and Desktop Application) with intelligent environment detection and cross-platform compatibility.
A powerful Zotero AI and MCP plugin with ChatGPT, Gemini 3.7, Claude Fable 5, Claude Opus 5, DeepSeek V4, Grok, OpenRouter, Kimi k3, GLM 5.3, SiliconFlow, GPT-oss, Gemma 4, Qwen 3.8
Connect your browser to AI models. Just use Dia on Chrome, Arc or Firefox.
文颜 MCP Server 可以让 AI 自动将 Markdown 文章排版后发布至微信公众号。
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP