
多账户 Google 工作区(Gmail、Drive、日历、表格、文档)+ Claude Code 的 Slack MCP 服务器。带有 AI 引导安装的安装指南和 CLAUDE.md。
概览
让 Claude Code 访问 Gmail、Google Drive、日历、表格、文档和 Slack——并全面支持多个 Google 账户(例如个人 + 工作账户)。 Claude Desktop 和 Claude Cowork 内置了 Google Workspace 集成——切换开关即可连接。截至 2026 年 3 月,官方没有集成,也没有处理多账户的插件,也没有关于如何设置的文档。 这个仓库是经过 ~6 小时的研究和调试才让它运行起来的成果。最终解决方案很简单,但要实现这一点,需要在 Claude Code 的 MCP 系统、Google 的 OAuth2 实现以及 gws CLI 中发现若干未公开的行为。 这不是单一问题——而是一堆问题,每一个都没有文档: 1. 如果你把mcpServers放在settings.local.json(你预期的位置),服务器就启动不了。没有错误。没有日志。你可以花几个小时重启并重新检查JSON语法。配置必须在项目根.mcp.json放进去。(Claude代码问题#24477) 2.
概述(AI 翻译)
让 Claude Code 访问 Gmail、Google Drive、日历、表格、文档和 Slack——并全面支持多个 Google 账户(例如个人 + 工作账户)。
背景
Claude Desktop 和 Claude Cowork 内置了 Google Workspace 集成——切换开关即可连接。**Claude Code 没有任何功能。**截至2026年3月,没有官方集成,没有处理多账户的插件,也没有关于如何设置的文档。
这个仓库是经过 ~6 小时的研究和调试,才让它运行起来的。最终解决方案很简单,但要实现这一点,需要在 Claude Code 的 MCP 系统、Google 的 OAuth2 实现以及 gws CLI 中发现若干未公开的行为。
是什么让这变得困难
这不是单一问题——而是一堆问题,每一个都没有文档:
-
Claude Code 会无声地忽略错误文件中的 MCP 配置。 如果你把
mcpServers放在settings.local.json(你预期的位置),服务器就无法启动。没有错误。没有日志。你可以花几个小时重启并重新检查 JSON 语法。配置必须在项目根节点的.mcp.json里。(Claude 代码问题 #24477) -
**一个OAuth客户端同时用于两个Google账户,会破坏两者。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Multi-Account Google Workspace + Slack MCP for Claude Code
Give Claude Code access to Gmail, Google Drive, Calendar, Sheets, Docs, and Slack — with full support for multiple Google accounts (e.g., personal + work).
Background
Claude Desktop and Claude Cowork have built-in Google Workspace integrations — flip a toggle and you’re connected. Claude Code has nothing. As of March 2026, there’s no official integration, no plugin that handles multi-account, and no documentation on how to set it up.
This repo is the result of ~6 hours of research and debugging to get it working. The final solution is simple, but getting there required discovering several undocumented behaviors in Claude Code’s MCP system, Google’s OAuth2 implementation, and the gws CLI.
What makes this hard
It’s not one problem — it’s a stack of them, each undocumented:
-
Claude Code silently ignores MCP config in the wrong file. If you put
mcpServersinsettings.local.json(where you’d expect it), servers don’t start. No error. No log. You can spend hours restarting and re-checking JSON syntax. The config must go in.mcp.jsonat the project root. (Claude Code Issue #24477) -
One OAuth client for two Google accounts breaks both. Google invalidates account A’s refresh token when you authenticate account B with the same OAuth client. You need separate OAuth Desktop App clients — one per account — in the same GCP project.
-
The credential file env var doesn’t work.
GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILEis supposed to let you point the Google Workspace CLI at different credential files, but it doesn’t reliably route to the right account. You have to mint fresh access tokens and pass them viaGOOGLE_WORKSPACE_CLI_TOKEN(the highest-priority auth method). -
Go binaries use single-dash flags. Both the
gwsCLI andslack-mcp-serverare Go binaries.--transport stdiofails silently. It’s-t stdio— or just omit it (stdio is the default). -
MCP servers only start at session launch. Config changes don’t take effect until you restart Claude Code entirely.
Each of these individually cost 30-120 minutes to diagnose. Together they make the setup feel broken when it’s actually a solvable configuration problem.
What we tried and rejected
| Approach | Why It Failed |
|---|---|
Legacy google-workspace Claude Code plugin |
Single-account only, port 8000 conflict blocks second instance |
| Single OAuth client for both accounts | Google invalidates first account’s refresh token on second auth |
CREDENTIALS_FILE env var per MCP server |
Doesn’t reliably route to the right account |
mcpServers in settings.local.json |
Silently ignored — Claude Code never reads MCP config from there |
mcpServers in .claude/settings.json |
Also silently ignored |
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →