Skip to main content
Glama

Google Sheets MCP Server

by ainetwork-ai

Google Sheets MCP Server

A Model Context Protocol (MCP) server that provides seamless integration with Google Sheets, enabling AI agents to read, search, and intelligently modify spreadsheet data.

Features

  • πŸ“Š Read spreadsheet data by file, sheet, or specific range

  • ✏️ Smart cell updates with partial text replacement

  • πŸ” Search and filter capabilities across sheets

  • πŸ“ Preserve formatting and formulas during updates

  • πŸ” Secure OAuth 2.0 authentication

  • ⚑ Batch operations for efficient bulk updates

  • πŸ›‘οΈ Type-safe with full TypeScript support

Quick Start

Prerequisites

  • Node.js 18+

  • Google Cloud Project with Sheets API enabled

  • OAuth 2.0 credentials from Google Cloud Console

Installation

npm install

Configuration

  1. Enable Google Sheets API

    • Go to Google Cloud Console

    • Create a new project or select existing one

    • Enable "Google Sheets API" and "Google Drive API"

    • Create OAuth 2.0 credentials (Desktop app)

  2. Set up environment variables

Create a .env file:

# Google OAuth μ„€μ • GOOGLE_CLIENT_ID=your_client_id GOOGLE_CLIENT_SECRET=your_client_secret GOOGLE_REDIRECT_URI=http://localhost:3000/oauth/callback # μ„œλΉ„μŠ€ 계정 μ„€μ • (선택사항) GOOGLE_SERVICE_ACCOUNT_KEY_PATH=./path/to/service-account-key.json # MCP μ„œλ²„ μ„€μ • MCP_SERVER_PORT=3000 MCP_SERVER_HOST=localhost
  1. Start the MCP server

# Development npm run dev # Production npm run build npm start
  1. Install the MCP server

# add this to mcp.json etc. "google-sheets-mcp-server": { "command": "node", "args": ["YOUR_PATH/google-sheets-mcp/dist/index.js"], "env": { "GOOGLE_CLIENT_ID":"YOUR_CLIENT_ID", "GOOGLE_CLIENT_SECRET":"YOUR_CLIENT_SECRET", "GOOGLE_REDIRECT_URI":"http://localhost:3000/oauth/callback", "MCP_SERVER_PORT":"3000", "MCP_SERVER_HOST":"localhost", "NODE_ENV":"development", "LOG_LEVEL":"info" } }

Development

# Install dependencies npm install # Run in development mode npm run dev # Build for production npm run build # Run tests npm test # Lint code npm run lint # Format code npm run format

Available Tools

Read Tools

  • sheets_list_files - List accessible spreadsheets

  • sheets_list_sheets - List sheets in a spreadsheet

  • sheets_read_data - Read all data from a sheet

  • sheets_read_range - Read data from a specific range

  • sheets_search - Search for text in cells

Update Tools

  • sheets_update_cell - Update a single cell

  • sheets_update_range - Update multiple cells

  • sheets_smart_replace - Smart text replacement

  • sheets_append_rows - Add new rows

Management Tools

  • sheets_create_sheet - Create a new sheet

  • sheets_delete_sheet - Delete a sheet

  • sheets_rename_sheet - Rename a sheet

Documentation

Features

  • βœ… OAuth 2.0 Authentication - Secure Google account integration

  • βœ… Service Account Support - For automated workflows

  • βœ… Smart Text Replacement - Partial text updates with context preservation

  • βœ… Batch Operations - Efficient bulk updates

  • βœ… Error Handling - Comprehensive error management with retry logic

  • βœ… Rate Limiting - Built-in API quota management

  • βœ… Type Safety - Full TypeScript support

  • βœ… Comprehensive Testing - Unit and integration tests

Performance

  • Read operations: < 2 seconds for sheets up to 10,000 cells

  • Write operations: < 5 seconds for batches up to 1,000 cells

  • Smart replace: < 3 seconds for sheets up to 5,000 cells

  • Rate limiting: 60 requests per minute by default

Security

  • OAuth tokens stored securely using system keychain

  • All API communications use HTTPS

  • No sensitive data logged

  • Read-only mode available for sensitive spreadsheets

  • Input validation and sanitization

License

MIT

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Enables AI agents to seamlessly interact with Google Sheets through secure OAuth 2.0 authentication. Supports reading, searching, updating spreadsheet data, and managing sheets with smart text replacement and batch operations.

  1. Features
    1. Quick Start
      1. Prerequisites
      2. Installation
      3. Configuration
    2. Development
      1. Available Tools
        1. Read Tools
        2. Update Tools
        3. Management Tools
      2. Documentation
        1. Features
          1. Performance
            1. Security
              1. License

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/ainetwork-ai/google-sheet-mcp'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server