Google Sheets
Interact with Google Sheets using a Python-based MCP server and Google Apps Script.
๐ Google Sheets MCP Server
๐ Python-based MCP Server that enables Claude Desktop to interact seamlessly with Google Sheets through Google Apps Script.
๐ฌ Research Project: This is an experimental development project demonstrating Model Context Protocol (MCP) capabilities and secure Google API integration. Developed as a proof of concept to explore new ways of connecting AI with productivity tools.
โจ Features
- ๐ Read Operations: Single cells, ranges, and sheet metadata
- โ๏ธ Write Operations: Update cells and ranges with data
- ๐งน Utility Operations: Clear ranges and test connections
- ๐ Secure: Uses Google Apps Script as secure proxy within your own account
- ๐ Easy Setup: Works with Claude Desktop without complex configurations
๐ Security & Privacy
๐ก๏ธ Multiple Security Layers
-
Google Apps Script (Your Account):
- Runs in YOUR Google infrastructure
- Only YOU have access to your data
- Automatic authentication with your Google session
- No exposed OAuth credentials
-
Model Context Protocol (MCP):
- Open standard protocol by Anthropic
- Secure localhost-only communication
- No data transmitted to third parties
- Full control over exposed tools
-
Local Architecture:
- MCP server runs on YOUR machine
- No data leaves your control
- No external servers involved
๐ฏ Why is it Secure?
YOUR DATA โ Google Sheets (YOUR account) โ Apps Script (YOUR account) โ MCP Server (YOUR machine) โ Claude Desktop (YOUR machine)
Result: Your data NEVER leaves your personal ecosystem.
๐ Quick Start
Prerequisites
- Python 3.8+ installed
- Claude Desktop installed
- Google account with access to Google Sheets and Apps Script
Installation
# 1. Clone this repository
git clone https://github.com/jona-mhw/google-sheets-mcp.git
cd google-sheets-mcp
# 2. Install Python dependencies
cd mcp-server
pip install -r requirements.txt
# 3. Configure environment variables
cp .env.example .env
# Edit .env and add your APPS_SCRIPT_URL
Google Apps Script Setup
Step 1: Create Apps Script Project
- Go to script.google.com
- Click "New project"
- Important: The file name can be anything (
Code.gs,main.gs,sheets.gs, etc.)
Step 2: Copy the Code
- Delete the default code
- Copy ALL content from
apps-script/Code.gs - Paste it into your project
- Save the project (Ctrl+S)
Step 3: Deploy as Web App
- Click "Deploy" > "New deployment"
- Type: Select "Web app"
- Configuration:
- Execute as: "Me" (your account)
- Who has access: "Anyone"
- Click "Deploy"
โ ๏ธ Costs: Google Apps Script is FREE up to 6 hours of execution time per day. For normal spreadsheet usage, this is more than sufficient.
Step 4: Get the URL
- Copy the Web app URL (ends with
/exec) - This is your
APPS_SCRIPT_URL
Claude Desktop Configuration
-
Find your configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
-
Add the MCP configuration:
{
"mcpServers": {
"google-sheets": {
"command": "python",
"args": ["server.py"],
"cwd": "/absolute/path/to/google-sheets-mcp/mcp-server",
"env": {
"APPS_SCRIPT_URL": "https://script.google.com/macros/s/YOUR_SCRIPT_ID/exec",
"DEBUG": "false"
}
}
}
}
โ ๏ธ Important: Replace /absolute/path/to/ with the actual path where you cloned this repository.
Path examples:
- macOS/Linux:
/Users/your-username/google-sheets-mcp/mcp-server - Windows:
C:\\Users\\your-username\\google-sheets-mcp\\mcp-server
- Restart Claude Desktop
๐ ๏ธ Available Tools
| Tool | Description | Example Usage |
|---|---|---|
read_cell | Read a single cell | read_cell("Sheet1", "A1") |
write_cell | Write to a cell | write_cell("Sheet1", "A1", "Hello") |
read_range | Read cell range | read_range("Sheet1", "A1:B5") |
write_range | Write to range | write_range("Sheet1", "A1:B2", data) |
clear_range | Clear cell range | clear_range("Sheet1", "A1:B5") |
list_sheets | List all sheets | list_sheets() |
test_connection | Test setup | test_connection() |
๐๏ธ Architecture
Claude Desktop โ Python MCP Server โ Google Apps Script โ Google Sheets
โ โ
โโโโโโโโโโ JSON Response โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Why this approach?
- ๐ No complex OAuth: Apps Script uses your existing Google session
- ๐ฏ Focused: Designed specifically for Google Sheets operations
- ๐ Scalable: Easy to add new functionality
- ๐ฐ Free: Uses Google's free Apps Script infrastructure
- ๐ก๏ธ Private: Everything stays within your personal account
โ Verification
After setup, ask Claude:
"Test the Google Sheets connection"
Claude should be able to use the test_connection() tool and show you it's connected.
๐ Troubleshooting
Error: "No module named 'fastmcp'"
pip install -r requirements.txt
Error: "APPS_SCRIPT_URL not configured"
- Verify that the
.envfile exists - Verify that the URL is correct
- Ensure the Apps Script is deployed as Web App
Claude doesn't see the MCP
- Verify that the
cwdpath is absolute and correct - Restart Claude Desktop completely
- Check that the JSON configuration is valid
Apps Script permission errors
- Ensure the Apps Script is deployed with "Anyone" permissions
- Verify that the Spreadsheet exists and you have access
๐ค Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Built with FastMCP
- Integrates with Google Apps Script
- Part of the Model Context Protocol ecosystem
Created by: Jona
Purpose: Connect Claude with Google Sheets efficiently and securely
Type: Research & Development Project - MCP Proof of Concept
Server Terkait
MCP Trello
A server for interacting with Trello boards, handling API integration, rate limiting, and type safety.
Desktop Automation
Control your desktop with AI. Automate mouse movements, keyboard inputs, and screen captures.
Jira MCP Server
Integrates with Jira's REST API to manage issues programmatically.
Word MCP Server
Create and edit Microsoft Word (.docx) documents via an API.
Invoice MCP
Create professional PDF invoices using natural language.
Yandex Tracker
Interact with Yandex Tracker APIs for issue management and search.
Cursor Task Manager
An MCP server for task management, time tracking, and workflow automation, integrated with Cursor IDE and a Directus backend.
ProPresenter 7 MCP Server
ProPresenter 7 MCP Server
Humanizer PRO
Humanizer PRO is an MCP server that transforms AI-generated text into natural, human-sounding content. It provides 4 tools: - humanize_text: Rewrite AI text to bypass detectors like GPTZero, Turnitin, Originality.ai, Copyleaks, and ZeroGPT. Three modes: Stealth (highest bypass rate), Academic (Turnitin-optimized), SEO (marketing content). - scan_ai_detection: Analyze text for AI patterns. Returns AI probability score, human-likeness percentage, and verdict. - check_word_balance: Check remaining word credits and subscription plan details. - get_subscription_plans: Browse plans - Free (500 words), Starter ($9.99/mo, 30K words), Creator ($14.99/mo, 100K words), Pro Annual ($119.88/yr, 100K words/mo). Authentication: OAuth 2.0. Works with ChatGPT, Claude, Cursor, and all MCP-compatible clients.
Google Calendar Integration Project
Manage and interact with Google Calendar events using the Google Calendar API.