Sponsored by Deepsite.site

Google Sheets MCP Server

Created By
Meerkats-Ai9 months ago
google-sheet-mcp-server
Content

Google Sheets MCP Server

A powerful Model Context Protocol (MCP) server implementation for seamless Google Sheets API integration, enabling AI assistants to create, read, update, and manage Google Sheets.

Features

  • Create, read, update, and delete Google Sheets
  • Manage sheet data with cell-level operations
  • Format cells and ranges
  • Share spreadsheets with other users
  • Search for spreadsheets
  • Comprehensive authentication options

Authentication Options

This MCP server supports multiple authentication methods:

  1. Service Account Authentication (recommended for production)

    • Provide a path to a service account key file
    • Or provide the service account JSON content directly
  2. API Key Authentication (simpler for development)

    • Provide a Google API key
  3. OAuth2 Authentication (for user-specific operations)

    • Provide OAuth client ID, client secret, and refresh token

Setup

Prerequisites

  • Node.js (v16 or higher)
  • A Google Cloud Project with the Google Sheets API enabled
  • Authentication credentials (see below)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/google-sheets-mcp-server.git
    cd google-sheets-mcp-server
    
  2. Install dependencies:

    npm install
    
  3. Set up authentication:

    • Create a .env file based on the .env.example template
    • Add your Google Cloud credentials
  4. Build the project:

    npm run build
    
  5. Start the server:

    npm start
    

OAuth Setup

For operations that require user consent (like creating/editing spreadsheets), you'll need OAuth credentials:

  1. Create OAuth credentials in the Google Cloud Console
  2. Update the CLIENT_ID and CLIENT_SECRET in src/get-refresh-token.js
  3. Install required dependencies:
    npm install open server-destroy
    
  4. Run the script to get a refresh token:
    node src/get-refresh-token.js
    
  5. Follow the browser prompts to authorize the application
  6. Copy the refresh token to your .env file

Available Tools

The server provides the following tools:

  • google_sheets_create: Create a new Google Sheet
  • google_sheets_get: Get a Google Sheet by ID
  • google_sheets_update_values: Update values in a Google Sheet
  • google_sheets_append_values: Append values to a Google Sheet
  • google_sheets_get_values: Get values from a Google Sheet
  • google_sheets_clear_values: Clear values from a Google Sheet
  • google_sheets_add_sheet: Add a new sheet to an existing spreadsheet
  • google_sheets_delete_sheet: Delete a sheet from a spreadsheet
  • google_sheets_list: List Google Sheets accessible to the authenticated user
  • google_sheets_delete: Delete a Google Sheet
  • google_sheets_share: Share a Google Sheet with specific users
  • google_sheets_search: Search for Google Sheets by title
  • google_sheets_format_cells: Format cells in a Google Sheet
  • google_sheets_verify_connection: Verify connection with Google Sheets API

Example Usage

Here's an example of how to use this MCP server with Claude:

You can now use Google Sheets! Try these commands:

1. Create a new spreadsheet:
   "Create a new Google Sheet titled 'Monthly Budget'"

2. Add data to the spreadsheet:
   "Add expense categories and amounts to my Monthly Budget spreadsheet"

3. Format the spreadsheet:
   "Format the header row to be bold and centered"

4. Share the spreadsheet:
   "Share my Monthly Budget spreadsheet with john@example.com"

License

MIT

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Amap Maps高德地图官方 MCP Server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
WindsurfThe new purpose-built IDE to harness magic
Playwright McpPlaywright MCP server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Serper MCP ServerA Serper MCP Server
ChatWiseThe second fastest AI chatbot™
CursorThe AI Code Editor
DeepChatYour AI Partner on Desktop
Tavily Mcp
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。