About Google Sheets
Google Sheets is an MCP server published by rohans2 in the Developer Tools category: an MCP Server written in TypeScript to access and edit data in your Google Sheets.
The repository has 18 stars and 3 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.
Install
git clone https://github.com/rohans2/mcp-google-sheetsThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Tools (13)
addColumnsAdds the specified number of columns to the specified sheet. Accepts spreadsheetId, sheetname, count of columns to be added, startColumn as arguments
Parameters not published.
addRowsAdds the specified number of rows to the specified sheet. Accepts spreadsheetId, sheetname, count of rows to be added, startRow as arguments
Parameters not published.
batchUpdateUpdates a range of values using the batchUpdate function of google sheets. The ranges are provided along with the values to be updated, in an array. It accepts spreadsheetId, sheet, and ranges as arguments.
Parameters not published.
copySheetCopies the contents of the source sheet to destination sheet. Accepts srcSpreadsheet, srcSheet, dstSpreadsheet, dstSheet as arguments.
Parameters not published.
createCreates a spreadsheet by taking the new sheet
Parameters not published.
createSheetCreates a new sheet in the spreadsheet provided as an argument. Accepts spreadsheet id and name of the sheet to be created as input arguments
Parameters not published.
listSheetsLists all the sheets present in the spreadsheet. Accepts spreadsheet id as input argument
Parameters not published.
listSpreadsheetsReturns a list of all the spreadsheets present within the current context. Returns the spreadsheet data in the form of [{spreadsheetId, spreadsheet name},...]
Parameters not published.
renameSheetRenames the provided sheet. Accepts spreadsheet id, old name and new name of the sheet as input arguments
Parameters not published.
shareSpreadsheetShares the provided spreadsheet to the recipients provided as an argument. Accepts recipients as an array of objects in the form of {email_address, role}. Also, sends a notification email to the users informing them about the access granted to them.
Parameters not published.
Show all 13 tools
sheetDataReturns the data present in the specified sheet, in the given range. If the range is not provided, it gives the data of the full sheet. Accepts spreadsheetId, sheet name, range as an argument
Parameters not published.
spreadsheetInfoGives info about the spreadsheet. Accepts spreadsheetId as an argument.
Parameters not published.
updateCellsUpdates the values present in the cells specified in the given range for the provided sheet. Accepts spreadsheetId, sheetname, range and data to be entered, as arguments.
Parameters not published.
Ask AI
Ask AI about Google Sheets
Powered by Claude · Grounded in docs
Security checks
Static checks derived from the repository 7 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository ships documentation.
- ✓License declaredUsable under a stated license.
- !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
- ✓Dependencies pinnedA lockfile pins dependency versions.
- ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
README
MCP-Google-Sheets
A TypeScript Model Context Protocol (MCP) server that lets AI agents securely interact with Google Sheets via well-typed “tools.” Built on Bun and the @modelcontextprotocol/sdk, it supports both OAuth2 and Service-Account flows.
🚀 Features
- Authentication
- Service-Account via base64-encoded
CREDENTIALS_CONFIG - OAuth2 using
credentials.json+token.jsonfor user-scoped access
- Service-Account via base64-encoded
- Tools
create
Creates a new spreadsheet (and moves it into your Drive folder if configured).listSheets
Lists all sheet tabs in a given spreadsheet.renameSheet
Renames an existing sheet tab.createSheet
Adds a new sheet tab to a spreadsheet.spreadsheetInfo
Fetches metadata (title, sheet IDs, grid properties) for a spreadsheet.listSpreadsheets
Lists all spreadsheets in your configured Drive folder (or My Drive).shareSpreadsheet
Shares a spreadsheet with users (reader/commenter/writer) and sends notifications.sheetData
Reads cell values from a sheet and range (or whole sheet).updateCells
Writes a 2D array of values into an A1-style range.batchUpdate
Applies multiple range updates in a single request.addRows/addColumns
Inserts rows or columns at a specified index.copySheet
Copies a sheet tab between spreadsheets (optionally renaming it).
📋 Prerequisites
- Bun (v1.0+) installed and on your
PATH - A Google Cloud project with:
- Sheets API & Drive API enabled
- An OAuth2 Client ID (download
credentials.json) or a Service Account key (downloadservice_account.json)
- (Optional) A Drive folder ID if you want new sheets moved out of My Drive
⚙️ Setup
- Clone the repo
git clone https://github.com/yourusername/mcp-google-sheets.git cd mcp-google-sheets - Install dependencies
bun install
- Configure environment
Create a .env (or export) with:
# Base64-encoded service-account key JSON (optional)
CREDENTIALS_CONFIG=BASE-64 ENCODED SERVICE_ACCOUNT.JSON
# Or put your OAuth2 JSON files next to index.ts:
# credentials.json (OAuth client secret)
# token.json (generated after first OAuth run)
# The google email address that you'll use to access the spreadsheet
EMAIL_ID="Enter the email address you’ll use to access the spreadsheet"
# (Optional) ID of the Drive folder to store new sheets
DRIVE_FOLDER_ID=1a2B3c4D5e6F...
Tip: On Linux/macOS you can do
export CREDENTIALS_CONFIG=$(base64 service_account.json | tr -d '\n')
▶️ Running the Server
bun index.ts
On first OAuth2 run (if using credentials.json), you’ll see a URL. Visit it, grant access, then paste the code back into your terminal. A token.json will be generated automatically.
🔧 How It Works
Initialization
-
initContext() picks your auth method (Service-Account → OAuth2 → error).
-
Builds google.sheets & google.drive clients and stores them in a shared context.
MCP Tool Registration
- Each “tool” (e.g. create, listSheets, sheetData) is registered via server.tool(...).
Transport
- Uses StdioServerTransport so Claude can invoke tools over stdin/stdout.
Invocation
The agent sends a JSON request:
{ "tool": "create", "args": { "title": "Budget Q2" } }
The server runs your handler, calls Google APIs, and returns JSON-wrapped results.
🛠️ Try It Out
Clone & configure as above.
Start the server:
bun index.ts
Invoke a tool via Claude
Demo
❤️ Contributing
Feel free to open issues or PRs for new tools, bug fixes, and enhancements.
README fetched from the repository 7 days ago. The original is authoritative.