Apps Script MCP
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
- Go to APIs & Services > Credentials
- Click "Create Credentials" > "OAuth client ID"
- Select "Desktop application" as the application type
- 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
- Go to OAuth consent screen
- 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:
- Ask the assistant to "authenticate with Google" or use
start_google_auth - Open the provided URL in your browser
- Sign in and authorize the application
- Copy the redirect URL (the page will not load - that's expected)
- 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:
- Open the script in the Apps Script editor
- Go to Project Settings (gear icon)
- Under "Google Cloud Platform (GCP) Project", click "Change project"
- Enter your GCP project number
- Click "Deploy" > "New deployment"
- Select type: "API Executable"
- Set "Who has access" to "Anyone" or "Anyone with Google account"
- 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