home / mcp / google sheets api mcp server

Google Sheets API MCP Server

MCP Server generated by mcp.ag2.ai

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ag2-mcp-servers-google-sheets-api": {
      "command": "python",
      "args": [
        "mcp_server/main.py",
        "stdio"
      ],
      "env": {
        "CONFIG": "JSON string with the configuration",
        "SECURITY": "Security parameters such as API keys",
        "CONFIG_PATH": "Path to a JSON config file (e.g., mcp_server/mcp_config.json)"
      }
    }
  }
}

You run an MCP (Model Context Protocol) server to expose a concrete API as an MCP endpoint. This server for Google Sheets API v4 lets you interact with Sheets models through MCP transports, enabling tooling and clients to query and manipulate Sheets data in a structured, protocol-driven way.

How to use

You start the server in stdio mode and connect your MCP client to the local process. Use the provided start command to launch the server, then interact with it using your MCP client over the chosen transport. The server supports multiple transport modes, so you can adapt it to your tooling setup.

How to install

Prerequisites include Python 3.9 or newer, along with your preferred package manager for Python and the runtime tool.

Step-by-step deployment and runtime setup:

# Ensure Python 3.9+ is installed
python --version

# Create and activate a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate  # On Windows use: venv\Scripts\activate

# Install dependencies (editable with dev extras if available)
pip install -e ".[dev]"

# Alternatively, use the runtime launcher if preferred
# uv can be used to run Python packages directly if your setup supports it
uv pip install --editable ".[dev]"

Additional sections

Configuration and runtime parameters are provided to control how the server is started and what it exposes. You can customize the server using environment variables to point to a configuration file or pass a configuration string, and you can set security parameters as needed.

Security and environment: You can supply security-related values via environment variables to protect API access, keys, or other sensitive data. Use descriptive environment variable names and keep keys secure.

Notes and troubleshooting: If you encounter startup issues, verify that your Python environment is active, dependencies are installed, and the command used to start the server matches the runtime expectations of your setup. Ensure the configuration path or inline configuration is provided correctly if you rely on CONFIG_PATH or CONFIG.

Available tools

lint

Run static checks and formatting to ensure code quality and consistency.

static_analysis

Perform static analysis (mypy, bandit, semgrep) to catch type issues, security concerns, and potential vulnerabilities.

tests

Execute the test suite to validate functionality and maintain coverage.

start_stdio

Launch the MCP server in stdio mode using the provided runtime command.