Gws Connector

io.github.orieg由 GitHub 帳號 orieg 發布v0.4.3更新於 Oct 24, 2026

Multi-account Google Workspace MCP — Gmail, Calendar, Drive, Sheets, Docs with smart routing.

概覽

AI 產生的概覽

讓助理依標籤、電子郵件或網域路由,讀取並操作多個 Gmail、日曆、Drive、試算表、文件、聯絡人、任務與簡報帳戶。

可以做什麼
GWS Connector 是本地 MCP 伺服器,提供 49 個 Google Workspace 工具:Gmail 搜尋、讀取、草稿與標籤;日曆事件與空閒/忙碌查詢;Drive 搜尋與檔案讀取;試算表讀寫與附加;文件讀取與編輯;聯絡人搜尋;任務;以及簡報。每個工具都接受選用的 account 參數,可依標籤、電子郵件地址或網域將請求路由到指定帳戶,否則使用預設帳戶。帳戶管理工具可新增、重新授權、列出、移除帳戶並設定預設帳戶。
適用情境
適合同時使用多個 Google 帳戶(例如個人加工作、或多個客戶組織),並希望在同一個助理工作階段中統一查詢與更新的情況。若只使用一個 Google 帳戶,則幫助不大。
執行需求
以 stdio 方式在本地執行;提供預先編譯的 Go 執行檔、Claude Code 外掛、Gemini 擴充功能、.mcpb 套件或 Docker 映像。需要一個已啟用相關 API 的 Google Cloud 專案、設定好所列範圍的 OAuth 同意畫面、加入測試使用者,以及桌面應用程式類型的 OAuth 用戶端憑證。選用環境變數:GWS_GOOGLE_CLIENT_ID、GWS_GOOGLE_CLIENT_SECRET、GWS_STATE_DIR。互動式 OAuth 會開啟瀏覽器,需要主機存取權。
安裝前請注意
OAuth 範圍授予廣泛的讀寫權限:gmail.modify、calendar、drive、spreadsheets、documents、tasks 與 presentations 可修改或刪除郵件、事件、檔案、試算表、文件與任務,gws.mail.send_draft 會寄出郵件。用戶端密鑰與權杖儲存在作業系統鑰匙圈,在沒有 GNOME Keyring 的 Linux 上會退回明文檔案。用戶端 ID 與帳戶中繼資料保存在本地登錄檔中。升級新增範圍後需要重新授權。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Gws Connector,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

GWS Connector

[CI] [Release] [Go] [License: MIT]

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.

Features

  • Multi-account — connect unlimited Gmail and Google Workspace accounts
  • Smart routing — target accounts by label (work), email, or domain
  • Per-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)
  • 49 tools — Mail (11), Calendar (7), Drive (3), Sheets (8), Docs (4), Contacts (2), Tasks (5), Slides (3), 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 serversGWS Connector
AccountsOne account per server instanceUnlimited accounts in one instance, routed by label / email / domain
Multiple orgsShared OAuth appPer-account OAuth — each org uses its own GCP credentials
Credential storage.env / plaintext token filesOS keychain (Keychain / GNOME Keyring / Credential Manager)
RuntimePython/Node + dependenciesSingle static Go binary, no runtime to install
ClientsUsually oneClaude Code, Gemini CLI, Copilot, Cursor, Codex, any MCP client
InstallManual configClaude Code plugin, Gemini extension, one-click .mcpb, MCP Registry

If you only ever use a single Google account and want the widest possible tool surface (Forms, Chat, Vault, …), a single-account server like taylorwilsdon/google_workspace_mcp may fit better. GWS Connector focuses on doing multi-account Gmail / Calendar / Drive / Sheets / Docs / Contacts / Tasks / Slides cleanly and securely.

Upgrading (Google Tasks)

The Google Tasks tools (gws.tasks.*) are added behind one new OAuth scope (tasks). Existing users must re-authorize each connected account so new tokens are minted with this scope:

/gws:reauth

Before approving the browser consent screen, review what the new scope grants — full read and write access to the account's Google Tasks lists and tasks. See the scope rationale table below for details.

You must also add the tasks scope and enable the Tasks API in your GCP project's OAuth consent screen configuration before re-auth, or the consent screen will reject the request. Until an account is re-authorized, the gws.tasks.* tools return an insufficient-scope error naming the reauth tool to run.

Upgrading — Contacts / People API

The Contacts tools (gws.contacts.search, gws.contacts.directory_search) add two new read-only OAuth scopes (contacts.readonly, directory.readonly). Existing users must re-authorize each connected account so new tokens are minted with these scopes:

/gws:reauth

Before approving the browser consent screen, review what the new scopes grant — read-only access to your Google Contacts and (for Workspace accounts) the organization directory. See the scope rationale table below for details.

You must also enable the People API and add the two new scopes in your GCP project's OAuth consent screen configuration before re-auth, or the consent screen will reject the request. gws.contacts.directory_search requires a Google Workspace account — personal Gmail accounts have no organization directory and receive a clear explanatory message instead of results.

Upgrading (Google Slides tools)

The Slides tools (gws.slides.*) add one new OAuth scope, https://www.googleapis.com/auth/presentations. Existing users must re-authorize each connected account so new tokens are minted with the Slides scope:

/gws:reauth

You must also enable the Slides API and add the presentations scope in your GCP project's OAuth consent screen configuration before re-auth, or the consent screen will reject the request (see Google Cloud Setup). Until you re-authorize, gws.slides.* calls return a scope error telling the agent to run gws.accounts.reauth; all other tools keep working.

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:reauth

Before 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-connector

2. Set up Google Cloud credentials — the interactive wizard walks you through everything:

/gws:configure

This creates a GCP project, enables APIs, and connects your first account. See Google Cloud Setup if you prefer manual steps.

3. Connect additional accounts:

/gws:add-account

Each account can use different OAuth credentials from different GCP projects.

Gemini CLI

bash
gemini extensions install https://github.com/orieg/gws-connector

The 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

GitHub Copilot / Cursor / Codex / Any MCP client

Download a prebuilt binary or build from source:

bash
git clone https://github.com/orieg/gws-connector && cd gws-connector && make build

Then configure your client:

ClientConfig
GitHub CopilotAuto-detects from .vscode/mcp.json, or add "command": "/path/to/gws-mcp" to VS Code MCP settings
CursorAuto-detects from .cursor/mcp.json, or add via Settings → MCP Servers
Codex CLIAuto-detects from codex.json
Claude Code (MCP only)claude mcp add --transport stdio gws-connector --scope user -- /path/to/gws-mcp --use-dot-names
Any MCP clientgws-mcp [--use-dot-names] over stdio

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.

Local development / testing
bash
git clone https://github.com/orieg/gws-connectorcd gws-connectormake buildclaude --plugin-dir ./

Use /reload-plugins inside the session after making changes. Run claude --debug --plugin-dir ./ to troubleshoot plugin loading.

Claude Desktop / MCPB bundle

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.

Docker

A multi-arch image is published to GHCR on each release:

bash
docker run -i --rm ghcr.io/orieg/gws-connector:latest

The 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:

bash
docker run -i --rm -v gws-state:/state -e GWS_STATE_DIR=/state \  ghcr.io/orieg/gws-connector:latest

Usage

All gws.* tools accept an optional account parameter:

# Uses default accountgws.mail.search(q: "is:unread")
# Target by labelgws.cal.list_events(account: "work")
# Target by emailgws.drive.search(account: "[email protected]", q: "quarterly report")

Available tools

ToolDescription
gws.accounts.listList all connected accounts
gws.accounts.addConnect a new account (waits up to ~60s; returns pendingId if slower)
gws.accounts.reauthRe-authorize an account (waits up to ~60s; returns pendingId if slower)
gws.accounts.completeFinalize a pending OAuth flow (only needed if add/reauth returned pendingId)
gws.accounts.removeDisconnect an account
gws.accounts.set_defaultChange the default account
gws.mail.searchSearch messages (Gmail query syntax)
gws.mail.read_messageRead a specific message
gws.mail.read_threadRead an entire thread
gws.mail.create_draftCreate an email draft
gws.mail.send_draftSend an existing draft
gws.mail.forwardBuild a forward draft of a message (does not send)
gws.mail.get_attachmentFetch a message attachment's bytes (base64)
gws.mail.list_labelsList Gmail labels
gws.mail.create_labelCreate a new label
gws.mail.modify_messageAdd/remove labels on a message
gws.mail.get_profileGet account profile info
gws.cal.list_eventsList calendar events
gws.cal.get_eventGet event details
gws.cal.create_eventCreate a calendar event
gws.cal.update_eventUpdate/reschedule an event (patch semantics)
gws.cal.delete_eventDelete/cancel an event
gws.cal.free_busyQuery free/busy across calendars
gws.cal.list_calendarsList available calendars
gws.drive.searchSearch files in Drive
gws.drive.read_fileRead file content/metadata
gws.drive.list_folderList folder contents
gws.sheets.read_rangeRead a single A1 range from a spreadsheet
gws.sheets.write_rangeWrite cell values to a range
gws.sheets.appendAppend rows after a table (additive, never overwrites)
gws.sheets.clearClear values in a range (formatting left intact)
gws.sheets.createCreate a new spreadsheet
gws.sheets.list_tabsList tabs (sheets) in a spreadsheet
gws.sheets.duplicate_tabDuplicate a tab (with formatting) inside a spreadsheet
gws.sheets.add_tabAdd a new empty tab to a spreadsheet
gws.docs.readRead a document as plain text
gws.docs.insert_textInsert literal text at a location
gws.docs.replace_textReplace all occurrences of a literal substring
gws.docs.createCreate a new document
gws.contacts.searchSearch your own contacts by name/email/phone (returns name, emails, phones)
gws.contacts.directory_searchSearch the Workspace org directory (returns name, emails); Workspace accounts only
gws.tasks.list_tasklistsList the account's task lists
gws.tasks.listList tasks in a list (add showCompleted for done tasks)
gws.tasks.createCreate a task (due is RFC3339; only the date is stored)
gws.tasks.completeMark a task completed (reversible)
gws.tasks.deletePermanently delete a task
gws.slides.getRead a presentation (slide count + per-slide text)
gws.slides.createCreate a new presentation
gws.slides.batch_updateApply raw Slides API requests to a presentation

Skills

Interactive workflows available in both Claude Code and Gemini CLI:

SkillDescriptionClaude CodeGemini CLI
configureInteractive setup wizard/gws:configure"run the GWS configure skill"
add-accountConnect a new account/gws:add-account"add a new GWS account"
remove-accountDisconnect an account/gws:remove-account"remove a GWS account"
list-accountsShow connected accounts/gws:list-accounts"list my GWS accounts"
set-defaultChange default account/gws:set-default"set my default GWS account"
reauthRefresh tokens/scopes/gws:reauth"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:

  1. Go to Google Cloud Console and create a new project (e.g., "GWS Connector")

  2. Enable APIs — click each link and hit "Enable":

  3. 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"
  4. Add scopes — go to Data Access:

    • Click "Add or Remove Scopes"
    • Add these 11 scopes (paste into the "Manually add scopes" box):
      • https://www.googleapis.com/auth/gmail.modify
      • https://www.googleapis.com/auth/calendar
      • https://www.googleapis.com/auth/drive
      • https://www.googleapis.com/auth/spreadsheets
      • https://www.googleapis.com/auth/documents
      • https://www.googleapis.com/auth/contacts.readonly
      • https://www.googleapis.com/auth/directory.readonly
      • https://www.googleapis.com/auth/tasks
      • https://www.googleapis.com/auth/presentations
      • https://www.googleapis.com/auth/userinfo.email
      • https://www.googleapis.com/auth/userinfo.profile
    • Click "Update", then "Save"

    Why each scope is requested:

    ScopePurposeTools
    gmail.modifyRead, draft, modify messages and labelsgws.mail.*
    calendarRead and create/update eventsgws.cal.*
    driveSearch and read files and metadata across Drivegws.drive.*
    spreadsheetsRead and write Google Sheets cell data and metadatagws.sheets.*
    documentsRead and write Google Docs contentgws.docs.*
    contacts.readonlyRead-only search of your own Google Contactsgws.contacts.search
    directory.readonlyRead-only search of the Workspace org directory (Workspace accounts only)gws.contacts.directory_search
    tasksRead and write Google Tasks lists and tasksgws.tasks.*
    presentationsRead and write Google Slides contentgws.slides.*
    userinfo.emailIdentify the authorizing account (email match on reauth)account management
    userinfo.profileStore a display name alongside the emailaccount management
  5. 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
  6. 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 config
  • Token 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

bash
make build          # Build binarymake test           # Run tests with race detectormake test-verbose   # Run tests with verbose outputmake lint           # Run go vetmake release        # Cross-compile for all platformsmake clean          # Remove build artifacts

License

MIT — see LICENSE.

來源:README.md,提交 0b6364b

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

4
  1. v0.4.3最新Sep 25, 2026
  2. v0.4.2Sep 25, 2026
  3. v0.4.1Sep 25, 2026
  4. v0.3.5Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分