Apps Script MCP

Apps Script MCP

Enables users to create, manage, and execute Google Apps Script projects through natural language. It provides comprehensive tools for code editing, function execution, deployment management, and monitoring script processes.

Category
访问服务器

README

Apps Script MCP

Tests

MCP server for Google Apps Script - create, manage, and execute Apps Script projects through natural language.

Features

  • Project Management: List, create, read, and update Apps Script projects
  • Code Editing: View and modify script files (JavaScript, HTML, JSON)
  • Execution: Run script functions with parameters
  • Deployments: Create, list, update, and delete deployments
  • Monitoring: View recent script executions and their status

Installation

# Clone the repository
git clone https://github.com/sam-ent/appscript-mcp.git
cd appscript-mcp

# Install with uv (recommended)
uv sync

# Or install with pip
pip install -e .

Prerequisites

1. Google Cloud Project Setup

Before using the MCP server, configure your Google Cloud project:

Enable Required APIs

Enable these APIs in your Google Cloud Console:

Create OAuth Credentials

  1. Go to APIs & Services > Credentials
  2. Click "Create Credentials" > "OAuth client ID"
  3. Select "Desktop application" as the application type
  4. Download the JSON file

Save Credentials

Save the downloaded JSON file to one of these locations:

  • ~/.appscript-mcp/client_secret.json (recommended)
  • ./client_secret.json (current directory)
  • ~/.secrets/client_secret.json

Or set the environment variable:

export GOOGLE_CLIENT_SECRET_PATH=/path/to/client_secret.json

Configure OAuth Consent Screen

  1. Go to OAuth consent screen
  2. Add yourself as a test user (required for unverified apps)

2. Configure MCP Client

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "appscript": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/appscript-mcp", "appscript-mcp"]
    }
  }
}

Claude Code

Add to ~/.mcp.json:

{
  "mcpServers": {
    "appscript": {
      "type": "stdio",
      "command": "/path/to/appscript-mcp/.venv/bin/python",
      "args": ["-m", "appscript_mcp.server"],
      "env": {
        "MCP_TIMEOUT": "30000",
        "MCP_TOOL_TIMEOUT": "90000"
      }
    }
  }
}

Authentication

On first use, authenticate with Google:

  1. Ask the assistant to "authenticate with Google" or use start_google_auth
  2. Open the provided URL in your browser
  3. Sign in and authorize the application
  4. Copy the redirect URL (the page will not load - that's expected)
  5. Provide the redirect URL to complete_google_auth

Credentials are cached in ~/.appscript-mcp/token.pickle for future sessions.

Available Tools

Authentication

Tool Description
start_google_auth Start OAuth flow, returns authorization URL
complete_google_auth Complete OAuth with redirect URL

Project Management

Tool Description
list_script_projects List all accessible Apps Script projects
get_script_project Get project details including all files
get_script_content Get content of a specific file
create_script_project Create a new project
update_script_content Update files in a project

Execution

Tool Description
run_script_function Execute a function in a script

Deployments

Tool Description
create_deployment Create a new deployment
list_deployments List all deployments
update_deployment Update deployment configuration
delete_deployment Delete a deployment

Monitoring

Tool Description
list_script_processes View recent script executions

Usage Examples

List Projects

"Show me my Apps Script projects"

Create a Project

"Create a new Apps Script project called 'Email Automation'"

Add Code to a Project

"Add a function to my Email Automation script that sends a daily summary email"

Execute a Function

"Run the sendDailySummary function in my Email Automation script"

Deploy

"Create a production deployment for my Email Automation script"

Limitations

run_script_function Requires API Executable Deployment

The run_script_function tool requires manual configuration in the Apps Script editor:

  1. Open the script in the Apps Script editor
  2. Go to Project Settings (gear icon)
  3. Under "Google Cloud Platform (GCP) Project", click "Change project"
  4. Enter your GCP project number
  5. Click "Deploy" > "New deployment"
  6. Select type: "API Executable"
  7. Set "Who has access" to "Anyone" or "Anyone with Google account"
  8. Click "Deploy"

All other tools work without this manual step.

API Quotas

Google enforces rate limits on the Apps Script API. If running many operations, you may encounter quota errors. See Apps Script Quotas for details.

Development

Run Tests

uv run pytest tests/ -v

Run Server Directly

uv run appscript-mcp

License

MIT License - see LICENSE file

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选