kazz187_mcp_google_spreadsheet

kazz187_mcp_google_spreadsheet

by kazz187
An MCP server enabling AI assistants to interact with Google Spreadsheet and Google Drive for file and data management.

Google Spreadsheet Integration for MCP

Overview

The Google Spreadsheet Integration for MCP is a tool that enables AI assistants to interact with Google Spreadsheets and Google Drive. Built as an MCP (Model Context Protocol) server, this tool provides a seamless way to manage and manipulate spreadsheet data programmatically.

Features

Google Drive Operations

  • list_files: Retrieve a list of files from Google Drive.
  • copy_file: Copy a file within Google Drive.
  • rename_file: Rename a file in Google Drive.

Google Spreadsheet Operations

  • list_sheets: Get a list of sheets within a spreadsheet.
  • copy_sheet: Copy a sheet within a spreadsheet.
  • rename_sheet: Rename a sheet within a spreadsheet.
  • get_sheet_data: Fetch data from a specific sheet.
  • add_rows: Add rows to a sheet.
  • add_columns: Add columns to a sheet.
  • update_cells: Update cells within a specified range.
  • batch_update_cells: Update multiple cell ranges in bulk.

Prerequisites

  • Go 1.24 or higher.
  • A Google Cloud Platform project with the following APIs enabled:
  • Google Drive API
  • Google Sheets API

Installation

go install github.com/kazz187/mcp-google-spreadsheet@latest

This will install the mcp-google-spreadsheet binary in the $GOPATH/bin directory.

Configuration

Set the following environment variables:

  • MCPGS_CLIENT_SECRET_PATH: Path to the Google API client secret file.
  • MCPGS_TOKEN_PATH: Path to the Google API token file (will be created if it doesn’t exist).
  • MCPGS_FOLDER_ID: Google Drive folder ID for the target directory.

Google API Setup

  1. Access the Google Cloud Console.
  2. Create a project.
  3. Enable the Google Drive API and Google Sheets API.
  4. Create OAuth credentials (Client ID).
  5. Download the client secret file.

Usage

Starting the Server

export MCPGS_CLIENT_SECRET_PATH=/path/to/client_secret.json
export MCPGS_TOKEN_PATH=/path/to/token.json
export MCPGS_FOLDER_ID=your_folder_id
mcp-google-spreadsheet

Ensure $GOPATH/bin is in your PATH if installed via go install.

MCP Configuration

To use with AI assistants like Claude or ChatGPT, add the following to your MCP configuration file:

{
  "mcpServers": {
    "mcp_google_spreadsheet": {
      "command": "mcp-google-spreadsheet",
      "args": [],
      "env": {
        "MCPGS_CLIENT_SECRET_PATH": "/path/to/client_secret.json",
        "MCPGS_TOKEN_PATH": "/path/to/token.json",
        "MCPGS_FOLDER_ID": "your_folder_id"
      }
    }
  }
}

Security

  • Access is restricted to files within the specified folder ID.
  • Directory traversal attacks (e.g., ../) are prevented.
  • Files specified by users are validated to ensure they exist within the target folder.

License

This project is licensed under the MIT License.

Features & Capabilities

Categories
mcp_server model_context_protocol go google_spreadsheet google_drive api_integration ai_assistant

Implementation Details

Stats

0 Views
2 GitHub Stars

Repository Info

kazz187 Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300