# Google Sheet MCP SERVER (`bhansalisoft/google-sheet-mcp-server`) Actor

Google Sheet MCP SERVER for unique tool for Google Sheet integration  with all functionality on Any AI Tool

- **URL**: https://apify.com/bhansalisoft/google-sheet-mcp-server.md
- **Developed by:** [bhansalisoft](https://apify.com/bhansalisoft) (community)
- **Categories:** AI, MCP servers, Automation
- **Stats:** 24 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### 🚀 Google Sheet MCP Server

**Google Sheet MCP Server** is a powerful integration tool designed to expose **Google Sheets functionality** to your **AI workflows, automation pipelines, and Apify Actors** using the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/).

It enables seamless interaction with Google Sheets — including authentication, reading, writing, creating, and deleting sheets — directly from your code or automation flow.

### 🧠 Key Features

| Function                   | Description                                                                                                                                                                                                                                                                                     |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ✅ **get_credentials_tool** | Initiates Google OAuth authentication and provides an authorization URL for connecting your Google account.                                                                                                                                                                                     |
| ✅ **save_auth_code**       | Saves the authorization code obtained from `get_credentials_tool` to securely enable access.                                                                                                                                                                                                    |
| ✅ **list_spreadsheets**    | Lists all spreadsheets in your connected Google Drive.                                                                                                                                                                                                                                          |
| ✅ **list_sheets**          | Retrieves all sheet (tab) names from a specific spreadsheet.                                                                                                                                                                                                                                    |
| ✅ **read_range**           | Reads cell values from a specified range (e.g. `Sheet1!A1:B2`).                                                                                                                                                                                                                                 |
| ✅ **write_range**          | Writes values to a defined range (e.g. `Sheet1!A1:B2`) using JSON arrays such as `["test","test@gmail.com","message"]`.                                                                                                                                                                         |
| ✅ **clear_range**          | Clears data from a specified range (e.g. `Sheet1!A1:B2`).                                                                                                                                                                                                                                       |
| ✅ **insert_row**           | Appends one or multiple rows to the end of a specific sheet. <br> **Args:**<br> `spreadsheet_id` — Spreadsheet ID <br> `sheet_name` — Tab name <br> `row_values_json` — JSON or 2D array (e.g. `["A","B","C"]` or `[["A","B"],["C","D"]]`).                                                     |
| ✅ **create_sheet**         | Creates a new sheet/tab inside an existing spreadsheet.                                                                                                                                                                                                                                         |
| ✅ **delete_sheet**         | Deletes a sheet/tab using its numeric sheet ID.                                                                                                                                                                                                                                                 |
| ✅ **create_spreadsheet**   | Creates a brand-new spreadsheet in Google Drive and returns its ID.                                                                                                                                                                                                                             |
| ✅ **delete_spreadsheet**   | Deletes a specified spreadsheet from your Google Drive.                                                                                                                                                                                                                                         |
| ✅ **read_all_content**     | Reads **all data from all sheets** within a spreadsheet and returns JSON `{ "SheetName": [[...],[...]] }`.                                                                                                                                                                                      |
| ✅ **read_sheet_content**   | Reads spreadsheet data selectively with filtering options for sheet names. <br> **Args:** <br> `spreadsheet_id` — Spreadsheet ID <br> `sheet_filter` — Single name or JSON array (e.g. `"Sheet1"` or `["Sheet1","Data"]`) <br> `include_all` — Boolean flag to read all sheets or only matches. |

### 🧩 Ideal For

- AI tool developers using **MCP (Model Context Protocol)** for LLM-driven automations.
- **Apify Actors** that need to read/write structured data dynamically.
- **Automation systems** connecting Google Sheets with Apify, ChatGPT, or custom APIs.
- **Data collection pipelines** storing real-time results directly into Google Sheets.

***

### ⚙️ MCP Configuration

MCP SERVER URL

```

https://bhansalisoft--google-sheet-mcp-server.apify.actor/mcp

```

To connect this Actor to **Claude Desktop** or any MCP client, add to your config:

```json
{
    "mcpServers": {
        "slack-mcp-server": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://bhansalisoft--google-sheet-mcp-server.apify.actor/mcp?token=[Your APIFY KEY]"
            ]
        }
    }
}
```

Replace your  \[Your APIFY KEY]

Once connected, you’ll see all google sheet MCP tools automatically listed in your client.

### 🔐 Authentication

Before running the server, you must authenticate your Google account:

1. Run the `get_credentials_tool` to obtain your authorization URL.
2. Visit the URL and approve access.
3. Copy the generated **auth code** and pass it to `save_auth_code`.

This grants permission for all subsequent API actions (read/write/create/delete).

***

### 🧾 Example Output (JSON)

```json
{
  "sheet_name": "Sheet1",
  "values": [
    ["Name", "Email", "Status"],
    ["Alice", "alice@example.com", "Active"],
    ["Bob", "bob@example.com", "Inactive"]
  ]
}
```

***

### 🧠 Best Practices

- Always limit data ranges (`Sheet1!A1:D1000`) to improve performance.
- Use `insert_row` instead of `write_range` for scalable appends.
- Periodically refresh your credentials for long-running automations.
- Combine this MCP Server with **Apify Actors** for full workflow orchestration.

***

### 📦 Output Format

Each tool method returns **structured JSON**, ideal for:

- AI agents,
- Automation pipelines,
- Data monitoring dashboards,
- Google Sheet → Apify → AI feedback loops.

***

### 💡 Example Integration

This Actor can be directly integrated in **Apify + Gemini AI** or **Apify + ChatGPT** pipelines:

```mermaid
graph TD
A[Apify Scraper] --> B[Gemini AI MCP Server]
B --> C[Google Sheet MCP Server]
C --> D[Google Sheets Data Storage]
```

***

### 🏁 Summary

Google Sheet MCP Server is the bridge between **Google Sheets and AI-driven automations**, providing ready-to-use methods for all essential operations — from authentication to spreadsheet management.

It’s the easiest way to bring **Google Sheets I/O capabilities into your AI workflows**, Apify Actors, or MCP pipelines.

### Demo Videos

Check Demo video using TEST MCP Client

https://youtu.be/rJpD4sLu4ko

Check Demo using MCP inspector Tools

https://youtu.be/mrFGJ_Dw08w

# Actor input Schema

## Actor input object example

```json
{}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("bhansalisoft/google-sheet-mcp-server").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("bhansalisoft/google-sheet-mcp-server").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call bhansalisoft/google-sheet-mcp-server --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bhansalisoft/google-sheet-mcp-server"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/UAl2iw8vWHZNQRp0r/builds/V2yHduS1K28tZLkI7/openapi.json
