Multi Google MCP

Multi-account Google MCP server for Claude Code — Gmail, Drive, Calendar, Sheets, Docs, Contacts, Search Console. 83 tools with OAuth2 multi-account switching.

mcp-google-multi

A local MCP server that gives Claude Code (and any MCP client) access to Gmail, Google Drive, Google Calendar, Google Sheets, Google Docs, Google Contacts, and Google Search Console across multiple Google accounts simultaneously.

Features

  • Multi-account -- manage any number of Google accounts from a single server
  • 83 tools -- Gmail (21), Drive (15), Calendar (11), Sheets (9), Docs (8), Contacts (9), Search Console (10)
  • Config-driven -- accounts defined in .env, no code changes needed
  • Auto-refresh -- OAuth tokens refresh transparently and persist to disk
  • Stdio transport -- runs as a local subprocess, no hosting needed

Tools

Gmail (21 tools)

ToolDescription
gmail_searchSearch messages with Gmail query syntax
gmail_readRead a full message by ID
gmail_read_threadRead all messages in a thread
gmail_sendSend an email
gmail_download_attachmentDownload an email attachment to local disk
gmail_create_draftCreate a draft
gmail_modify_labelsAdd/remove labels on a message (star, archive, mark read, etc.)
gmail_trashMove a message to Trash (recoverable)
gmail_deletePermanently delete a message (irreversible)
gmail_batch_modifyBulk add/remove labels across up to 1000 messages
gmail_batch_deletePermanently delete multiple messages (irreversible)
gmail_list_draftsList all drafts
gmail_get_draftRead a specific draft
gmail_send_draftSend an existing draft
gmail_list_labelsList all labels (system + custom)
gmail_create_labelCreate a custom label
gmail_delete_labelDelete a label
gmail_get_profileGet account email, message count, history ID
gmail_list_historyGet mailbox changes since a history ID
gmail_get_vacationRead vacation responder settings
gmail_set_vacationEnable/disable vacation responder

Google Drive (15 tools)

ToolDescription
drive_searchSearch files with Drive query syntax
drive_readRead file content (exports Workspace docs as text)
drive_listList files in a folder or root
drive_uploadUpload a local file to Drive
drive_downloadDownload a binary file to local disk
drive_exportExport Google Docs/Sheets/Slides to PDF, DOCX, XLSX, Markdown, etc.
drive_create_folderCreate a new folder
drive_updateRename, move, or replace file content
drive_deletePermanently delete a file (irreversible)
drive_trashMove a file to trash (recoverable)
drive_copyDuplicate a file
drive_shareShare with user/group/domain/anyone
drive_list_permissionsList who has access to a file
drive_remove_permissionRevoke access
drive_get_aboutStorage quota and account info

Google Calendar (11 tools)

ToolDescription
calendar_list_calendarsList all calendars
calendar_list_eventsList/search events with time range
calendar_get_eventGet a single event by ID
calendar_create_eventCreate an event
calendar_update_eventUpdate an event
calendar_delete_eventDelete an event
calendar_quick_addCreate event from natural language (e.g. "Lunch Thursday 1pm")
calendar_move_eventMove an event between calendars
calendar_list_instancesList occurrences of a recurring event
calendar_get_freebusyCheck free/busy times for calendars
calendar_create_calendarCreate a new calendar

Google Sheets (9 tools)

ToolDescription
sheets_createCreate a new spreadsheet
sheets_getGet spreadsheet metadata (title, sheets/tabs, named ranges)
sheets_read_rangeRead cell values from a range (A1 notation)
sheets_write_rangeWrite values to a range
sheets_append_rowsAppend rows after existing data
sheets_clear_rangeClear values from a range (keeps formatting)
sheets_batch_readRead multiple ranges at once
sheets_batch_writeWrite to multiple ranges at once
sheets_add_sheetAdd a new tab/sheet to a spreadsheet

Google Docs (8 tools)

ToolDescription
docs_createCreate a new document
docs_getGet document metadata (title, revision, named ranges)
docs_readRead document content as plain text
docs_insert_textInsert text at a position or at the end
docs_replace_textFind and replace all occurrences
docs_delete_rangeDelete content in an index range
docs_update_styleUpdate text formatting (bold, italic, font, size)
docs_insert_tableInsert a table at a position

Google Contacts (9 tools)

ToolDescription
contacts_searchSearch contacts by name, email, phone, or organization
contacts_getGet a single contact by resource name
contacts_listList all contacts (paginated)
contacts_createCreate a new contact
contacts_updateUpdate an existing contact
contacts_deleteDelete a contact
contacts_groups_listList all contact groups (labels)
contacts_group_membersList members of a contact group
contacts_group_createCreate a new contact group

Google Search Console (10 tools)

ToolDescription
searchconsole_sites_listList all Search Console properties
searchconsole_sites_getGet details for a specific property
searchconsole_sites_addAdd a property to Search Console
searchconsole_sites_deleteRemove a property
searchconsole_sitemaps_listList submitted sitemaps
searchconsole_sitemaps_getGet sitemap details (status, errors, indexed count)
searchconsole_sitemaps_submitSubmit a sitemap
searchconsole_sitemaps_deleteDelete a submitted sitemap
searchconsole_searchanalytics_queryQuery search analytics (clicks, impressions, CTR, position) with filtering
searchconsole_url_inspectInspect a URL (indexing status, crawl info, rich results, mobile usability)

Every tool accepts an account parameter matching one of your configured aliases.

Prerequisites

  • Node.js 18+
  • A Google Cloud project with Gmail API, Google Drive API, and Google Calendar API enabled
  • An OAuth 2.0 Client ID (Desktop app type)

Setup

1. Google Cloud Credentials

  1. Go to Google Cloud Console
  2. Create or select a project
  3. Enable these APIs:
  4. Go to APIs & Services > Credentials > Create Credentials > OAuth 2.0 Client ID
  5. Application type: Desktop app
  6. Add authorized redirect URI: http://localhost:4242/oauth2callback
  7. Copy the Client ID and Client Secret

2. Install & Configure

git clone https://github.com/bakissation/mcp-google-multi.git
cd mcp-google-multi
npm install
cp .env.example .env

Edit .env:

GOOGLE_CLIENT_ID=your_client_id_here
GOOGLE_CLIENT_SECRET=your_client_secret_here

# Define your accounts as alias:email pairs (comma-separated)
GOOGLE_ACCOUNTS=work:[email protected],personal:[email protected]

3. Build

npm run build

4. Authenticate Accounts

Run the auth flow for each account alias you defined:

npm run auth -- work       # opens browser -> log in with [email protected]
npm run auth -- personal   # opens browser -> log in with [email protected]

Each saves a token to tokens/<alias>/token.json. Tokens auto-refresh -- you should only need to do this once per account.

5. Register in Claude Code

claude mcp add google-multi -s user -- node /absolute/path/to/mcp-google-multi/dist/index.js

Or add it manually to your Claude Code MCP config:

{
  "mcpServers": {
    "google-multi": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-google-multi/dist/index.js"]
    }
  }
}

Adding / Removing Accounts

Edit the GOOGLE_ACCOUNTS variable in .env, rebuild, and authenticate the new account:

# Add a new account
# .env: GOOGLE_ACCOUNTS=work:[email protected],personal:[email protected],freelance:[email protected]

npm run build
npm run auth -- freelance

No code changes required.

Project Structure

mcp-google-multi/
├── src/
│   ├── index.ts          # Entry point: MCP server or auth CLI
│   ├── accounts.ts       # Account config parser (reads from .env)
│   ├── auth.ts           # OAuth flow with local HTTP callback
│   ├── client.ts         # OAuth2Client factory with auto-refresh
│   ├── types.ts          # Shared TypeScript types
│   └── tools/
│       ├── gmail.ts      # 21 Gmail tools
│       ├── drive.ts      # 15 Drive tools
│       ├── calendar.ts   # 11 Calendar tools
│       ├── sheets.ts     # 9 Sheets tools
│       ├── docs.ts       # 8 Docs tools
│       ├── contacts.ts   # 9 Contacts tools
│       └── searchconsole.ts # 10 Search Console tools
├── tokens/               # OAuth tokens per account (gitignored)
├── dist/                 # Compiled output (gitignored)
├── .env                  # Your credentials (gitignored)
├── .env.example          # Template for .env
├── package.json
├── tsconfig.json
└── LICENSE

OAuth Scopes

ScopeAccess
gmail.modifyRead, label, trash, delete emails
gmail.sendSend emails
driveFull Drive access (read, upload, share, delete)
calendarFull calendar access
spreadsheetsRead/write Google Sheets
documentsRead/write Google Docs
contactsRead/write Google Contacts
webmastersGoogle Search Console (sites, sitemaps, analytics, URL inspection)

Troubleshooting

"GOOGLE_ACCOUNTS is not set" -- Make sure your .env file exists in the project root and has the GOOGLE_ACCOUNTS variable set.

"No token file found for account X" -- Run npm run auth -- <alias> to authenticate that account.

"Port 4242 is already in use" -- Another process is using port 4242. Close it and retry the auth flow.

Token refresh errors -- Delete the token file at tokens/<alias>/token.json and re-authenticate.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Author

Abdelbaki Berkatiberkati.xyz · @bakissation

Read the case study →

License

MIT

Related Servers

NotebookLM Web Importer

Import web pages and YouTube videos to NotebookLM with one click. Trusted by 200,000+ users.

Install Chrome Extension