MCP server for integrating with the Google Sheets API from MCP clients. It can read, write, and manage spreadsheets, including batch updates, formatting, charts, and sheet management operations.
From the registry: MCP server for Google Sheets API — read, write, format, batch operations.
Please install the `mcp-gsheets` MCP server into my current AI client (that's you).
Required prerequisites (do these first if not already done):
- **Install Node.js** — Node.js v20 or higher is required to run the MCP server via npx. (https://nodejs.org/)
- **Install npm** — npm is required because the recommended install path uses npx to run the published package. (https://www.npmjs.com/)
- **Create a Google Cloud project and enable Google Sheets API** — Create or select a Google Cloud project and enable the Google Sheets API in Google Cloud Console. (https://console.cloud.google.com)
- **Create a Google service account and obtain credentials** — Create a service account, generate JSON credentials, and use one supported authentication method: a JSON key file, a full JSON string, or private key + client email. (https://console.cloud.google.com)
- **Share target spreadsheets with the service account** — Grant the service account email access to the Google Sheets documents you want the server to read or modify.
Canonical MCP server config (stdio transport):
- command: `npx`
- args: ["-y","mcp-gsheets@latest"]
- required environment variables:
- `GOOGLE_PROJECT_ID`: Google Cloud project ID. Required for the default file-based authentication method. Optional only when using GOOGLE_SERVICE_ACCOUNT_KEY that already contains project_id, or when using the simplified private-key method. (example: `<your-google-project-id>`)
- `GOOGLE_APPLICATION_CREDENTIALS`: Absolute path to the Google service account JSON key file. This is the recommended default authentication method. (example: `<absolute-path-to-service-account-key.json>`)
- optional environment variables:
- `GOOGLE_SERVICE_ACCOUNT_KEY`: Alternative to GOOGLE_APPLICATION_CREDENTIALS. Full service account JSON provided as a single escaped JSON string. If this JSON includes project_id, GOOGLE_PROJECT_ID may be omitted. (example: `<your-single-line-escaped-service-account-json>`)
- `GOOGLE_PRIVATE_KEY`: Alternative simplified authentication method. Private key from the service account JSON, with newlines escaped as \n and including BEGIN/END PRIVATE KEY markers. (example: `<your-private-key-with-escaped-newlines>`)
- `GOOGLE_CLIENT_EMAIL`: Alternative simplified authentication method. Service account client email, used together with GOOGLE_PRIVATE_KEY. (example: `<your-service-account-email>`)
Note: Recommended install path is the published npm package via npx. Authentication supports three mutually alternative setups: (1) GOOGLE_PROJECT_ID + GOOGLE_APPLICATION_CREDENTIALS, (2) GOOGLE_SERVICE_ACCOUNT_KEY with optional GOOGLE_PROJECT_ID if project_id is absent from the JSON, or (3) GOOGLE_PRIVATE_KEY + GOOGLE_CLIENT_EMAIL with optional GOOGLE_PROJECT_ID. The README presents stdio configuration only.
Add this MCP server to my current client's config in the correct format for you. If you need secrets or credentials I haven't provided, ASK me — do not invent values or leave raw placeholders. After adding it, tell me how to verify the server is connected.GOOGLE_PROJECT_IDrequiredGoogle Cloud project ID used for authenticationGOOGLE_APPLICATION_CREDENTIALSrequiredPath to the service account JSON key file for Google authenticationGOOGLE_SERVICE_ACCOUNT_KEYrequiredAlternative JSON string form of the service account credentialsGOOGLE_PRIVATE_KEYrequiredAlternative private key value from the service account JSONGOOGLE_CLIENT_EMAILrequiredAlternative service account client email used with private key authenticationWeb scraping with stealth HTTP, real browsers, and Cloudflare bypass. CSS selectors supported.