Metadata-Version: 2.4
Name: barie-google-sheets-mcp
Version: 0.1.1
Summary: Google Sheets MCP Server for managing spreadsheets via the Model Context Protocol
Author-email: Barie <support@barie.ai>
License: MIT
Keywords: google-api,google-sheets,mcp,model-context-protocol
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial :: Spreadsheet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: google-api-python-client>=2.130.0
Requires-Dist: google-auth-oauthlib>=1.2.0
Requires-Dist: google-auth>=2.29.0
Requires-Dist: mcp>=0.9.0
Requires-Dist: pydantic>=2.0.0
Description-Content-Type: text/markdown

# Barie Google Sheets MCP Server

Model Context Protocol (MCP) server for Google Sheets and Google Drive discovery.

It supports listing spreadsheet-like files from Drive, and full read/write operations on **native Google Sheets**.

## Install

```bash
uvx barie-google-sheets-mcp --help
```

## Run

```bash
barie-google-sheets-mcp \
  --access-token "YOUR_ACCESS_TOKEN" \
  --refresh-token "YOUR_REFRESH_TOKEN" \
  --client-id "YOUR_CLIENT_ID" \
  --client-secret "YOUR_CLIENT_SECRET"
```

Optional:

- `--expiry`: token expiry timestamp in ISO format
- `--scopes`: JSON array string, for example:
  `["https://www.googleapis.com/auth/drive","https://www.googleapis.com/auth/spreadsheets"]`

## MCP Client Config Example

```json
{
  "mcpServers": {
    "google_sheets": {
      "command": "uvx",
      "args": [
        "barie-google-sheets-mcp",
        "--access-token",
        "YOUR_ACCESS_TOKEN",
        "--refresh-token",
        "YOUR_REFRESH_TOKEN",
        "--client-id",
        "YOUR_CLIENT_ID",
        "--client-secret",
        "YOUR_CLIENT_SECRET"
      ]
    }
  }
}
```

If you need to force-refresh package resolution in long-lived environments, you can add `--refresh` and `--reinstall` before `barie-google-sheets-mcp`.

## Tool Names

The server exposes these MCP tools:

- `list_spreadsheets`
- `get_spreadsheet`
- `create_spreadsheet`
- `get_sheet_data`
- `update_cells`
- `append_values`
- `add_columns`
- `add_rows`
- `batch_update`
- `batch_update_cells`
- `copy_sheet`
- `create_sheet`
- `find_in_spreadsheet`
- `get_multiple_sheet_data`
- `get_multiple_spreadsheet_summary`
- `get_sheet_formulas`
- `list_folders`
- `list_sheets`
- `rename_sheet`
- `search_spreadsheets`
- `share_spreadsheet`

## File Format Behavior

- `list_spreadsheets` can return Google Sheets and some spreadsheet-like Drive files.
- Read/write tools (`get_sheet_data`, `update_cells`, `append_values`, etc.) work only with native Google Sheets (`application/vnd.google-apps.spreadsheet`).
- For `.xlsx`, `.xls`, or `.csv`, convert to Google Sheets first, then use the converted file ID.

If a non-native spreadsheet is passed to a Sheets-only tool, the server returns a clear conversion-required error.

## Publish

```bash
cd google_sheets
python -m build
python -m twine check dist/*
python -m twine upload dist/*
```

