home / mcp / google sheets & forms mcp server
Provides tools to manage Google Sheets and Forms via MCP, including listing, reading, writing, creating, and analyzing sheet data.
Configuration
View docs{
"mcpServers": {
"hellotinah-mcp": {
"command": "python",
"args": [
"/FULL/PATH/TO/gsheets-mcp-server/gsheets_server.py"
],
"env": {
"GOOGLE_CREDENTIALS_PATH": "/FULL/PATH/TO/gsheets-mcp-server/credentials.json"
}
}
}
}You can run a lightweight MCP server that exposes tools to interact with Google Sheets and Google Forms. It lets you list spreadsheets, read and write sheet data, create sheets and forms, and access sheet data as a resource, all through a simple MCP interface you can call from your client.
Use an MCP client to talk to the Google Sheets & Forms MCP Server. You can invoke tools to list spreadsheets, read specific ranges, write or append data to sheets, and create new spreadsheets or forms. You can also apply prompts to analyze sheet data, generate report templates, or route form data to sheets.
#!/bin/bash
# Prerequisites
- Python 3.8+
- virtualenv (optional but recommended)
# 1. Clone or obtain the server files
# (Navigate to your project directory, for example gsheets-mcp-server)
# 2. Create a virtual environment
cd gsheets-mcp-server
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Prepare Google API credentials
# - Place credentials.json in this directory after enabling APIs
# Google Sheets API, Google Forms API, Google Drive API
# - The server will read GOOGLE_CREDENTIALS_PATH environment variable to locate the file
# 5. Run the server locally (stdio configuration)
python gsheets_server.py
# 6. (Optional) Test with MCP Inspector (from another terminal)
# npx @modelcontextprotocol/inspector http://localhost:PORT/ # if your setup exposes an HTTP endpointThe server runs as a local process. You supply the Python script path to start it, and you provide the path to your Google credentials file via an environment variable named GOOGLE_CREDENTIALS_PATH.
{
"mcpServers": {
"gsheets": {
"command": "python",
"args": ["/FULL/PATH/TO/gsheets-mcp-server/gsheets_server.py"],
"env": {
"GOOGLE_CREDENTIALS_PATH": "/FULL/PATH/TO/gsheets-mcp-server/credentials.json"
}
}
}
}On the first run, the server will open a browser window to perform Google authentication. After you authorize the app, a token.pickle file will be created to store your credentials for future use.
The spreadsheet ID appears in the URL of a Google Sheets document: https://docs.google.com/spreadsheets/d/SPREADSHEET_ID_HERE/edit. Use this ID when referencing a specific sheet in commands.
Authentication issues require removing any stored credentials and retrying. If you see permission errors, verify that the Google APIs are enabled in your Google Cloud project. If a module is missing, ensure your virtual environment is activated and dependencies are installed.
List all Google Spreadsheets accessible by the credentials.
Read data from a specified Google Sheet and range.
Write data to a Google Sheet at a given range.
Append data to an existing Google Sheet.
Create a new Google Spreadsheet.
Create a new Google Form.
Analyze data from a sheet using a provided template.
Generate a template spreadsheet for reports.
Template workflow to route form submissions into a sheet.