- Home
- MCP servers
- Google Sheets & Forms
Google Sheets & Forms
- python
16
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
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.
How to use
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.
How to install
#!/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 endpoint
Configuration and runtime details
The 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"
}
}
}
}
First run and authentication
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.
Getting spreadsheet IDs and usage notes
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.
Troubleshooting
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.
Available tools
list_spreadsheets
List all Google Spreadsheets accessible by the credentials.
read_sheet
Read data from a specified Google Sheet and range.
write_sheet
Write data to a Google Sheet at a given range.
append_sheet
Append data to an existing Google Sheet.
create_spreadsheet
Create a new Google Spreadsheet.
create_form
Create a new Google Form.
analyze_sheet_data
Analyze data from a sheet using a provided template.
create_report_template
Generate a template spreadsheet for reports.
form_to_sheet
Template workflow to route form submissions into a sheet.