Google Sheets MCP Server

Google Sheets MCP Server

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.

Category
Visit Server

README

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
  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",
        "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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured