google-workspace-mcp

google-workspace-mcp

A set of five independent MCP servers for Google Workspace (Gmail, Calendar, Drive, Sheets, Docs) enabling secure access and management of email, calendar events, files, spreadsheets, and documents. Features OAuth 2.1 with per-resource tokens and uses stable Google product APIs.

Category
访问服务器

README

google-workspace-mcp

A project for building five independent remote MCP servers for Google Workspace: Gmail, Google Calendar, Google Drive, Google Sheets, and Google Docs.

Status: pre-alpha. The MCP servers are not operational yet. The repository currently contains the package scaffold, five placeholder entry points, the downstream OAuth state core, and immutable per-service configuration.

Current status

Implemented:

  • a Python package with five console entry points;
  • SQLite-backed downstream OAuth state;
  • OAuth client registration and PKCE;
  • token binding to a canonical resource;
  • refresh token rotation, replay detection, and family revocation;
  • immutable state ownership metadata for the service and resource;
  • immutable per-service configuration with strict port and token TTL validation.

All five console entry points are placeholders and exit with a message that the service is not built. The HTTP/MCP transport, Google API integration, service tools, and deployment configuration are not implemented yet.

Planned services

The table describes the target scope. These capabilities are not available yet.

Service Target capabilities
gmail search and read messages and threads, labels, attachments, drafts, send, and reply
calendar calendars, event search and retrieval, availability, event creation and updates
drive file search, metadata, folder contents, download, and export
sheets spreadsheet metadata, range reads and writes, batch operations
docs document creation, structure and text retrieval, insert, and replace

In the target architecture, each service runs as a separate process with its own MCP endpoint, tool registry, Google OAuth scopes, Google credentials, and downstream OAuth state.

Target authorization architecture

The design uses two independent layers:

Client to service. The MCP client uses OAuth 2.1 with PKCE. Each access token is bound to one resource, and refresh tokens rotate with replay detection.

Service to Google. Each service uses separate Google credentials and the minimum required OAuth scopes. Google refresh tokens are never returned to MCP clients.

Only the state core for the first layer exists today. HTTP endpoints and the second authorization layer are not implemented.

Technology

Development prerequisites

  • Git
  • Python 3.14
  • uv

A Google Cloud project and OAuth client will be required after the Google API integration is implemented. The current version does not use them.

Development setup

git clone https://github.com/hawkxdev/google-workspace-mcp.git
cd google-workspace-mcp
uv sync --dev

The virtual environment does not need to be activated. Run commands through uv run.

Checks

uv run --no-sync pytest -q
uv run --no-sync ruff check .
uv run --no-sync ruff format --check .
uv run --no-sync mypy src

The --no-sync flag is required when checking the installed dependency version. A plain uv run may resynchronize the environment from the lock file.

Structure

Path Purpose
src/google_workspace_mcp/auth/state.py downstream OAuth state lifecycle
src/google_workspace_mcp/common/config.py immutable per-service environment configuration
src/google_workspace_mcp/cli/ five placeholder entry points
tests/core/ OAuth core and package entry point regressions
pyproject.toml package metadata, dependencies, and tool configuration
NOTICE provenance of adapted code

Contributing

The project is in early development. Before making a substantial change, open an issue describing the proposed behavior. Changes must not merge the five services into one process, share credentials between services, or introduce an OAuth bypass.

Provenance

The project adapts the OAuth 2.1 core from jimprosser/obsidian-web-mcp under the MIT License. See NOTICE for details.

The downstream OAuth 2.1 core is based on revision 7e6a52d791a50e3bd533df1060217973ab5be1c8. It includes additional fixes for client and token lifecycles, refresh token rotation, replay detection, and resource canonicalization.

The original project's Obsidian storage and Git synchronization functionality was not copied.

This project uses mcp>=2,<3. The mcp.server.fastmcp package removed in MCP 2.0 is not required; future composition will use mcp.server.mcpserver.

Author

Sergey Sokolkin (@hawkxdev)

License

MIT, see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选