
Better Workspace Mcp
io.github.n24q02m由 GitHub 账号 n24q02m 发布v0.6.0更新于 Oct 29, 2026
Google Workspace MCP — Docs, Drive, Calendar, Gmail, Sheets, Slides, Tasks, Chat, People, Forms
概览
Google Workspace MCP 服务器,让助手在你自己的 Google 账号下读写文档、云端硬盘、日历、Gmail、表格、幻灯片、任务、Chat、联系人和表单。
- 可以做什么
- 处理文档与文件:读取和创建 Docs、替换与格式化文本,搜索云端硬盘、管理文件夹、移动、重命名、移入回收站和下载文件、读取评论
- 管理邮件:搜索和读取 Gmail、发送邮件与草稿、修改标签和会话、下载附件
- 安排日程:列出日历和事件,创建、更新、删除和回复事件,查找空闲时间
- 编辑表格与演示文稿:读取 Sheets 区域和元数据,操作 Slides 的文本、形状、图片、表格和演讲者备注
- 整理任务、聊天与表单:任务列表与任务、Chat 空间与消息、个人资料查询、创建表单并读取回复
- 检查配置与时间:凭据与多账号管理、各工具帮助、本地日期与时区辅助
- 适用场景
- 适合希望助手直接操作真实 Google Workspace 账号的场景,例如起草和编辑文档、处理邮件、安排会议或填写表格,并从本地 MCP 客户端调用。适用于使用自有 Google Cloud OAuth 客户端的单用户桌面环境,或自行托管的多用户 HTTP 部署。
- 运行要求
- 通过 npx 或 Docker 以 stdio 在本地运行,或自行托管 HTTP 模式。需要一个启用了相应 Workspace API 的 Google Cloud 项目,以及 Desktop 类型的 OAuth 2.0 客户端,通过 GOOGLE_OAUTH_CLIENT_ID 和 GOOGLE_OAUTH_CLIENT_SECRET 提供。首次运行会在浏览器打开授权页,刷新令牌保存在 ~/.better-workspace/ 下。HTTP 模式还需 CREDENTIAL_SECRET 和 WORKSPACE_USERS_FILE。
安装
在 SourceWeft 中
- 打开 控制台中的 Better Workspace Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
workspace
Google Workspace MCP — Docs, Drive, Calendar, Gmail, Sheets, Slides, Tasks, Chat, People, Forms
ARCHIVED 2026-09-13 — This repository is no longer maintained. Use the official Google Workspace APIs instead of this MCP server. Existing installations keep working but receive no updates or support.
[Mode: stdio · http remote oauth] [CI] [CD] [codecov] [Latest release] [semantic-release] [License: Apache-2.0]
Docs · Install · Quick start · Community
Sister projects from n24q02m (click to expand)
Table of contents
- Install
- Remote (HTTP mode)
- Tools
- Quick start
- Multi-account
- Documentation
- Deployment
- Handover
- Contributing
- License
Install
The server runs in two modes: stdio (default, single-user, one Google OAuth client of your own) and HTTP (multi-user, per-user bearer tokens). For stdio, add it to your MCP client config:
The package is @n24q02m/workspace (formerly @n24q02m/better-workspace-mcp;
old package receives one final release then freezes). The MCP Registry id stays
io.github.n24q02m/better-workspace-mcp, and the legacy better-workspace-mcp
command is kept as an alias of workspace.
Those two values come from an OAuth 2.0 client of type Desktop app, created in the Google Cloud Console under APIs & Services → Credentials. Desktop is the right type because the server receives the consent redirect on a loopback address, not on a public URL. Enable the Workspace APIs you plan to call on the same project, and add yourself as a test user while the consent screen is unpublished.
The first run opens the Google consent screen in your browser; the refresh token
is stored encrypted on your machine under ~/.better-workspace/ (a legacy
~/.better-workspace-mcp/ is read as a fallback), so later runs start without asking again.
The same server can also serve several people over HTTP -- see Remote (HTTP mode).
Install with an AI agent -- paste this to your AI coding agent:
Install MCP server
workspacefollowing the steps at https://raw.githubusercontent.com/n24q02m/claude-plugins/main/plugins/better-workspace-mcp/setup-with-agent.md
Remote (HTTP mode)
Besides stdio, the server runs as a multi-user HTTP service. Each request carries a
bearer token from a users file (WORKSPACE_USERS_FILE), and each user's Google
credentials are kept in their own bucket, keyed by that user's namespace, so one
deployment serves several people without them sharing an account. Google consent for
an HTTP account runs on the host, with workspace auth --user <namespace>.
Point your MCP client at the host you deployed it on:
Modes
Two, and only two. There is no proxy or daemon mode: stdio speaks the MCP stdio transport directly, with no HTTP hop inside it.
Two OAuth clients, not one
Google binds redirect URIs to the type of the OAuth client, so the two modes
cannot share one. stdio uses a Desktop client, which may redirect to any
loopback port. HTTP uses a Web client. Keep the two credentials under separate
names: pointing GOOGLE_OAUTH_CLIENT_ID/_SECRET at the Web client on a machine
that also runs stdio breaks every stdio install. That is why
docker-compose.http.yml reads the Web pair as GOOGLE_OAUTH_WEB_CLIENT_ID/_SECRET
and renames it on the way into the container.
Environment
Credentials are stored on local disk under ~/.better-workspace/, which is the data volume in the container. A legacy ~/.better-workspace-mcp/ is read as a fallback.
docker-compose.http.yml in this repo is these variables written out as a
runnable overlay.
Tools
One composite tool per Workspace domain, plus config and help:
Questions are added to a form with forms(action="batchUpdate"), not at create;
responses are read-only, because the Forms API cannot write one. Listing or
deleting forms goes through drive.
Quick start
Check that the credentials landed, with the config tool. Before the first
consent this reports awaiting_setup; afterwards it names the account the server
is acting as:
Then call a domain tool. On docs, create returns the new document's ID, which
getText reads back:
time, config, and help need no Google account, so they answer even before
consent -- time is the quickest check that the server is wired up at all:
To act as a second Google account, see Multi-account.
Multi-account
Every domain tool takes an account parameter -- the email of the Google account
the call acts as. Omit it and the call runs against the primary account.
Those two gmail calls read two different mailboxes: the first [email protected],
the second whichever account is primary.
Accounts are managed through the config tool:
The first account authorized becomes the primary. Removing the primary promotes one of the remaining accounts; removing the last one puts the server back to awaiting setup. Naming an account that is not configured is an error that names it -- the call is never rerouted to the primary, because a silent fallback would act on the wrong mailbox.
account_add chooses its flow by transport. In stdio it starts a temporary loopback
consent server and returns the URL. Over HTTP it does not serve consent; it returns
the workspace auth --user <namespace> command for the host.
value="primary" is stdio only; remote callers change the default with
account_set_default.
Coming from an earlier single-account build
Credentials stored by a build from before multi-account support are one flat blob
of tokens. The first run afterwards adopts that blob into the multi-account layout
under the account's email. The email comes from the stored id_token when it is
present -- no network needed, and that is the usual case. Otherwise the server asks
Google's userinfo endpoint, which needs network access and a token that is still
valid or refreshable.
If neither works, the server reports itself as awaiting setup and opens the browser
OAuth flow even though the stored token may still be fine. Completing that consent
works, and nothing is discarded: the account you just authorized is stored and
becomes the primary, while the old tokens are carried across under the key
(unidentified) rather than being overwritten. config(action="account_list") then
shows two entries:
Nothing routes to (unidentified): it is never promoted to primary while a real
account remains, and no call reaches it unless you name it explicitly. It is there
so a credential whose owner could not be determined is not silently thrown away.
Remove it once the re-authorized account is working:
After a successful adoption -- the usual case -- config(action="account_list")
shows exactly one account, and it is the primary.
Forms scopes and re-consent
The consent screen has requested the Google Forms scopes since before the forms
tool existed, so it arrived without a second trip through consent.
Accounts authorized before those scopes were added are covered too, but by a
different route: Google accepts https://www.googleapis.com/auth/drive in place of
the Forms scopes for every Forms method this server calls, and full drive has
been on the consent screen since the first release. Google never widens a token it
has already issued, so if a grant covers neither -- a user may withhold individual
restricted scopes at the consent screen -- the first forms call returns a 403
(Request had insufficient authentication scopes). Re-authorize just that account
with config(action="account_add"), signing in as the same account; the record is
replaced in place, so nothing else changes.
Documentation
Full docs at docs.n24q02m.com/servers/workspace/:
- Setup -- plugin install, Docker stdio, and Docker HTTP methods
Every tool also documents itself at runtime: call help for the full reference on
any of them, including the exact parameters each action takes.
Deployment
No hosted endpoint is operated for this server. The supported paths are the stdio install above and a self-hosted HTTP deployment of your own.
To self-host HTTP mode, run the compose overlay from this repository:
It builds the http image locally and publishes it on host loopback only, at
GOOGLE_OAUTH_WEB_CLIENT_ID, GOOGLE_OAUTH_WEB_CLIENT_SECRET,
CREDENTIAL_SECRET, and WORKSPACE_USERS_FILE through your shell or an
.env file (see Environment). The users file maps each
bearer token to a user namespace; accounts are added on the host with
workspace auth --user <namespace>. For use beyond the local machine, put
your own TLS reverse proxy on the same host in front of it.
Each release also publishes multi-arch container images to Docker Hub and
GHCR; their default stage is the http server.
Contributing
See CONTRIBUTING.md.
License
Apache-2.0 © n24q02m
来源:README.md,提交 4c7332d
工具
0版本历史
2- v0.6.0最新Oct 29, 2026
- v0.5.0Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
