mcp-google-sheets

Longtran2404/mcp-google-sheets

3.2

If you are the rightful owner of mcp-google-sheets and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

MCP Google Sheets Server is a comprehensive server solution for managing Google Sheets with a wide range of features and tools.

Tools
5
Resources
0
Prompts
0

๐Ÿš€ MCP Google Sheets Server v2.1.0

Complete MCP Server for Google Sheets - 40+ tools for professional sheet management, advanced charts, and enterprise features!

npm version npm downloads License: MIT TypeScript


โœจ NEW in v2.1.0 - Complete Sheet Management & Enhanced Charts!

  • ๐Ÿ“‹ Complete Sheet Management - Create, rename, hide/show, move, duplicate, delete sheets
  • ๐Ÿ“Š Advanced Chart Creation - Create charts with data, from tables, update chart data
  • ๐Ÿ” Sheet Information - Get detailed sheet properties, list all sheets
  • ๐ŸŽจ Professional Formatting - Colors, fonts, borders, conditional formatting
  • ๐Ÿ”’ Data Protection - Validation rules, range protection, access control
  • โšก Performance Optimized - Batch operations, efficient API usage
  • ๐Ÿš€ Enterprise Ready - 40+ tools for professional Google Sheets management

๐Ÿš€ Quick Installation

Method 1: Install from npm (Recommended)

npm install -g mcp-google-sheets-server

Method 2: Local installation

npm install mcp-google-sheets-server

Method 3: Use npx (No installation needed)

npx mcp-google-sheets-server

๐Ÿ” Google Service Account Authentication

Detailed Guide

See for step-by-step instructions on how to get Google Service Account Key.

Quick Configuration

{
  "mcpServers": {
    "mcp-google-sheets": {
      "command": "npx",
      "args": ["mcp-google-sheets-server"],
      "env": {
        "GOOGLE_SERVICE_ACCOUNT_KEY": "your-service-account-json"
      }
    }
  }
}

๐Ÿ“‹ Complete Tool Collection (40+ Tools!)

๐Ÿ”ง Basic Operations

ToolDescriptionParameters
sheets_get_dataGet data with formatting optionsspreadsheetId, range, valueRenderOption, dateTimeRenderOption
sheets_update_dataUpdate data with input optionsspreadsheetId, range, values, valueInputOption
sheets_createCreate spreadsheet with themetitle, initialData, theme

๐ŸŽจ Advanced Formatting

ToolDescriptionParameters
sheets_format_cellsApply professional formattingspreadsheetId, range, backgroundColor, textColor, fontSize, bold, italic, alignment, borders
sheets_conditional_formattingSet conditional rulesspreadsheetId, range, ruleType, value, colors
sheets_merge_cellsMerge cells with optionsspreadsheetId, range, mergeType

๐Ÿ“ˆ Enhanced Charts & Visualization

ToolDescriptionParameters
sheets_create_chartCreate basic chartsspreadsheetId, chartType, dataRange, title, position
sheets_create_chart_with_dataCreate charts with dataspreadsheetId, chartType, dataRange, title, position, chartOptions
sheets_create_chart_from_tableCreate charts from tablesspreadsheetId, chartType, tableRange, title, useFirstRowAsLabels
sheets_update_chartUpdate existing chartsspreadsheetId, chartId, title, dataRange
sheets_update_chart_dataUpdate chart dataspreadsheetId, chartId, newDataRange, updateTitle
sheets_delete_chartDelete chartsspreadsheetId, chartId
sheets_list_chartsList all chartsspreadsheetId

๐Ÿ“‹ Complete Sheet Management

ToolDescriptionParameters
sheets_create_sheetCreate new sheetsspreadsheetId, title, index
sheets_duplicate_sheetDuplicate existing sheetsspreadsheetId, sheetId, newTitle
sheets_delete_sheetDelete sheetsspreadsheetId, sheetId
sheets_rename_sheetRename sheetsspreadsheetId, sheetId, newTitle
sheets_hide_sheetHide sheets from viewspreadsheetId, sheetId
sheets_show_sheetShow hidden sheetsspreadsheetId, sheetId
sheets_move_sheetMove sheets to new positionspreadsheetId, sheetId, newIndex
sheets_get_sheet_infoGet all sheet informationspreadsheetId, includeGridData
sheets_get_sheet_propertiesGet specific sheet propertiesspreadsheetId, sheetId

๐Ÿ”’ Data Validation & Protection

ToolDescriptionParameters
sheets_set_data_validationSet validation rulesspreadsheetId, range, ruleType, values, message
sheets_protect_rangeProtect ranges from editingspreadsheetId, range, description, warningOnly

๐Ÿ“Š Advanced Data Operations

ToolDescriptionParameters
sheets_insert_rowsInsert rows at positionspreadsheetId, sheetId, startIndex, endIndex
sheets_insert_columnsInsert columns at positionspreadsheetId, sheetId, startIndex, endIndex
sheets_delete_rowsDelete rows from positionspreadsheetId, sheetId, startIndex, endIndex
sheets_delete_columnsDelete columns from positionspreadsheetId, sheetId, startIndex, endIndex

๐Ÿ“ Formula & Calculation

ToolDescriptionParameters
sheets_set_formulaSet formulas in cellsspreadsheetId, range, formulas
sheets_calculate_formulaCalculate formula resultsspreadsheetId, formula

โšก Batch Operations

ToolDescriptionParameters
sheets_batch_updateMultiple operations in one requestspreadsheetId, requests
sheets_batch_getGet data from multiple rangesspreadsheetId, ranges, valueRenderOption

๐Ÿ” Search & Sharing

ToolDescriptionParameters
sheets_searchSearch spreadsheetsquery, maxResults
sheets_shareShare with permissionsspreadsheetId, email, role, message
sheets_get_metadataGet comprehensive metadataspreadsheetId, includeGridData

๐Ÿงน Utility Operations

ToolDescriptionParameters
sheets_clear_rangeClear content and formattingspreadsheetId, range
sheets_copy_toCopy sheets between spreadsheetsspreadsheetId, sheetId, destinationSpreadsheetId

๐Ÿ› ๏ธ Advanced Setup Examples

Create Professional Spreadsheet with Multiple Sheets

{
  "mcpServers": {
    "mcp-google-sheets": {
      "command": "npx",
      "args": ["mcp-google-sheets-server"],
      "env": {
        "GOOGLE_SERVICE_ACCOUNT_KEY": "your-service-account-json"
      }
    }
  }
}

๐Ÿ“š Advanced Usage Examples

Complete Sheet Management Workflow

// 1. Create spreadsheet
const spreadsheet = await mcp.callTool("sheets_create", {
  title: "Business Dashboard 2024",
  theme: "LIGHT",
});

// 2. Create multiple sheets
await mcp.callTool("sheets_create_sheet", {
  spreadsheetId: spreadsheet.spreadsheetId,
  title: "Sales Data",
  index: 1,
});

await mcp.callTool("sheets_create_sheet", {
  spreadsheetId: spreadsheet.spreadsheetId,
  title: "Charts",
  index: 2,
});

// 3. Add data to Sales Data sheet
await mcp.callTool("sheets_update_data", {
  spreadsheetId: spreadsheet.spreadsheetId,
  range: "Sales Data!A1:D6",
  values: [
    ["Month", "Revenue", "Expenses", "Profit"],
    ["January", 50000, 30000, 20000],
    ["February", 55000, 32000, 23000],
    ["March", 60000, 35000, 25000],
    ["April", 65000, 38000, 27000],
    ["May", 70000, 40000, 30000],
  ],
});

// 4. Create professional chart
await mcp.callTool("sheets_create_chart_from_table", {
  spreadsheetId: spreadsheet.spreadsheetId,
  chartType: "COLUMN",
  tableRange: "Sales Data!A1:D6",
  title: "Monthly Financial Performance",
  useFirstRowAsLabels: true,
});

// 5. Rename and organize sheets
await mcp.callTool("sheets_rename_sheet", {
  spreadsheetId: spreadsheet.spreadsheetId,
  sheetId: 0, // First sheet
  newTitle: "Summary",
});

// 6. Move Charts sheet to the end
await mcp.callTool("sheets_move_sheet", {
  spreadsheetId: spreadsheet.spreadsheetId,
  sheetId: 2, // Charts sheet
  newIndex: 3, // Move to end
});

// 7. Hide a temporary sheet if needed
await mcp.callTool("sheets_hide_sheet", {
  spreadsheetId: spreadsheet.spreadsheetId,
  sheetId: 1, // Hide Sales Data sheet
});

Advanced Chart Management

// Create chart with custom options
await mcp.callTool("sheets_create_chart_with_data", {
  spreadsheetId: "your-spreadsheet-id",
  chartType: "LINE",
  dataRange: "A1:C10",
  title: "Trend Analysis",
  chartOptions: {
    colors: ["#4285F4", "#34A853"],
    legendPosition: "RIGHT_LEGEND",
  },
});

// Update chart data when source data changes
await mcp.callTool("sheets_update_chart_data", {
  spreadsheetId: "your-spreadsheet-id",
  chartId: 12345,
  newDataRange: "A1:C15", // Extended range
  updateTitle: "Updated Trend Analysis",
});

// List all charts in spreadsheet
const charts = await mcp.callTool("sheets_list_charts", {
  spreadsheetId: "your-spreadsheet-id",
});

// Delete unwanted charts
await mcp.callTool("sheets_delete_chart", {
  spreadsheetId: "your-spreadsheet-id",
  chartId: 12345,
});

Sheet Information and Properties

// Get information about all sheets
const sheetInfo = await mcp.callTool("sheets_get_sheet_info", {
  spreadsheetId: "your-spreadsheet-id",
  includeGridData: false,
});

// Get properties of specific sheet
const sheetProps = await mcp.callTool("sheets_get_sheet_properties", {
  spreadsheetId: "your-spreadsheet-id",
  sheetId: 0,
});

// Check if sheet is hidden
if (sheetProps.properties.hidden) {
  // Show the sheet
  await mcp.callTool("sheets_show_sheet", {
    spreadsheetId: "your-spreadsheet-id",
    sheetId: 0,
  });
}

๐Ÿ”ง Troubleshooting

Common errors:

ErrorSolution
"GOOGLE_SERVICE_ACCOUNT_KEY not found"โ€ข Check environment variable in mcp.json
โ€ข Ensure JSON is properly escaped
"Permission denied"โ€ข Check service account access permissions
โ€ข Ensure Google Sheets are shared with service account
"Invalid credentials"โ€ข Check service account JSON file
โ€ข Ensure Google Sheets API is enabled

๐Ÿš€ Advantages Over Other Solutions

  • โœ… 40+ Advanced Tools - Most comprehensive Google Sheets MCP server
  • โœ… Complete Sheet Management - Full control over sheets (create, rename, hide, move, delete)
  • โœ… Enhanced Chart Creation - Create charts with data, from tables, update dynamically
  • โœ… Professional Formatting - Colors, fonts, borders, conditional formatting
  • โœ… Data Validation - Set rules and protect sensitive data
  • โœ… Batch Operations - High-performance multiple operations
  • โœ… Sheet Information - Get detailed properties and status of all sheets
  • โœ… Performance Optimized - Efficient API usage and batch processing

๐Ÿ“„ License

MIT License - See file for details.


๐Ÿค Contributing

All contributions are welcome! Please:

  1. ๐Ÿด Fork the project
  2. ๐ŸŒฟ Create a feature branch (git checkout -b feature/AmazingFeature)
  3. ๐Ÿ’พ Commit your changes (git commit -m 'Add some AmazingFeature')
  4. ๐Ÿš€ Push to the branch (git push origin feature/AmazingFeature)
  5. ๐Ÿ”„ Open a Pull Request

๐Ÿ“ž Support

If you encounter issues:

  1. ๐Ÿ” Check Issues first
  2. ๐Ÿ†• Create a new issue if none exists
  3. ๐Ÿ“ Describe the problem in detail and how to reproduce it

โญ Star the Project

If this project is helpful, please give it a star! โญ


Made with โค๏ธ by Longtran2404

๐Ÿš€ Now with 40+ Tools for Complete Google Sheets Management! ๐Ÿš€