home / mcp / google sheets mcp server
Provides real-time read/write access to Google Sheets for Claude via an MCP server with stdio transport.
Configuration
View docs{
"mcpServers": {
"dmegabyte-google-sheets-mcp": {
"command": "node",
"args": [
"D:/google-sheets-mcp/index.js"
],
"env": {
"GOOGLE_CREDENTIALS_PATH": "D:/google-sheets-mcp/credentials.json"
}
}
}
}This MCP server lets Claude read from and write to your Google Sheets directly, enabling real-time data access and automated updates without manual exports.
Set up Claude to connect to your Google Sheets MCP server and start issuing data actions. You register the local stdio server, then tell Claude what sheets and ranges to read or write. Use natural language prompts to perform reads, writes, appends, metadata lookups, and range clears. The supported tools include read_sheet, write_sheet, append_sheet, get_metadata, and clear_sheet, which map to data operations on your sheets.
Typical workflows you can perform after setup include reading a range like A1:D10 from a specific sheet, writing data to a target range, appending rows to the bottom of a sheet, retrieving the list of sheets, and clearing a chosen range. You can combine these actions to automate data pipelines, validations, or logging directly from Claude into Google Sheets.
# Prerequisites
- Node.js installed (check with `node --version`)
- npm installed (check with `npm --version`)
# 1) Prepare Google Cloud access
# - Create a project in Google Cloud Console
# - Enable Google Sheets API
# - Create a Service Account
# - Download the JSON key and rename it to credentials.json
# - Place credentials.json in your project folder
# - Grant the service account access to your sheets
# 2) Register the MCP server with Claude Code
cd D:\google-sheets-mcp
claude mcp add --transport stdio google-sheets-mcp --env GOOGLE_CREDENTIALS_PATH="D:/google-sheets-mcp/credentials.json" -- node "D:/google-sheets-mcp/index.js"
````codeEnvironment variables used by the server are surfaced during registration. The Google credentials path must point to the credentials.json file you downloaded from Google Cloud. The service account must have access to the target Google Sheets.
If the credentials file is not found, ensure credentials.json exists at the path you provided and that GOOGLE_CREDENTIALS_PATH is correct. If you encounter permission errors, verify that the service account has access to the target sheets and that you are not using your personal account for API calls. If the server fails to start, ensure dependencies are installed with npm install and that Node.js is properly installed.
Read data from a sheet named "Results" range A1:C20 in the table you connected, e.g., 1A2B3C4D5E.
Write a set of values to the sheet named "Logs" at range A1, with data like [["Date","Result"],["2025-01-15","Success"]].
Append a new row to the bottom of the sheet, such as adding a timestamp and status to the end of the Logs sheet.
Key runtime file: index.js. Credentials must be placed at credentials.json in your project folder. The setup guide and example commands assume a Windows-style path setup as shown in the registration command.
Read data from a specified sheet range, returning the values in the requested area.
Write the provided data to a specified sheet range, replacing existing values in the target cells.
Append a new row to the end of a sheet, extending the dataset with the given values.
Fetch information about the sheets contained in the target Google Sheets file, such as sheet names.
Clear data within a specified range on a sheet.