
GoogleSheet MCP
@Aryan1718
This MCP server provides tools to interact with Google Sheets, allowing you to read, write, and update data in your spreadsheets.
Overview
What is GoogleSheet MCP?
GoogleSheet MCP is a Model Context Protocol server that provides tools to read, write, and update data in Google Sheets. It is designed for developers who want to integrate spreadsheet data into AI-assisted workflows using a service account.
How to use GoogleSheet MCP?
Install required Python packages, set up Google Cloud Platform credentials, enable the Google Sheets API, create a service account, and share your sheet with the service account email. Configure a .env file with your API key, then run mcp install main.py to start the server.
Key features of GoogleSheet MCP
- List all spreadsheets shared with the service account
- Get detailed information about a specific spreadsheet
- Retrieve content from a specific sheet
- Generate realistic test data based on sheet attributes
- Add pre-formatted data (list or CSV formats) to a sheet
- Update existing records by matching ID or name
Use cases of GoogleSheet MCP
- Automate reading and writing spreadsheet data within AI agent workflows
- Populate sheets with generated test data for development or demos
- Update specific records in a spreadsheet by identifier without manual edits
- Build tools that list available sheets and inspect their structure
FAQ from GoogleSheet MCP
What are the prerequisites for using GoogleSheet MCP?
You need Python 3.8 or higher, a Google Cloud Platform account, and a Google Sheet you want to interact with.
How do I authenticate the server?
You must create a service account in Google Cloud Console, download the JSON key as credentials.json, place it in the server directory, and share your Google Sheet with the service account’s email giving it Editor access.
What data formats are accepted when adding data to a sheet?
Data can be provided as a list of lists (e.g., [["value1", "value2"], ["value3", "value4"]]) or as CSV text (e.g., value1,value2\nvalue3,value4).
What should I do if I get authentication errors?
Ensure the service account email is added as an editor to the spreadsheet, verify your credentials.json file is valid, and confirm the Google Sheets API is enabled in your project.
Where do sensitive credentials live and how should they be protected?
Credentials live in the credentials.json file and the API key in the .env file. Both must never be committed to version control, and API keys should be rotated regularly.