gdoc MCP

gdoc MCP

Enables interaction with Google Docs through typed MCP tools, supporting reading, writing, searching, and managing documents via OAuth integration.

Category
访问服务器

README

<!--ai-->

gdoc MCP

Typed MCP tools backed by Luca De Leo's gdoc CLI. It follows JP Addison's dharma pattern: the MCP server validates tool inputs, runs the CLI without a shell, returns structured output, and keeps an allowlisted escape hatch for new CLI features.

Chosen deployment

Use the hosted MCP connector for 80,000 Hours. A Claude owner adds one URL; each staff member clicks Connect and authorizes their own Google account. This is the only option that gives staff the same connector-level experience as native Drive.

The local MCPB remains a fallback for development, personal use, or environments where hosting Google refresh tokens is unacceptable. It is not the planned staff deployment.

Local fallback

Recipients do not need a terminal, Python, Node, uv, or a separate gdoc install:

  1. Open the .mcpb built for the right Google profile and Mac architecture.
  2. In Claude, ask: “Connect Google Docs using the gdoc tools.”
  3. Claude calls connect_google; the bundle opens Google's authorization page.
  4. Sign into Google and approve access once.

The bundle contains the CLI and the profile's Desktop OAuth client. Google stores no password in the extension: the browser returns an authorization code, and gdoc saves the resulting refresh token locally under ~/.config/gdoc/ with mode 0600.

connect_google is separate from Claude's connector-level Connect button. That button is available to remote MCP connectors; a local MCPB initiates OAuth from its own tool.

Remote connector

Follow the personal end-to-end test guide to configure Google Cloud, install the Web OAuth credential without exposing it, add the connector to Claude, and verify read and write calls.

The remote service gives Claude Team users the native connector flow: an owner adds https://gdoc-mcp-alejo.fly.dev/mcp once, then each user clicks Connect and grants Google access. The deployed endpoint is healthy, but its current personal Desktop OAuth credential cannot accept a hosted callback. Before testing Connect, create a Google OAuth client of type Web application with this authorized redirect URI:

https://gdoc-mcp-alejo.fly.dev/oauth/google/callback

Then replace the two staged Fly secrets and redeploy:

flyctl secrets set --app gdoc-mcp-alejo \
  GOOGLE_CLIENT_ID='<web-client-id>' \
  GOOGLE_CLIENT_SECRET='<web-client-secret>'

flyctl deploy --app gdoc-mcp-alejo --remote-only

For 80,000 Hours, deploy a separate organization-owned instance, set ALLOWED_GOOGLE_DOMAIN=80000hours.org, and use an Internal Web OAuth client owned by the Workspace organization. Keeping personal and organizational deployments separate prevents a credential switch from invalidating another profile's stored grants.

The service implements MCP dynamic client registration, S256 PKCE, OAuth resource indicators, Google identity verification, one-hour MCP access tokens, MCP refresh tokens, and per-user MCP sessions. Google refresh tokens and MCP credentials are stored in one AES-256-GCM encrypted file on an encrypted persistent volume. The encryption key is a deployment secret. A Google token is materialized in a mode-0600 temporary home directory only while gdoc handles a request, then removed.

The current encrypted file store requires one running machine. Before adding replicas, replace it with a transactional shared database or add cross-process locking.

Private build profiles

OAuth client files identify their owning Google Cloud project and must not be committed or attached to a public release. Build profile bundles locally:

npm ci

npm run build:mcpb -- personal \
  ~/.config/credentials/google-oauth-client-mac-air-2020-personal.json

npm run build:mcpb -- 80000hours \
  /path/to/80000hours-google-desktop-oauth-client.json

Outputs on an Apple Silicon Mac:

dist/gdoc-personal-arm64.mcpb
dist/gdoc-80000hours-arm64.mcpb

The personal profile defaults to alejoacelas@gmail.com. The 80,000 Hours profile leaves the account open for each employee and sends 80000hours.org as Google's account chooser hint. The organization OAuth application should use an Internal audience; that, not the hint, enforces the Workspace domain.

The build fails before creating a bundle if the selected credential file is absent or is not a Google Desktop OAuth client.

Run from source

Developers can use an installed gdoc and any credential source it supports:

npm ci
GDOC_BIN=/absolute/path/to/gdoc npm start

The server exposes typed tools for browser authorization, reading, search, tabs, revisions, comments, writes, edits, sharing, and document creation. gdoc_cli passes arguments to an explicit subcommand allowlist without invoking a shell; auth, config, update, and internal hooks cannot be reached through that raw tool.

Test

npm test

The live deployment can be checked without Google credentials:

curl -fsS https://gdoc-mcp-alejo.fly.dev/health
curl -fsS https://gdoc-mcp-alejo.fly.dev/.well-known/oauth-protected-resource/mcp

Tests use a fake CLI: they do not open a browser or call Google. The profile build also validates the manifest and packages a platform-native CLI. After unpacking a built bundle, a smoke test should list tools and call gdoc_cli with cat --help; this proves the server can find and execute the bundled binary without accessing Drive.

Platform support

The current builds contain a PyInstaller CLI and are architecture-specific:

  • arm64: Apple Silicon Macs;
  • x64: Intel Macs when built on an Intel Mac;
  • Windows is not built yet.

MCPB itself supports macOS and Windows. Windows support requires building a Windows gdoc.exe on Windows and either publishing a separate bundle or adding runtime OS/architecture selection to one multi-platform bundle.

Security boundaries

  • Profile OAuth clients are copied only into ignored local build artifacts.
  • Refresh tokens are created by Google's browser flow; they are never committed or placed in the .mcpb.
  • Model-provided values go to execFile, never a shell.
  • The raw CLI tool excludes authentication and administrative commands.
  • Temporary Markdown files used for writes are mode 0600 and removed after use.
  • Remote Google grants and MCP credentials are encrypted at rest; OAuth state and PKCE bind each browser callback to the initiating Claude connection.
  • The bundled executable is unsigned, so a downloaded bundle may need Gatekeeper approval.

MIT. <!--/ai-->

推荐服务器

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 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

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

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

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

官方
精选
Python
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 模型以安全和受控的方式获取实时的网络信息。

官方
精选