Google Workspace MCP — Gmail Drive Calendar for AI
Official Google CLI with built-in MCP server for all Workspace APIs. One command gives AI agents access to Gmail, Drive, Calendar, Docs, Sheets, and 10+ Google services.
这个资产会安全暂存
这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。
npx -y tokrepo@latest install 557765e3-1497-4f9d-ad89-23f9460c6d75 --target codex先暂存文件;激活前需要读取暂存 README 和安装计划。
What it is
Google Workspace MCP is an official CLI tool with a built-in MCP (Model Context Protocol) server for Google Workspace APIs. One command starts a server that exposes Gmail, Google Drive, Calendar, Docs, Sheets, and over 10 other Google services to AI agents like Claude Code. The tool handles OAuth authentication and API access in a unified interface.
This MCP server targets developers and teams who want AI agents to read, search, and interact with their Google Workspace data. Instead of building custom API integrations, you configure the MCP server once and your agent gets structured access to all supported services.
How it saves time or tokens
Without this tool, connecting an AI agent to Google Workspace requires building OAuth flows, managing API credentials for each service, and writing custom tool definitions. Google Workspace MCP handles all of this with a single gws mcp command. You specify which services to expose, and the MCP server presents them as structured tools that agents can call directly.
How to use
- Install the CLI globally:
npm install -g @googleworkspace/cli. - Set up authentication with
gws auth setupfollowed bygws auth loginfor one-time OAuth consent. - Start the MCP server with
gws mcp -s drive,gmail,calendarto expose selected services.
Example
# Install the CLI
npm install -g @googleworkspace/cli
# One-time auth setup
gws auth setup
gws auth login
# Start MCP server with selected services
gws mcp -s drive,gmail,calendar
{
"mcpServers": {
"gws": {
"command": "gws",
"args": ["mcp", "-s", "drive,gmail,calendar"]
}
}
}
Related on TokRepo
- MCP Integrations — MCP server integrations for AI agent workflows
- Coding AI Tools — AI-powered development tools
Common pitfalls
- OAuth scopes are broad by default. Limit the services you expose with the
-sflag to only what your workflow needs. Avoid granting Gmail access if you only need Drive. - The MCP server runs locally and requires an active OAuth session. Tokens expire and may need re-authentication periodically.
- Some Google Workspace APIs have rate limits. Heavy automation against Gmail or Drive may trigger quota errors. Check Google API console for your usage limits.
常见问题
The server supports Gmail, Google Drive, Calendar, Docs, Sheets, Slides, Forms, Tasks, Keep, Contacts, and Admin. You select which services to expose using the -s flag when starting the server.
The CLI uses OAuth 2.0 with Google. You run gws auth setup once to configure credentials, then gws auth login to complete the OAuth consent flow in your browser. Tokens are stored locally and refreshed automatically.
Yes. Add the MCP server configuration to your claude_desktop_config.json file with the gws command and desired service arguments. Claude Desktop will start the MCP server automatically.
The @googleworkspace/cli package is the official Google CLI for Workspace APIs. The built-in MCP server capability exposes these APIs through the Model Context Protocol standard.
The agent gets the permissions you grant during OAuth consent, scoped to the services specified with -s. You can limit access to read-only for specific services. Review and revoke access at any time in your Google Account security settings.
引用来源 (3)
- Google Workspace CLI— Google Workspace CLI with built-in MCP server for AI agent access
- MCP Specification— Model Context Protocol specification for tool integration
- Google Workspace Developers— Google Workspace API documentation and OAuth scopes
来源与感谢
googleworkspace/cli — 24k+ stars, Apache 2.0
讨论
相关资产
Google Workspace MCP — Gmail/Calendar/Drive for Agents
Google Workspace MCP exposes Gmail, Calendar, and Drive actions as MCP tools so agents can summarize inboxes and manage schedules with minimal scopes.
Workspace MCP — Google Workspace Tools via MCP
Workspace MCP exposes Gmail/Drive/Calendar tools over MCP with uv launch tiers and an HTTP mode designed to work with Claude Code OAuth flows.
google-tag-manager-mcp-server — GTM MCP Remote Connector
Connect Google Tag Manager to MCP clients via an OAuth-backed remote server using mcp-remote + npx. Verified 152★; pushed 2026-05-14.
Google Stitch MCP — AI Design via Model Context Protocol
Connect Claude Code, Cursor, Gemini CLI, or VS Code to Google Stitch for AI-driven UI design. Create projects, generate screens from text, edit designs, manage design systems — all via MCP.