MCP server for Google Sheets integration
## Google Sheets MCP Server: Spreadsheet Integration The **Google Sheets MCP Server** integrates Google Sheets into Google Antigravity, enabling developers to read, write, and manipulate spreadsheet data through AI-assisted data operations. ### Why Google Sheets MCP? - **Cloud-Native**: Real-time collaboration and access from anywhere - **Formula Support**: Full Google Sheets formula capabilities - **Apps Script**: Trigger and manage Apps Script functions - **Data Validation**: Apply and manage data validation rules - **Permissions**: Fine-grained sharing and access control ### Key Features #### 1. Reading and Writing Data ```javascript // Read data from sheet const data = await sheets.getValues({ spreadsheetId: "spreadsheet_id", range: "Sheet1!A1:Z100" }); // Write data await sheets.updateValues({ spreadsheetId: "spreadsheet_id", range: "Sheet1!A1", values: [ ["Name", "Email", "Status"], ["John Doe", "john@example.com", "Active"], ["Jane Smith", "jane@example.com", "Pending"] ], valueInputOption: "USER_ENTERED" }); // Append rows await sheets.appendValues({ spreadsheetId: "spreadsheet_id", range: "Sheet1!A:C", values: [ ["New User", "new@example.com", "Active"] ], valueInputOption: "USER_ENTERED" }); ``` #### 2. Spreadsheet Management ```javascript // Create new spreadsheet const spreadsheet = await sheets.createSpreadsheet({ properties: { title: "Project Tracker" }, sheets: [ { properties: { title: "Tasks" } }, { properties: { title: "Timeline" } } ] }); // Add sheet to existing spreadsheet await sheets.addSheet({ spreadsheetId: "spreadsheet_id", properties: { title: "Reports", gridProperties: { rowCount: 1000, columnCount: 26 } } }); // Apply formatting await sheets.formatCells({ spreadsheetId: "spreadsheet_id", range: "Sheet1!A1:C1", format: { backgroundColor: { red: 0.2, green: 0.4, blue: 0.8 }, textFormat: { bold: true, foregroundColor: { red: 1, green: 1, blue: 1 } } } }); ``` ### Configuration ```json { "mcpServers": { "google-sheets": { "command": "npx", "args": ["-y", "@anthropic/mcp-gsheets"], "env": { "GOOGLE_CREDENTIALS": "/path/to/credentials.json", "GOOGLE_TOKEN": "/path/to/token.json" } } } } ``` ### Use Cases **Data Collection**: Build forms and collect data into spreadsheets. **Report Generation**: Create and update reports with live data. **Configuration Management**: Use sheets as a simple configuration database. The Google Sheets MCP Server brings cloud spreadsheet power to your development workflow.
{
"mcpServers": {
"google-sheets": {
"mcpServers": {
"google-sheets": {
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/credentials.json"
},
"args": [
"mcp-google-sheets"
],
"command": "uvx"
}
}
}
}
}