Skip to main content
Glama
spreadsheet-mcp-server

spreadsheet-mcp-server

by slevin48

Spreadsheet MCP🛠️

Tools:

  • list_worksheets

  • show_sheet

  • read_cell

  • find_cell

  • filter_rows_by_columns

Call from Claude

show_sheet

filter

Setup: C:\Users\<username>\AppData\Roaming\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "spreadsheet-mcp-server": {
      "command": "uvx",
      "args": [
        "--with-requirements=\\path\\to\\requirements.txt",
        "python",
        "\\path\\to\\main.py"
      ]
    }
  }
}

Related MCP server: Google Sheets and Drive MCP

Call from VSCode

https://github.com/user-attachments/assets/b640f1de-a97f-4d50-bd0e-3c3ad2baaa46

Command: uvx --with-requirements=requirements.txt python main.py

This will generate the following file in .vscode/ is you setup the MCP server for your workspace: mcp.json:

{
	"servers": {
		"spreadsheet-mcp-server": {
			"type": "stdio",
			"command": "uvx",
            "cwd": "C:\\path\\to\\spreadsheet-MCP", // C:\\Users\\ydebray\\Downloads\\magic-spread
			"args": [
				"--with-requirements=requirements.txt",
				"python",
				"main.py"
			]
		}
	},
	"inputs": []
}

Connect to Google Sheets with gspread

This small helper shows how to connect to a private spreadsheet using gspread and a service account (or user OAuth).

Service account: Create service account Share "magic-spread"

Files added:

  • connect_gspread.py — script to authorize and print a small preview of the spreadsheet.

  • requirements.txt — minimal Python dependencies.

  • .gitignore — ignores credential files.

Quick steps (Windows cmd.exe):

  1. Activate the virtualenv in this repo (if you use the provided env):

call env\Scripts\activate.bat
  1. Install dependencies:

pip install -r requirements.txt
  1. Provide credentials (one of the service-account options below):

  • Recommended: create a service account in Google Cloud, grant it at least Viewer access to the spreadsheet, then download the JSON key file and set:

set GOOGLE_APPLICATION_CREDENTIALS=C:\path\to\service-account.json
  • Alternative: set the JSON contents into an environment variable (not recommended for large JSONs):

set GSPREAD_SERVICE_ACCOUNT_JSON={...JSON contents...}
  1. Run the script (the default sheet id is already set in the script):

python connect_gspread.py --sheet-id <your-spreadsheet-id>

Notes:

  • If you prefer OAuth with a user account, ensure gspread.oauth() is configured (the script falls back to it but you need local OAuth config).

  • Keep credential JSON files out of source control. .gitignore was added to help with that.

If you want, I can run a quick local test in your environment — but I cannot access your credentials. If you paste a sanitized path to a service-account JSON that is already in the workspace (or set the env var), I can run the script here.

Debug the MCP Server

https://modelcontextprotocol.io/docs/tools/inspector

npx @modelcontextprotocol/inspector python main.py

inspector

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers