MCP Hub
Back to servers

GAS MCP Server Advanced

An enterprise-grade MCP server that integrates AI agents with Google Sheets and Apps Script using over 100 specialized tools for automation and data analysis. It features a self-healing architecture with advanced security and observability for production-ready workflows.

glama
Updated
Mar 14, 2026

Version Node.js TypeScript License MCP Server

Tools Security Self-Healing Observability


🚀 Enterprise-Grade MCP Server for Google Sheets & Apps Script 🚀

A production-ready Model Context Protocol server that provides intelligent integration between autonomous AI agents and Google Sheets/Apps Script with 100+ tools, enterprise security, self-healing capabilities, and complete observability.

flowchart LR
    subgraph "🤖 AI Agents"
        A[MCP Client]
    end
    
    subgraph "🔷 MCP Server"
        B[Tool Registry]
        C[Rate Limiter]
        D[Context Engine]
        E[Security Layer]
    end
    
    subgraph "📊 Google APIs"
        F[Sheets API]
        G[Apps Script]
        H[Drive API]
    end
    
    A -->|JSON-RPC| B
    B --> C --> D --> E --> F
    E --> G
    E --> H
    
    style A fill:#1a1a2e,stroke:#00d9ff,color:#fff
    style B fill:#16213e,stroke:#a855f7,color:#fff
    style C fill:#0f3460,stroke:#22c55e,color:#fff
    style D fill:#1a1a2e,stroke:#f59e0b,color:#fff
    style E fill:#0f0f23,stroke:#ef4444,color:#fff
    style F fill:#1e3a5f,stroke:#3b82f6,color:#fff
    style G fill:#1e3a5f,stroke:#3b82f6,color:#fff
    style H fill:#1e3a5f,stroke:#3b82f6,color:#fff

⭐ Star us on GitHub📖 Read the Docs💬 Join Discord🐛 Report Issues
GitHub starsDocsDiscordIssues

📋 Table of Contents (Click to expand)

✨ Features

Powerful capabilities that set us apart

🧠

Context Intelligence

Token estimation • Compression • Semantic search • Dataset management

100K+ tokens supported

🛠️

100+ MCP Tools

Spreadsheet ops • AI analysis • Automation workflows • Data pipelines

Comprehensive coverage

💚

Self-Healing

Circuit breaker • Auto-retry • Error recovery • Health checks

99.9% uptime

Adaptive Rate Limiting

Per-agent limits • Per-API quotas • Sliding windows • Backoff strategy

Smart throttling

🔐

Enterprise Security

RBAC • AES-256 encryption • OAuth2 • Audit logging • SOC2 ready

Bank-grade protection

📊

Complete Observability

Metrics • Tracing • Health checks • Alerting • Audit logs

Full visibility


🏗️ Architecture

Enterprise-grade system architecture

╔═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║                                          GOOGLE APPS SCRIPT MCP SERVER                                              ║
║                                                  HIGH-LEVEL ARCHITECTURE                                             ║
╠═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╣
║                                                                                                                                 ║
║      ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐   ║
║      │                                                    🤖 MCP CLIENT (AI AGENT)                                   │   ║
║      │                                                         ┌──────────────┐                                       │   ║
║      │                                                         │ JSON-RPC 2.0 │                                       │   ║
║      │                                                         │  SSE Stream  │                                       │   ║
║      │                                                         └──────┬───────┘                                       │   ║
║      └───────────────────────────────────────────────────────────────┼───────────────────────────────────────────────┘   ║
║                                                                  │                                                    ║
║                                                                  ▼                                                    ║
║      ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐   ║
║      │                                                   🔷 MCP SERVER                                                │   ║
║      │  ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐  │   ║
║      │  │                                     📦 SERVER MANAGEMENT LAYER                                          │  │   ║
║      │  │  ┌────────────────┐     ┌───────────────────┐     ┌────────────────────────┐     ┌─────────────────┐   │  │   ║
║      │  │  │   ⚙️ Config   │     │   🖥️ Server        │     │     🗂️ Tool            │     │   🔒 Auth       │   │  │   ║
║      │  │  │   Manager     │     │   Manager          │     │     Registry          │     │   Manager       │   │  │   ║
║      │  │  └────────────────┘     └───────────────────┘     └────────────────────────┘     └─────────────────┘   │  │   ║
║      │  └──────────────────────────────────────────────────────────────────────────────────────────────────────────┘  │   ║
║      │                                                                                                                 │   ║
║      │  ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐  │   ║
║      │  │                                🧠 CONTEXT INTELLIGENCE LAYER                                              │  │   ║
║      │  │  ┌────────────────┐     ┌───────────────────┐     ┌────────────────────────┐     ┌─────────────────┐   │  │   ║
║      │  │  │   📊 Context  │     │   🎯 Token        │     │     💾 Dataset         │     │   🗄️ Embedding │   │  │   ║
║      │  │  │   Manager     │     │   Estimator       │     │     Store              │     │   Store         │   │  │   ║
║      │  │  └────────────────┘     └───────────────────┘     └────────────────────────┘     └─────────────────┘   │  │   ║
║      │  │  ┌────────────────┐     ┌───────────────────┐     ┌────────────────────────┐     ┌─────────────────┐   │  │   ║
║      │  │  │   🗜️ Compress │     │   💨 Memory      │     │     🔍 Semantic        │     │   📐 Truncator │   │  │   ║
║      │  │  │   or          │     │   Cache          │     │     Search             │     │                 │   │  │   ║
║      │  │  └────────────────┘     └───────────────────┘     └────────────────────────┘     └─────────────────┘   │  │   ║
║      │  └──────────────────────────────────────────────────────────────────────────────────────────────────────────┘  │   ║
║      │                                                                                                                 │   ║
║      │  ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐  │   ║
║      │  │                                     🔌 MIDDLEWARE LAYER                                                     │  │   ║
║      │  │  ┌────────────────┐     ┌───────────────────┐     ┌────────────────────────┐     ┌─────────────────┐   │  │   ║
║      │  │  │   ⏱️ Rate     │     │   🔄 Interceptor  │     │     ⚠️ Error           │     │   📝 Prompt    │   │  │   ║
║      │  │  │   Limiter     │     │   Chain           │     │     Handler           │     │   Manager       │   │  │   ║
║      │  │  └────────────────┘     └───────────────────┘     └────────────────────────┘     └─────────────────┘   │  │   ║
║      │  └──────────────────────────────────────────────────────────────────────────────────────────────────────────┘  │   ║
║      │                                                                                                                 │   ║
║      │  ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐  │   ║
║      │  │                                     🔐 SECURITY LAYER                                                       │  │   ║
║      │  │  ┌────────────────┐     ┌───────────────────┐     ┌────────────────────────┐     ┌─────────────────┐   │  │   ║
║      │  │  │   🛡️ Access  │     │   🔏 Encryption  │     │     🔎 Threat          │     │   ✅ Compliance │   │  │   ║
║      │  │  │   Control     │     │                   │     │     Detection          │     │                 │   │  │   ║
║      │  │  └────────────────┘     └───────────────────┘     └────────────────────────┘     └─────────────────┘   │  │   ║
║      │  └──────────────────────────────────────────────────────────────────────────────────────────────────────────┘  │   ║
║      │                                                                                                                 │   ║
║      │  ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐  │   ║
║      │  │                                    📈 OBSERVABILITY LAYER                                                  │  │   ║
║      │  │  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌───────────┐  ┌───────────┐  ┌────────────────┐           │  │   ║
║      │  │  │  📊      │  │  ❤️       │  │  🔍      │  │   📋      │  │   🔔       │  │    📜         │           │  │   ║
║      │  │  │ Metrics  │  │ Health   │  │ Tracing  │  │  Audit    │  │ Alerting   │  │    Logging    │           │  │   ║
║      │  │  └──────────┘  └──────────┘  └──────────┘  └───────────┘  └───────────┘  └────────────────┘           │  │   ║
║      │  └──────────────────────────────────────────────────────────────────────────────────────────────────────────┘  │   ║
║      │                                                                                                                 │   ║
║      │  ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐  │   ║
║      │  │                                    💚 SELF-HEALING LAYER                                                   │  │   ║
║      │  │  ┌────────────────┐     ┌───────────────────┐     ┌────────────────────────┐                          │  │   ║
║      │  │  │   🔄 Circuit │     │   🔁 Auto        │     │     🩺 Health          │                          │  │   ║
║      │  │  │   Breaker    │     │   Retry         │     │     Monitor            │                          │  │   ║
║      │  │  └────────────────┘     └───────────────────┘     └────────────────────────┘                          │  │   ║
║      │  └──────────────────────────────────────────────────────────────────────────────────────────────────────────┘  │   ║
║      └───────────────────────────────────────────────────────────────────────────────────────────────────────────────┘   ║
║                                                                  │                                                    ║
║                                                                  ▼                                                    ║
║      ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────┐   ║
║      │                                                📱 GOOGLE APIS                                                │   ║
║      │   ┌──────────────────────┐     ┌────────────────────────┐     ┌─────────────────────────────────────────┐    │   ║
║      │   │       📊            │     │        📜              │     │              📁                       │    │   ║
║      │   │    Sheets API       │     │    Apps Script API     │     │            Drive API                   │    │   ║
║      │   └──────────────────────┘     └────────────────────────┘     └─────────────────────────────────────────┘    │   ║
║      └───────────────────────────────────────────────────────────────────────────────────────────────────────────────┘   ║
╚═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝

Request Flow

┌──────────┐     ┌───────────────┐     ┌────────────────┐     ┌──────────────┐     ┌────────────────┐
│  Client  │────►│     Tool      │────►│      Rate     │────►│    Context   │────►│     Auth       │
│ Request  │     │    Registry   │     │    Limiter    │     │    Engine    │     │    Layer       │
└──────────┘     └───────────────┘     └────────────────┘     └──────────────┘     └───────┬────────┘
                                                                                                │
      ┌───────────────────────────────────────────────────────────────────────────────────────┘
      │
      ▼
┌──────────────┐     ┌────────────────┐     ┌─────────────┐
│   Google     │────►│   Response     │────►│    Client   │
│     APIs     │     │    Builder     │     │   Response  │
└──────────────┘     └────────────────┘     └─────────────┘

Circuit Breaker State Machine

                            ┌───────────────────┐
                            │   🔴 CLOSED       │
                            │    (Normal Ops)   │
                            └─────────┬─────────┘
                                      │
                     failures > threshold
                                      │
                                      ▼
                            ┌───────────────────┐
                            │   🟠 OPEN STATE   │
                            │ (Rejecting Reqs)  │
                            └─────────┬─────────┘
                                      │
                           timer expires
                                      │
                                      ▼
                            ┌───────────────────┐
                            │  🟡 HALF-OPEN     │
                            │   (Test Mode)     │
                            └─────────┬─────────┘
                                      │
           ┌──────────────────────────┼──────────────────────────┐
           │                          │                          │
      success ✓                   success ✓                failure ✗
           │                          │                          │
           ▼                          ▼                          ▼
    ┌─────────────┐           ┌─────────────┐           ┌─────────────┐
    │   CLOSED    │           │   CLOSED    │           │    OPEN     │
    │   ✅        │           │   ✅        │           │     🔴      │
    └─────────────┘           └─────────────┘           └─────────────┘

🚀 Quick Start

Prerequisites

Node.js npm Google Cloud

Installation

# Clone the repository
git clone https://github.com/devfinprojects/GAS-MCPSERVER.git
cd GAS-MCPSERVER

# Install dependencies
npm install

# Build the project
npm run build

Environment Setup

# Copy example environment file
cp env.example .env

# Edit configuration
#nano .env  # Linux/Mac
#notepad .env  # Windows

🔧 Configuration

Configure your MCP server

VariableDescriptionDefaultRequired
GOOGLE_CREDENTIALS_PATHPath to OAuth JSON./credentials.json✅ Yes
PORTHTTP server port3000❌ No
LOG_LEVELLogging verbosityinfo❌ No
RATE_LIMIT_REQUESTS_PER_MINUTERate limit per minute60❌ No
CONTEXT_MAX_TOKENSMax context tokens100000❌ No
ENABLE_SELF_HEALINGEnable circuit breakertrue❌ No
ENABLE_METRICSEnable Prometheus metricsfalse❌ No
ENABLE_TRACINGEnable distributed tracingfalse❌ No
ENABLE_AUDIT_LOGGINGEnable audit logstrue❌ No
CIRCUIT_BREAKER_THRESHOLDFailure threshold5❌ No
CIRCUIT_BREAKER_TIMEOUTReset timeout (ms)30000❌ No

🛠️ Tools Reference

100+ MCP tools across 5 categories

╔══════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║                                    100+ MCP TOOLS BREAKDOWN                                             ║
╠══════════════════════════════════════════════════════════════════════════════════════════════════════════╣
║                                                                                                          ║
║   ┌──────────────┐  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐             ║
║   │      🤖      │  │      ⚡      │  │      📊     │  │      🧠     │  │      📝      │             ║
║   │      AI      │  │  AUTOMATION  │  │ DATA ENGR   │  │   CONTEXT   │  │ CODE QUALITY │             ║
║   │    TOOLS     │  │    TOOLS     │  │    TOOLS    │  │    TOOLS    │  │    TOOLS     │             ║
║   │              │  │              │  │             │  │             │  │              │             ║
║   │ • Analysis   │  │ • Jobs       │  │ • ETL       │  │ • Datasets  │  │ • Analysis   │             ║
║   │ • Anomaly    │  │ • Workflows  │  │ • Import    │  │ • Query     │  │ • Review     │             ║
║   │ • Patterns   │  │ • Webhooks   │  │ • Export    │  │ • Control   │  │ • Doc Gen    │             ║
║   │ • Transform  │  │ • Triggers   │  │ • Mapping   │  │             │  │ • Test Gen   │             ║
║   │ • NLQ       │  │ • Notifs     │  │ • Pipeline  │  │             │  │ • Types      │             ║
║   │ • Recommen-  │  │ • Scheduled  │  │ • Validation│  │             │  │              │             ║
║   │   dations   │  │              │  │             │  │             │  │              │             ║
║   │              │  │              │  │             │  │             │  │              │             ║
║   │    35+       │  │     25+      │  │     25+     │  │     15+     │  │     25+      │             ║
║   └──────────────┘  └──────────────┘  └──────────────┘  └──────────────┘  └──────────────┘             ║
║                                                                                                          ║
╚══════════════════════════════════════════════════════════════════════════════════════════════════════════╝

🤖 AI Analysis Tools (35+ tools)

Powerful AI-driven analysis capabilities

Tool CategoryToolsDescription
📈 Analysis8 toolsData analysis, column analysis, summaries
🔍 Anomaly Detection4 toolsOutlier detection, unusual values
🔁 Pattern Recognition5 toolsPatterns, sequences, cycles, distributions
🔮 Recommendations4 toolsImprovements, chart suggestions
🧹 Transformation5 toolsData cleaning, reshaping, aggregation
💬 Natural Language5 toolsNL to spreadsheet, formula generation
📋 View AI Tool Reference

Analysis Tools

Tool NameParametersReturn TypeExample
analyze_sheet_dataspreadsheetId, range{ analysis }{ "name": "analyze_sheet_data", "args": { "spreadsheetId": "abc" } }
analyze_columnspreadsheetId, range, column{ stats }{ "name": "analyze_column", "args": { "spreadsheetId": "abc", "column": "A" } }
get_data_summaryspreadsheetId{ summary }{ "name": "get_data_summary", "args": { "spreadsheetId": "abc" } }

Anomaly Detection

Tool NameParametersReturn TypeExample
detect_outliersspreadsheetId, range, method{ outliers }{ "name": "detect_outliers", "args": { "spreadsheetId": "abc" } }
analyze_anomaliesspreadsheetId, timeRange{ anomalies }{ "name": "analyze_anomalies", "args": { "spreadsheetId": "abc" } }
find_unusual_valuesspreadsheetId, column{ values }{ "name": "find_unusual_values", "args": { "spreadsheetId": "abc" } }

Pattern Recognition

Tool NameParametersReturn TypeExample
detect_patternsspreadsheetId, range{ patterns }{ "name": "detect_patterns", "args": { "spreadsheetId": "abc" } }
find_sequencesspreadsheetId, column{ sequences }{ "name": "find_sequences", "args": { "spreadsheetId": "abc" } }
detect_cyclesspreadsheetId, range{ cycles }{ "name": "detect_cycles", "args": { "spreadsheetId": "abc" } }

Transformation

Tool NameParametersReturn TypeExample
clean_sheet_dataspreadsheetId, rules{ cleaned }{ "name": "clean_sheet_data", "args": { "spreadsheetId": "abc" } }
transform_dataspreadsheetId, transforms{ result }{ "name": "transform_data", "args": { "spreadsheetId": "abc" } }
reshape_dataspreadsheetId, pivotConfig{ reshaped }{ "name": "reshape_data", "args": { "spreadsheetId": "abc" } }

Natural Language Query

Tool NameParametersReturn TypeExample
nl_to_spreadsheet_actionquery, spreadsheetId{ action }{ "name": "nl_to_spreadsheet_action", "args": { "query": "add column" } }
generate_formuladescription, context{ formula }{ "name": "generate_formula", "args": { "description": "sum of column" } }
query_data_nlquery, spreadsheetId{ results }{ "name": "query_data_nl", "args": { "query": "sales > 1000" } }

⚡ Automation Tools (25+ tools)

Workflow automation and scheduling

Tool CategoryToolsDescription
📅 Job Scheduler8 toolsCreate, manage, trigger scheduled jobs
🔀 Workflows7 toolsMulti-step automation workflows
🪝 Webhooks9 toolsEvent-driven triggers
Triggers6 toolsSpreadsheet trigger management
🔔 Notifications12 toolsAlerts and notifications
📋 View Automation Tool Reference

Job Scheduler

Tool NameParametersReturn Type
create_scheduled_jobname, schedule, action{ jobId }
list_scheduled_jobsfilters{ jobs }
get_scheduled_jobjobId{ job }
update_scheduled_jobjobId, updates{ updated }
delete_scheduled_jobjobId{ deleted }
trigger_job_nowjobId{ triggered }
pause_scheduled_jobjobId{ paused }
resume_scheduled_jobjobId{ resumed }

Workflows

Tool NameParametersReturn Type
create_workflowname, steps{ workflowId }
list_workflowsfilters{ workflows }
get_workflowworkflowId{ workflow }
run_workflowworkflowId, inputs{ result }
stop_workflowworkflowId{ stopped }
validate_workflowworkflow{ valid }

Webhooks

Tool NameParametersReturn Type
register_webhookurl, events, secret{ webhookId }
list_webhooksfilters{ webhooks }
delete_webhookwebhookId{ deleted }
test_webhookwebhookId{ result }
enable_webhookwebhookId{ enabled }
disable_webhookwebhookId{ disabled }

📊 Data Engineering Tools (25+ tools)

ETL pipelines and data operations

Tool CategoryToolsDescription
🔄 ETL5 toolsExtract, transform, load pipelines
📥 Import/Export6 toolsCSV, JSON, batch operations
🗺️ Mapping5 toolsSchema detection and mapping
📦 Pipeline5 toolsData pipeline management
Validation5 toolsData quality and schema validation
📋 View Data Engineering Tool Reference

ETL Tools

Tool NameParametersReturn Type
extract_spreadsheet_dataspreadsheetId, range, options{ data }
transform_data_batchdata, transforms{ transformed }
load_to_spreadsheetspreadsheetId, data, options{ loaded }
run_etl_pipelineconfig{ result }

Import/Export

Tool NameParametersReturn Type
import_csvurl, spreadsheetId, options{ imported }
export_csvspreadsheetId, range, options{ url }
import_jsondata, spreadsheetId{ imported }
export_jsonspreadsheetId, range{ data }
convert_formatsource, targetFormat{ converted }
batch_exportspreadsheetIds, format{ results }

Pipeline

Tool NameParametersReturn Type
create_pipelineconfig{ pipelineId }
run_pipelinepipelineId, inputs{ result }
get_pipeline_statuspipelineId{ status }
list_pipelinesfilters{ pipelines }
delete_pipelinepipelineId{ deleted }

🧠 Context Tools (15+ tools)

LLM context optimization and management

Tool CategoryToolsDescription
💾 Dataset5 toolsStore, query, manage datasets
🔍 Query4 toolsSearch and retrieve context
🎛️ Control6 toolsContext mode and optimization
📋 View Context Tool Reference

Dataset Tools

Tool NameParametersReturn Type
store_datasetname, data, schema{ datasetId }
query_datasetdatasetId, filters{ rows }
list_datasetsfilters{ datasets }
delete_datasetdatasetId{ deleted }
update_datasetdatasetId, data{ updated }

Query Tools

Tool NameParametersReturn Type
semantic_searchquery, datasetId{ results }
get_dataset_statsdatasetId{ stats }
get_token_usagesessionId{ usage }
dataset_existsdatasetId{ exists }

Context Control

Tool NameParametersReturn Type
estimate_context_costspreadsheetId, range{ tokens, cost }
set_context_modemode{ mode }
get_context_config{ config }
reset_session_tokenssessionId{ reset }
process_through_contextdata, options{ processed }

📝 Code Quality Tools (25+ tools)

Apps Script code analysis and improvement

Tool CategoryToolsDescription
📊 Analysis5 toolsCode quality and complexity
👀 Review3 toolsAutomated code reviews
📚 Documentation4 toolsJSDoc generation
🧪 Test Generation3 toolsUnit test creation
Type Checking3 toolsType validation
📋 View Code Quality Tool Reference

Analysis Tools

Tool NameParametersReturn Type
analyze_code_qualitycode, includeComplexity{ metrics }
analyze_complexitycode{ complexity }
analyze_dependenciescode{ deps }

Code Review

Tool NameParametersReturn Type
perform_code_reviewcode{ issues }
check_best_practicescode{ violations }
suggest_improvementscode{ suggestions }

Documentation

Tool NameParametersReturn Type
generate_jsdoccode{ docs }
generate_readmeproject{ readme }
update_commentscode{ updated }

Test Generation

Tool NameParametersReturn Type
generate_unit_testscode, framework{ tests }
generate_integration_testscode{ tests }
generate_mockscode{ mocks }

🔐 Security

Enterprise-grade security features

┌─────────────────────────────────────────────────────────────────────────────────────┐
│                              🔐 SECURITY ARCHITECTURE                                │
├─────────────────────────────────────────────────────────────────────────────────────┤
│                                                                                     │
│   ┌─────────────┐     ┌─────────────┐     ┌─────────────┐     ┌─────────────┐     │
│   │   🔒 OAuth2 │────►│   🛡️ RBAC   │────►│  🔏 AES-256 │────►│   📋 Audit  │     │
│   │  + Token    │     │  + Roles    │     │  Encryption │     │   Logging   │     │
│   │   Refresh   │     │  + Perms    │     │  + at Rest   │     │   + SOC2    │     │
│   └─────────────┘     └─────────────┘     └─────────────┘     └─────────────┘     │
│                                                                                     │
└─────────────────────────────────────────────────────────────────────────────────────┘
  • ✅ OAuth2 with automatic token refresh
  • ✅ Role-Based Access Control (RBAC)
  • ✅ AES-256 encryption at rest
  • ✅ Comprehensive audit logging
  • ✅ SOC2 and GDPR ready
  • ✅ Threat detection and prevention

📈 Observability

Complete visibility into your system

┌─────────────────────────────────────────────────────────────────────────────────────┐
│                           📈 OBSERVABILITY DASHBOARD                               │
├─────────────────────────────────────────────────────────────────────────────────────┤
│                                                                                     │
│   ┌────────────────┐  ┌────────────────┐  ┌────────────────┐  ┌────────────────┐│
│   │     📊        │  │      ❤️        │  │      🔍       │  │      🔔       ││
│   │   METRICS     │  │    HEALTH      │  │   TRACING     │  │   ALERTING    ││
│   │                │  │                │  │                │  │                ││
│   │ Prometheus    │  │  Liveness     │  │  Distributed  │  │  Rule-based   ││
│   │  Compatible   │  │  + Readiness  │  │    Spans      │  │  Notifications││
│   │                │  │                │  │                │  │                ││
│   │ • Request     │  │  • /health    │  │ • Jaeger      │  │ • Email       ││
│   │   Rate        │  │  • /ready      │  │   Compatible  │  │ • Slack       ││
│   │ • Latency     │  │  • Custom      │  │ • Custom      │  │ • Webhook     ││
│   │ • Errors      │  │    Checks      │  │   Tags        │  │ • PagerDuty   ││
│   └────────────────┘  └────────────────┘  └────────────────┘  └────────────────┘│
│                                                                                     │
│   ┌─────────────────────────────────────────────────────────────────────────────────┐│
│   │                              📜 AUDIT LOGGING                                  ││
│   │                                                                                 ││
│   │  • Every API call logged    • User/agent tracking    • Immutable records    ││
│   │  • Queryable logs           • Export to SIEM          • Retention policies    ││
│   └─────────────────────────────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────────────────────────────┘

💚 Self-Healing

Automatic error recovery for 99.9% uptime

┌─────────────────────────────────────────────────────────────────────────────────────┐
│                          💚 SELF-HEALING MECHANISMS                                 │
├─────────────────────────────────────────────────────────────────────────────────────┤
│                                                                                     │
│   ┌────────────────┐  ┌────────────────┐  ┌────────────────┐                      │
│   │  🔄 CIRCUIT    │  │  🔁 AUTO       │  │  🩺 HEALTH    │                      │
│   │   BREAKER     │  │    RETRY       │  │   MONITOR     │                      │
│   │                │  │                │  │                │                      │
│   │  • Open       │  │  • Exponential │  │  • Periodic   │                      │
│   │  • Half-Open │  │    Backoff     │  │    Checks     │                      │
│   │  • Closed    │  │  • Max Attempts│  │  • Recovery   │                      │
│   │                │  │  • Jitter     │  │    Actions    │                      │
│   └────────────────┘  └────────────────┘  └────────────────┘                      │
│                                                                                     │
│   ═══════════════════════════════════════════════════════════════════════════════   │
│                                                                                     │
│   Configuration:                                                                     │
│   ┌─────────────────────────────────────────────────────────────────────────────┐   │
│   │  circuitBreaker: { failureThreshold: 5, resetTimeoutMs: 30000 }           │   │
│   │  maxRetries: 3, backoffMultiplier: 2, maxBackoffMs: 30000                  │   │
│   │  healthCheckInterval: 10000, recoveryThreshold: 3                          │   │
│   └─────────────────────────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────────────────────────┘

📦 Examples

▶ Basic Usage: Create and Manage Spreadsheets
import { createClient } from '@modelcontextprotocol/sdk';

const client = await createClient({
  serverUrl: 'http://localhost:3000',
  auth: { token: process.env.MCP_TOKEN }
});

// Create a new spreadsheet
const spreadsheet = await client.tools.create_spreadsheet({
  title: 'Sales Dashboard 2024',
  sheets: [
    { title: 'Q1 Data', rowCount: 1000, columnCount: 26 },
    { title: 'Q2 Data', rowCount: 1000, columnCount: 26 },
    { title: 'Summary', rowCount: 100, columnCount: 10 }
  ]
});

console.log(`Created: ${spreadsheet.spreadsheetId}`);

// Add data to the spreadsheet
await client.tools.update_values({
  spreadsheetId: spreadsheet.spreadsheetId,
  range: 'Q1 Data!A1',
  values: [
    ['Product', 'Revenue', 'Quantity'],
    ['Widget A', 15000, 150],
    ['Widget B', 23000, 230],
    ['Widget C', 18000, 180]
  ]
});
▶ Advanced: AI-Powered Data Analysis
// Analyze spreadsheet data with AI
const analysis = await client.tools.analyze_sheet_data({
  spreadsheetId: 'abc123',
  range: 'Sales!A1:Z1000',
  includeCharts: true,
  generateInsights: true
});

console.log('Analysis Results:');
console.log(`- Total Rows: ${analysis.summary.rowCount}`);
console.log(`- Columns: ${analysis.summary.columns.join(', ')}`);
console.log(`- Insights: ${analysis.insights.length}`);

// Detect anomalies in the data
const anomalies = await client.tools.detect_outliers({
  spreadsheetId: 'abc123',
  range: 'Sales!B1:B1000',
  method: 'iqr',
  threshold: 1.5
});

console.log(`Found ${anomalies.outliers.length} outliers`);
▶ Automation: Create ETL Pipeline
// Create and run an ETL pipeline
const pipeline = await client.tools.create_pipeline({
  name: 'Daily Sales ETL',
  schedule: '0 2 * * *',  // 2 AM daily
  steps: [
    {
      id: 'extract',
      type: 'extract',
      source: {
        type: 'spreadsheet',
        spreadsheetId: 'source-id',
        range: 'Raw Data!A1:Z'
      }
    },
    {
      id: 'transform',
      type: 'transform',
      operations: [
        { type: 'filter', condition: { column: 'status', equals: 'active' } },
        { type: 'map', mappings: { old_col: 'new_col' } },
        { type: 'aggregate', groupBy: 'region', operations: ['sum', 'avg', 'count'] }
      ]
    },
    {
      id: 'load',
      type: 'load',
      destination: {
        type: 'spreadsheet',
        spreadsheetId: 'dest-id',
        sheet: 'Processed'
      }
    }
  ]
});

// Run the pipeline
const result = await client.tools.run_pipeline({
  pipelineId: pipeline.pipelineId,
  inputs: {}
});

console.log(`Processed ${result.rowsProcessed} rows in ${result.duration}ms`);

🤝 Contribution

We welcome contributions!

# 1. Fork the repository
# 2. Clone your fork
git clone https://github.com/YOUR_USERNAME/GAS-MCPSERVER.git

# 3. Create a feature branch
git checkout -b feature/amazing-feature

# 4. Install dependencies
npm install

# 5. Make your changes
# 6. Run tests
npm test

# 7. Build the project
npm run build

# 8. Commit and push
git commit -m 'Add amazing feature'
git push origin feature/amazing-feature

# 9. Open a Pull Request

Development Scripts

ScriptDescription
npm run buildCompile TypeScript
npm run startStart production server
npm run devStart development server
npm testRun tests
npm run test:watchRun tests in watch mode

📄 License

License

MIT License - See LICENSE file for details


Made with ❤️ by the MCP Server Team

Stars Forks Issues


📄 Last updated: March 2026 | Version 3.0.0 | API Documentation | GitHub

Reviews

No reviews yet

Sign in to write a review