Skip to main content
Glama
README.md
# Google Multi-MCP

An MCP (Model Context Protocol) server that gives Claude access to your Google accounts -- Gmail, Calendar, Drive, Docs, Sheets, and Slides. Supports multiple accounts simultaneously.

## Features

- **26 tools** across 6 Google services
- **Multi-account** -- connect personal, work, and other Google accounts
- **OAuth2** -- secure authentication per account
- **Async** -- fast, non-blocking API calls

## Tools

| Service | Tools |
|---------|-------|
| **Gmail** (3) | `gmail_search`, `gmail_get`, `gmail_create_draft` |
| **Calendar** (5) | `calendar_list_events`, `calendar_get_event`, `calendar_create_event`, `calendar_update_event`, `calendar_delete_event` |
| **Drive** (5) | `drive_list_files`, `drive_get_file`, `drive_read_file`, `drive_upload_file`, `drive_create_folder` |
| **Docs** (4) | `docs_create`, `docs_get`, `docs_append`, `docs_replace_content` |
| **Sheets** (5) | `sheets_read`, `sheets_list`, `sheets_create`, `sheets_write`, `sheets_append` |
| **Slides** (3) | `slides_create`, `slides_get`, `slides_add_slide` |

## Quick Start

### 1. Set Up Google Cloud Project

1. Go to [Google Cloud Console](https://console.cloud.google.com)
2. Create a new project (or select existing)
3. Enable these APIs:
   - Gmail API
   - Google Calendar API
   - Google Drive API
   - Google Docs API
   - Google Sheets API
   - Google Slides API
4. Go to **APIs & Services > Credentials**
5. Click **Create Credentials > OAuth client ID**
   - Application type: **Desktop app**
   - Name it whatever you like
6. Download the JSON file (you'll need the `client_id` and `client_secret` from it)

> **Note:** If your project is in "Testing" mode, add each Google account you want to connect as a test user under **OAuth consent screen > Test users**.

### 2. Configure

```bash
git clone https://github.com/roseandgrit/google-multi-mcp.git
cd google-multi-mcp
cp config.yaml.example config.yaml
```

Edit `config.yaml` with your accounts and OAuth credentials:

```yaml
accounts:
  - email: you@example.com
    label: personal
  - email: you@work.com
    label: work

google_cloud:
  client_id: 123456789-abc.apps.googleusercontent.com
  client_secret: GOCSPX-your-secret-here
```

**Alternative:** Instead of putting credentials in `config.yaml`, you can place the downloaded `client_credentials.json` file directly in `~/.config/google-multi-mcp/`.

### 3. Install

```bash
pip install -e .
# or
uv pip install -e .
```

### 4. Add to Claude Code

Add to your `~/.claude.json` (or project `.mcp.json`):

```json
{
  "mcpServers": {
    "google-multi-mcp": {
      "command": "python",
      "args": ["/path/to/google-multi-mcp/server.py"],
      "env": {}
    }
  }
}
```

### 5. Authenticate

On first use, each account will open a browser window for OAuth consent. Tokens are saved to `~/.config/google-multi-mcp/` and refresh automatically.

If you ever need to re-authenticate an account, delete its token file:

```bash
rm ~/.config/google-multi-mcp/token_*
```

Then restart Claude Code -- it will prompt for OAuth again on next tool use.

## Environment Variable Configuration

If you prefer environment variables over `config.yaml`:

```bash
export GOOGLE_MCP_ACCOUNTS='[{"email": "you@example.com", "label": "personal"}]'
export GOOGLE_MCP_CLIENT_ID="your-client-id"
export GOOGLE_MCP_CLIENT_SECRET="your-client-secret"
```

## Requirements

- Python 3.10+
- Google Cloud project with OAuth credentials
- Claude Code or any MCP-compatible client

## How It Works

Each tool takes an `account` parameter so you can specify which Google account to use for each operation. The server handles OAuth token management, refresh, and API calls for all configured accounts.

Tokens are stored per-account in `~/.config/google-multi-mcp/token_<email>.json` and refresh automatically when they expire.

## License

MIT