orieg/gws-connector
Enables searching emails, reading messages and threads, creating and sending drafts, managing labels, modifying message labels, and retrieving account profile information.
Allows listing and retrieving calendar events, creating new events, and listing available calendars for connected accounts.
Allows reading documents as plain text, inserting and replacing text, and creating new documents.
Provides tools to search files in Google Drive, read file content and metadata, and list folder contents.
Enables reading and writing cell ranges in spreadsheets, creating new spreadsheets, and listing tabs within a spreadsheet.
GWS Connector
Multi-account Google Workspace MCP server — connect multiple Gmail, Google Calendar, and Google Drive accounts with smart routing.
Works with Claude Code, Gemini CLI, GitHub Copilot, Cursor, OpenAI Codex, and any MCP-compatible client.
Why
Most AI coding assistants support a single Google account. If you use multiple Google accounts (personal + work, multiple clients, different orgs), you need to switch between them manually. This MCP server lets you connect them all at once and route requests by label, email, or domain.
Related MCP server: google-workspace-mcp
Features
Multi-account — connect unlimited Gmail and Google Workspace accounts
Smart routing — target accounts by label (
work), email, or domainPer-account OAuth — different orgs can use their own GCP credentials
Secure storage — client secrets and tokens stored in OS keychain (file fallback on Linux without GNOME Keyring)
30 tools — Mail (9), Calendar (4), Drive (3), Sheets (4), Docs (4), account management (6)
Account management — add, remove, set default, list accounts
Cross-platform — standard MCP server works with any compatible client
How it compares
There are several good Google Workspace MCP servers. GWS Connector is the one to pick when multiple accounts and operational simplicity matter:
Most GWS MCP servers | GWS Connector | |
Accounts | One account per server instance | Unlimited accounts in one instance, routed by label / email / domain |
Multiple orgs | Shared OAuth app | Per-account OAuth — each org uses its own GCP credentials |
Credential storage |
| OS keychain (Keychain / GNOME Keyring / Credential Manager) |
Runtime | Python/Node + dependencies | Single static Go binary, no runtime to install |
Clients | Usually one | Claude Code, Gemini CLI, Copilot, Cursor, Codex, any MCP client |
Install | Manual config | Claude Code plugin, Gemini extension, one-click |
If you only ever use a single Google account and want the widest possible tool surface (Slides, Forms, Chat, Tasks, …), a single-account server like taylorwilsdon/google_workspace_mcp may fit better. GWS Connector focuses on doing multi-account Gmail / Calendar / Drive / Sheets / Docs cleanly and securely.
Upgrading from v0.2.x
v0.3.0 adds native Google Sheets and Google Docs tools behind two new OAuth
scopes (spreadsheets, documents). Existing users must re-authorize
each connected account so new tokens are minted with these scopes:
/gws:reauthBefore approving the browser consent screen, review what the new scopes grant — full read and write access to every spreadsheet and document in that account's Google Drive, including files shared with the account. See the scope rationale table below for details.
You must also add the two new scopes (and enable the Sheets and Docs APIs) in your GCP project's OAuth consent screen configuration before re-auth, or the consent screen will reject the request.
Quick Start (Claude Code)
1. Install the plugin — run these two commands inside Claude Code:
/plugin marketplace add orieg/gws-connector
/plugin install gws@gws-connector2. Set up Google Cloud credentials — the interactive wizard walks you through everything:
/gws:configureThis creates a GCP project, enables APIs, and connects your first account (~5 minutes). See Google Cloud Setup if you prefer manual steps.
3. Connect additional accounts:
/gws:add-accountEach account can use different OAuth credentials from different GCP projects.
Gemini CLI
gemini extensions install https://github.com/orieg/gws-connectorThe binary is downloaded automatically on first use. Then connect accounts inside Gemini:
gws.accounts.add(label: "personal", clientId: "your-client-id", clientSecret: "your-secret")Other clients
Download a prebuilt binary or build from source:
git clone https://github.com/orieg/gws-connector && cd gws-connector && make buildThen configure your client:
Client | Config |
GitHub Copilot | Auto-detects from |
Cursor | Auto-detects from |
Codex CLI | Auto-detects from |
Claude Code (MCP only) |
|
Any MCP client |
|
Connect accounts via MCP tool call:
gws.accounts.add(label: "personal", clientId: "your-client-id", clientSecret: "your-secret")Environment variables (all optional): GWS_GOOGLE_CLIENT_ID, GWS_GOOGLE_CLIENT_SECRET, GWS_STATE_DIR
The --use-dot-names flag uses gws.mail.search naming; without it, tools use gws_mail_search.
git clone https://github.com/orieg/gws-connector
cd gws-connector
make build
claude --plugin-dir ./Use /reload-plugins inside the session after making changes. Run claude --debug --plugin-dir ./ to troubleshoot plugin loading.
Each release attaches a
one-click gws-mcp.mcpb bundle. Download it and open it with Claude Desktop
(Settings → Extensions → install from file), or drag it in. The bundle contains
the binaries for macOS and Linux and picks the right one for your machine
automatically. You still complete the Google Cloud setup
and connect accounts on first use.
The server is also published to the
official MCP Registry as
io.github.orieg/gws-connector, so MCP clients that browse the registry can find
and install it directly.
A multi-arch image is published to GHCR on each release:
docker run -i --rm ghcr.io/orieg/gws-connector:latestThe server speaks MCP over stdio. Interactive OAuth (accounts.add / reauth)
opens a browser and stores secrets in the OS keychain, so it needs host access —
day-to-day use is best via the native binary, the Claude Code plugin, or the
Gemini extension. The image is well suited to headless stdio integrations and to
registry/introspection checks. Persist the account registry across runs by
mounting a volume and pointing GWS_STATE_DIR at it:
docker run -i --rm -v gws-state:/state -e GWS_STATE_DIR=/state \
ghcr.io/orieg/gws-connector:latestUsage
All gws.* tools accept an optional account parameter:
# Uses default account
gws.mail.search(q: "is:unread")
# Target by label
gws.cal.list_events(account: "work")
# Target by email
gws.drive.search(account: "alice@company.com", q: "quarterly report")Available tools
Tool | Description |
| List all connected accounts |
| Connect a new account (waits up to ~60s; returns |
| Re-authorize an account (waits up to ~60s; returns |
| Finalize a pending OAuth flow (only needed if add/reauth returned |
| Disconnect an account |
| Change the default account |
| Search messages (Gmail query syntax) |
| Read a specific message |
| Read an entire thread |
| Create an email draft |
| Send an existing draft |
| List Gmail labels |
| Create a new label |
| Add/remove labels on a message |
| Get account profile info |
| List calendar events |
| Get event details |
| Create a calendar event |
| List available calendars |
| Search files in Drive |
| Read file content/metadata |
| List folder contents |
| Read a single A1 range from a spreadsheet |
| Write cell values to a range |
| Create a new spreadsheet |
| List tabs (sheets) in a spreadsheet |
| Read a document as plain text |
| Insert literal text at a location |
| Replace all occurrences of a literal substring |
| Create a new document |
Skills
Interactive workflows available in both Claude Code and Gemini CLI:
Skill | Description | Claude Code | Gemini CLI |
configure | Interactive setup wizard |
| "run the GWS configure skill" |
add-account | Connect a new account |
| "add a new GWS account" |
remove-account | Disconnect an account |
| "remove a GWS account" |
list-accounts | Show connected accounts |
| "list my GWS accounts" |
set-default | Change default account |
| "set my default GWS account" |
reauth | Refresh tokens/scopes |
| "reauth my GWS accounts" |
Recipes
Once accounts are connected, just ask your assistant in plain language — it picks the tools and the account. Examples:
Morning triage across accounts — "Summarize my unread email from the last 24 hours across all accounts, grouped by account, and flag anything that needs a reply today."
Draft a reply in a thread — "Find the thread with Acme about the Q3 invoice on my work account and draft a reply confirming the new date. Don't send it."
Turn an email into a calendar event — "Read the latest message from the events team and create a calendar event on my personal calendar with the date and location from it."
Cross-account digest — "What meetings do I have tomorrow across my work and personal calendars? List them in one timeline."
Find and summarize a doc — "Search my client-acme Drive for the latest 'statement of work' and give me the key deliverables and dates."
Log to a spreadsheet — "Append a row to the 'Expenses' sheet in my personal Drive: today's date, 'AWS', 42.50."
Keep inbox tidy — "Label all unread messages from newsletters@ as 'Newsletters' and mark them read on my personal account."
Tips:
Target an account explicitly with its label ("on my work account"), by email, or by domain — otherwise the default account is used.
Write operations (drafts, events, sheet/doc edits) are previewed for your confirmation before anything is sent or changed.
Google Cloud Setup
One-time setup (~5 minutes):
Go to Google Cloud Console and create a new project (e.g., "GWS Connector")
Enable APIs — click each link and hit "Enable":
Configure the OAuth consent screen:
Choose "External" (or "Internal" for Google Workspace orgs)
Fill in the app name (e.g., "Claude GWS") and your email for support contact
Click "Save"
Add scopes — go to Data Access:
Click "Add or Remove Scopes"
Add these 7 scopes (paste into the "Manually add scopes" box):
https://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/calendarhttps://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/spreadsheetshttps://www.googleapis.com/auth/documentshttps://www.googleapis.com/auth/userinfo.emailhttps://www.googleapis.com/auth/userinfo.profile
Click "Update", then "Save"
Why each scope is requested:
Scope
Purpose
Tools
gmail.modifyRead, draft, modify messages and labels
gws.mail.*calendarRead and create/update events
gws.cal.*driveSearch and read files and metadata across Drive
gws.drive.*spreadsheetsRead and write Google Sheets cell data and metadata
gws.sheets.*documentsRead and write Google Docs content
gws.docs.*userinfo.emailIdentify the authorizing account (email match on reauth)
account management
userinfo.profileStore a display name alongside the email
account management
Add test users — go to Audience:
Add each Google email address you plan to connect
⚠️ This is required — without this you'll get "Access blocked: has not completed the Google verification process" (error 403) during OAuth
Create OAuth credentials — go to Clients:
Click "+ Create Client" → "OAuth client ID"
Application type: Desktop app
Click "Create"
Download the JSON file (click the download icon) — this contains your Client ID and Client Secret
Multiple organizations
If you connect accounts from different Google Workspace orgs, each org needs its own GCP project. Create OAuth credentials in each project and provide them when connecting:
gws.accounts.add(label: "work", clientId: "work-client-id", clientSecret: "work-secret")
gws.accounts.add(label: "personal", clientId: "personal-client-id", clientSecret: "personal-secret")Client secrets are stored in the OS keychain. Client IDs are stored in the account registry.
Architecture
gws-connector/
├── cmd/gws-mcp/ # MCP server entrypoint
├── internal/
│ ├── accounts/ # Account registry & router
│ ├── auth/ # OAuth flow, token store, client factory
│ ├── server/ # MCP tool registration & dispatch
│ └── services/ # Gmail, Calendar, Drive API wrappers
│
├── .claude-plugin/ # Claude Code plugin manifest + marketplace
├── .mcp.json # Claude Code MCP config
├── gemini-extension.json # Gemini CLI extension manifest
├── CONTEXT.md # Shared behavioral context (both agents)
├── skills/ # Slash commands (Claude Code + Gemini CLI)
├── hooks/ # Claude Code session hooks
├── agents/ # Claude Code workspace agent
│
├── .vscode/mcp.json # GitHub Copilot MCP config
├── .cursor/mcp.json # Cursor MCP config
└── codex.json # OpenAI Codex CLI configToken storage: OS keychain (macOS Keychain, GNOME Keyring, Windows Credential Manager) with automatic file fallback
Client secrets: OS keychain per account (not stored in config files)
Account registry: JSON file at
~/.claude/channels/gws/accounts.json(contains client IDs and metadata, no secrets)Credential resolution: per-account credentials (keychain) → global env var fallback
Protocol: MCP (Model Context Protocol) over stdio — compatible with any MCP client
Development
make build # Build binary
make test # Run tests with race detector
make test-verbose # Run tests with verbose output
make lint # Run go vet
make release # Cross-compile for all platforms
make clean # Remove build artifactsLicense
MIT — see LICENSE.
Maintenance
Related MCP Servers
- Alicense-qualityAmaintenanceA multi-account, token-efficient MCP server for Google Workspace services including Gmail, Calendar, Drive, Docs, and Sheets. It enables secure management of multiple accounts with compact data retrieval and keychain-backed authentication for efficient workflow automation.1MIT
- AlicenseBqualityBmaintenanceA multi-account Google Workspace MCP server that drives Gmail, Google Calendar, and Google Drive across any number of Google accounts in parallel from one server.402MIT
- FlicenseBqualityDmaintenanceMCP server providing full access to Google Workspace services (Gmail, Drive, Calendar, Docs, Sheets, Slides, Forms, Tasks, Contacts) using OAuth authentication.1001
- AlicenseBqualityCmaintenanceComprehensive Google Workspace MCP server with Gmail, Drive, Calendar, and Contacts integration.2612MIT
Related MCP Connectors
Self-hosted multi-domain email as MCP tools - register domains, real mailboxes, send/read mail.
Hosted Google Calendar MCP server for AI agents. No self-hosting or Google Cloud setup.
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/orieg/gws-connector'
If you have feedback or need assistance with the MCP directory API, please join our Discord server