overdozer1124/gas-mcp-server-v2
3.1
If you are the rightful owner of gas-mcp-server-v2 and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Gas MCP Server v2.0 is a Google Apps Script MCP Server with enhanced authentication and container-bound support, designed for secure and efficient Google API access.
๐ Gas MCP Server v2.0
Google Apps Script MCP Server with Enhanced Authentication and Container-Bound Support
๐ฏ Features
- โ
Container-Bound Apps Script Creation: Proper
parentId
handling - โ OAuth2 Authentication: Secure Google API access
- โ MCP Protocol Compatible: Works with Claude Desktop
- โ Error Handling: Comprehensive error reporting
- โ Debug Support: Detailed logging for troubleshooting
๐ง Installation
1. Deploy to Railway
2. Environment Variables
Set the following environment variables in Railway:
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GOOGLE_REDIRECT_URI=https://your-railway-app.up.railway.app/oauth/callback
GOOGLE_REFRESH_TOKEN=your_refresh_token
NODE_ENV=production
PORT=3001
๐ Authentication Setup
1. Google Cloud Console
- Go to Google Cloud Console
- Create a new project or select existing
- Enable APIs:
- Google Sheets API
- Google Apps Script API
- Google Drive API
- Create OAuth 2.0 Credentials:
- Application type: Web application
- Authorized redirect URIs:
https://your-railway-app.up.railway.app/oauth/callback
2. Get Refresh Token
- Access:
https://your-railway-app.up.railway.app/mcp/authorize
- Complete OAuth flow
- Copy the refresh token
- Update Railway environment variable:
GOOGLE_REFRESH_TOKEN
๐ API Endpoints
Health Check
GET /health
Authorization
GET /mcp/authorize
GET /oauth/callback
Apps Script Operations
POST /create_container_bound_script
PUT /update_script_content
POST /run_script
๐งช Testing Container-Bound Creation
curl -X POST "https://your-railway-app.up.railway.app/create_container_bound_script" \
-H "Content-Type: application/json" \
-d '{
"title": "Test Container-Bound Script",
"parentId": "YOUR_SPREADSHEET_ID"
}'
Expected Response:
{
"success": true,
"scriptId": "SCRIPT_ID",
"url": "https://script.google.com/d/SCRIPT_ID/edit",
"parentId": "YOUR_SPREADSHEET_ID",
"containerBound": true
}
๐ Troubleshooting
Container-Bound Verification
In Apps Script editor, run:
function verifyContainerBinding() {
try {
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
console.log('โ
Container-bound successful:', spreadsheet.getId());
return spreadsheet.getId();
} catch (error) {
console.log('โ Container-bound failed:', error.toString());
return null;
}
}
Common Issues
parentId
not working: Check Google Apps Script API is enabled- Authentication errors: Verify refresh token and scopes
- Permission errors: Ensure OAuth consent screen is configured
๐ License
MIT ยฉ 2025 - Gas MCP Server v2.0