google_workspace_mcp MCP工具 是 AI Skill Hub 本期精选MCP工具之一。已获得 2.4k 颗 GitHub Star,综合评分 8.2 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
📚 深度解析
google_workspace_mcp MCP工具 是一款基于 MCP(Model Context Protocol)标准协议的 AI 工具扩展。MCP 协议由 Anthropic 开发并开源,旨在建立 AI 模型与外部工具之间的标准化通信接口,目前已被 Claude Desktop、Claude Code、Cursor 等主流 AI 工具采纳。
通过安装 google_workspace_mcp MCP工具,你的 AI 助手将获得额外的工具调用能力,可以用自然语言直接操控该工具的功能,无需学习复杂的命令行语法。MCP 工具的核心价值在于"一次配置,永久增强"——配置完成后,每次与 AI 对话时都可以无缝调用这些工具。
在技术实现上,MCP 工具通过标准的 JSON-RPC 协议与 AI 客户端通信,工具的功能以"工具列表"的形式暴露给 AI 模型,AI 可以按需调用。google_workspace_mcp MCP工具 提供了结构化的工具调用接口,使 AI 模型能够精确地理解和使用每个功能点,显著降低 AI 在工具使用上的错误率。
与传统的 API 集成相比,MCP 工具的优势在于无需编写代码——用户只需在配置文件中添加几行 JSON,即可让 AI 获得全新能力。AI Skill Hub 将 google_workspace_mcp MCP工具 评为 AI 评分 8.2 分,属于同类工具中的优质选择。
📋 工具概览
google_workspace_mcp MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
GitHub Stars
⭐ 2.4k
开发语言
Python
支持平台
Windows / macOS / Linux
维护状态
持续维护,定期更新
开源协议
MIT
AI 综合评分
8.2 分
工具类型
MCP工具
Forks
729
📖 中文文档
以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。
google_workspace_mcp MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
Workspace MCP is the single most complete MCP server, the only that integrates all major Google Workspace services with AI assistants and all agent platforms. The entire toolset is available for CLI usage supporting both local and remote instances.
✅ Tasks — Task & list management with hierarchy<br> 👤 Contacts — People API with groups & batch operations<br> 🔍 Custom Search — Programmable Search Engine integration
Python 3.10+ · uv/uvx · Google Cloud Project with OAuth 2.0 credentials
If you want the GCS credential store backend, install the optional dependency first:
```bash uv sync --extra gcs
Requires Python 3.10+ and uvx
Execute the full test suite (async fixtures require pytest-asyncio)
uv run pytest ```
uv sync --group test installs only the testing stack if you need a slimmer environment.
uv run main.py --transport streamable-http launches the server with your checked-out code for manual verification.
Ruff is part of the dev group because pre-push hooks call ruff check automatically—run it locally before committing to avoid hook failures.
</details>
OAuth 2.1 requires HTTP transport mode
export MCP_ENABLE_OAUTH21=true uv run main.py --transport streamable-http
If `MCP_ENABLE_OAUTH21` is not set to `true`, the server will use legacy authentication, which is suitable for clients that do not support OAuth 2.1.
<details open>
<summary>🔐 <b>How the FastMCP GoogleProvider handles OAuth</b> <sub><sup>← Advanced OAuth 2.1 details</sup></sub></summary>
FastMCP ships a native `GoogleProvider` that we now rely on directly. It solves the two tricky parts of using Google OAuth with MCP clients:
1. **Dynamic Client Registration**: Google still doesn't support OAuth 2.1 DCR, but the FastMCP provider exposes the full DCR surface and forwards registrations to Google using your fixed credentials. MCP clients register as usual and the provider hands them your Google client ID and, when configured, client secret under the hood.
2. **CORS & Browser Compatibility**: The provider includes an OAuth proxy that serves all discovery, authorization, and token endpoints with proper CORS headers. We no longer maintain custom `/oauth2/*` routes—the provider handles the upstream exchanges securely and advertises the correct metadata to clients.
The result is a leaner server that still enables any OAuth 2.1 compliant client (including browser-based ones) to authenticate through Google without bespoke code.
**Restricting DCR client redirect URIs:**
By default, any client going through Dynamic Client Registration can declare any `redirect_uri`. For publicly-exposed deployments, this is a phishing vector — an attacker can register a client with a `redirect_uri` they control and harvest authorization codes from tricked users. Set `WORKSPACE_MCP_ALLOWED_CLIENT_REDIRECT_URIS` to a comma-separated allowlist of permitted URIs:
bash
Stateless mode requires OAuth 2.1 to be enabled
export MCP_ENABLE_OAUTH21=true export WORKSPACE_MCP_STATELESS_MODE=true uv run main.py --transport streamable-http ```
Key Features: - No file system writes: Credentials are never written to disk - No debug logs: File-based logging is completely disabled - Memory-only sessions: All tokens stored in memory via OAuth 2.1 session store - Container-ready: Perfect for Docker, Kubernetes, and serverless deployments - Token per request: Each request must include a valid Bearer token
Requirements: - Must be used with MCP_ENABLE_OAUTH21=true - Incompatible with single-user mode - Clients must handle OAuth flow and send valid tokens with each request
This mode is ideal for: - Cloud deployments where persistent storage is unavailable - Multi-tenant environments requiring strict isolation - Containerized applications with read-only filesystems - Serverless functions and ephemeral compute environments
MCP Inspector: No additional configuration needed with desktop OAuth client.
Claude Code: No additional configuration needed with desktop OAuth client.
External OAuth provider mode requires OAuth 2.1 to be enabled
export MCP_ENABLE_OAUTH21=true export EXTERNAL_OAUTH21_PROVIDER=true uv run main.py --transport streamable-http ```
How It Works: - Protocol-level auth enabled: All MCP requests (including initialize and tools/list) require a valid Bearer token, following the standard OAuth 2.1 flow. Unauthenticated requests receive a 401 with resource metadata pointing to Google's authorization server. - External OAuth flow: Your external system handles the OAuth flow and obtains Google access tokens (ya29.*) - Token validation: Server validates bearer tokens by calling Google's userinfo API - Multi-user support: Each request is authenticated independently based on its bearer token - Resource metadata discovery: The server serves /.well-known/oauth-protected-resource (RFC 9728) advertising Google as the authorization server and the required scopes
Key Features: - No local OAuth flow: Server does not provide /authorize, /token, or /register endpoint
1. Create Search Engine - Visit the Control Panel - Choose "Search the entire web" or specify sites - Copy the Search Engine ID (looks like: 017643444788157684527:6ivsjbpxpqw)
2. Enable API & Get Key - Visit Google Developers Console - Enable "Custom Search API" in your project - Create credentials → API Key - Restrict key to Custom Search API (recommended)
3. Configure Environment - Add to your shell or .env:
workspace-cli list workspace-cli --url https://custom.server/mcp list
<sub>View all available tools</sub>
</td>
<td width="50%" align="center">
**◆ Call a Tool**
bash uv run workspace-cli call search_gmail_messages \ query="is:unread" max_results=5
<sub>Execute a tool with key=value arguments</sub>
</td>
</tr>
</table>
Set URL for remote endpoints with `--url` or the `WORKSPACE_MCP_URL` environment variable.
<details open>
<summary>≡ <b>Advanced: FastMCP CLI</b> <sub><sup>← inspect, install, discover</sup></sub></summary>
The upstream [FastMCP CLI](https://gofastmcp.com/cli) is also bundled and provides additional commands for schema inspection, client installation, and editor discovery. Note that `fastmcp` uses in-memory token storage, so each invocation may re-trigger the OAuth flow.
1. Create Project — Open Console → → Create new project 2. Create OAuth Credentials — APIs & Services → Credentials → Create Credentials → OAuth Client ID - Choose Desktop Application for a public PKCE client (no redirect URIs needed) or Web Application for a confidential client - Download and note your Client ID and, if issued, Client Secret 3. Enable APIs — APIs & Services → Library, then enable each service:
Optional bridge only for local legacy stdio sessions
WORKSPACE_MCP_HTTP_PORT=8001 uv run main.py workspace-cli --url http://127.0.0.1:8001/mcp list
The sidecar is disabled unless `WORKSPACE_MCP_HTTP_PORT` is set. It only exists to bridge local `workspace-cli` calls into a legacy stdio server. Do not use it for normal Claude Code, VS Code, hosted, or multi-user deployments; use streamable HTTP with OAuth 2.1 instead. When enabled, it validates ports in the `1..65535` range, binds to `127.0.0.1`, and logs a warning if the port is already in use while keeping stdio running.
**★ Tool Tiers**
bash uv run main.py --tool-tier core # ● Essential tools only uv run main.py --tool-tier extended # ◐ Core + additional uv run main.py --tool-tier complete # ○ All available tools
Loading Priority 1. Environment variables (export VAR=value) 2. .env file in project root (warning - if you run via uvx rather than uv run from the repo directory, you are spawning a standalone process not associated with your clone of the repo and it will not find your .env file without specifying it directly) 3. client_secret.json via GOOGLE_CLIENT_SECRET_PATH 4. Default client_secret.json in project root
Patterns use FastMCP's matcher: * wildcards any port or path component; *.example.com matches subdomains. Leaving the variable unset preserves the default DCR behaviour (any URI accepted), which is appropriate for local development but unsafe for public deployments.