google-sheets-writer
v0.1.9
Published
MCP server to read, write, and format Google Sheets from Claude — sign in with your own Google account.
Maintainers
Readme
Google Sheets Writer
An MCP server that lets Claude read, write, format, and create Google Sheets.
You sign in with your own Google account — no spreadsheet sharing, no service
accounts. Published on npm and run via npx, so it works in any MCP client
(Claude Code, VS Code, Claude Desktop, CLI).
- Scopes:
spreadsheets+drive.file(both sensitive, not the heavy restricted full-drive scope). - Token: stored locally at
~/.google-sheets-writer/token.json, auto-refreshed. - Auth: the OAuth client is supplied by you via env (no secret is bundled in the npm package).
20 tools
sign_in, get_auth_status, create_spreadsheet, share_spreadsheet,
list_sheets, read_range, write_range, append_rows, update_cells,
clear_range, add_sheet, delete_sheet, format_cells, set_borders,
merge_cells, unmerge_cells, freeze, set_dimension_size, add_dropdown,
add_conditional_format.
All spreadsheet_id / folder_id args accept a raw id or a full URL. Writes
default to USER_ENTERED (formulas & dates are parsed).
Install
Requires Node.js installed (so npx is available).
1. Create your own Google OAuth client (one time)
- Enable the Google Sheets API and Google Drive API.
- APIs & Services → Credentials → Create Credentials → OAuth client ID →
Desktop app → download the JSON (e.g. to
C:\Users\you\oauth-client.json). - On the OAuth consent screen, add yourself under Test users (or use Internal if you're in a Google Workspace org).
2. Add the MCP server to your client's config
Same JSON block everywhere — only the file location differs:
{
"mcpServers": {
"gsheet-writer": {
"command": "npx",
"args": ["-y", "google-sheets-writer@latest"],
"env": {
"GOOGLE_OAUTH_CLIENT_FILE": "C:\\Users\\you\\oauth-client.json"
}
}
}
}| Client | Where to put it |
|--------|-----------------|
| Claude Code / VS Code | .mcp.json in the project root, or claude mcp add |
| Claude Desktop | %APPDATA%\Claude\claude_desktop_config.json (Settings → Developer → Edit Config) |
| CLI | project .mcp.json |
@latest means each restart automatically picks up the newest published version.
3. Use it
Restart / reload the client, then just ask Claude to work with a sheet, e.g.
"read this sheet <link>". On the first request a browser opens for Google
sign-in — approve it and Claude continues automatically. No separate "connect"
step needed (a sign_in tool exists if you ever want to connect explicitly).
Auth options: set
GOOGLE_OAUTH_CLIENT_FILE(path) orGOOGLE_OAUTH_CLIENT_JSON(inline JSON) in theenvblock. The npm package ships without any bundled OAuth client, so no secret is ever published.
For developers
npm install
npm run typecheck
npm run build # esbuild -> dist/index.js (self-contained, has a shebang/bin)Run locally by pointing the env var at your client file:
GOOGLE_OAUTH_CLIENT_FILE=C:\path\to\oauth-client.json node dist/index.jsPublish a new version
npm version patch # bump
npm run build
npm publish # requires npm auth (2FA OTP or an automation token)The npm tarball only contains dist/index.js, package.json, and README.md
(the files whitelist) — never credentials.json.
Auth resolution order (runtime)
GOOGLE_OAUTH_CLIENT_JSON(inline JSON) — envGOOGLE_OAUTH_CLIENT_FILE(path) — env- bundled
dist/credentials.json, if present (used only for a self-contained build; not shipped to npm)
