接入你的智能体
從發布者安裝。不是 PlugMCP 端點。
遠端 URL 還是本機指令? 兩種安裝方式的差異
MCP server for Google Workspace APIs with per-project safety policies.
Gives AI agents controlled access to Drive, Gmail, Calendar, Sheets, Docs, and other Google services through the Model Context Protocol. A JSON policy file scopes what each project can access — parameter-level constraints, method denylists, and global read-only mode. An interactive wizard and policy templates make setup easy. Audit logs, SIGHUP reload, and human-readable write explanations make it production-ready.
The server auto-detects the client's protocol era and adapts accordingly.
See docs/architecture.md for the full request flow diagram and multi-user deployment pattern.
The policy engine enforces access control at the MCP layer, before any Google API call is made:
messages.delete).The server needs OAuth2 credentials to call Google APIs. Choose one method:
gcloud auth application-default login \
--scopes=https://www.googleapis.com/auth/drive,\
https://www.googleapis.com/auth/gmail.modify,\
https://www.googleapis.com/auth/calendar
This stores credentials at ~/.config/gcloud/application_default_credentials.json.
The server finds them automatically.
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json
# Install gws
cargo install google-workspace-cli
# Authenticate (opens browser)
gws auth login --credentials /path/to/client-credentials.json
# Credentials are stored in the OS keyring
# The MCP server reads them automatically via `gws auth export`
You can also export credentials to a file and reference it in the policy:
gws auth export --unmasked > /path/to/credentials.json
{
"server": {
"credentials_file": "/path/to/credentials.json"
}
}
The server checks these locations in order:
GOOGLE_WORKSPACE_CLI_TOKEN env var (raw access token)credentials_file from policy JSON server objectGOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE env var~/.config/gws/credentials.jsongws auth export --unmasked (reads from OS keyring)GOOGLE_APPLICATION_CREDENTIALS env var~/.config/gcloud/application_default_credentials.jsonpodman run -p 3000:3000 \
-v ./gws-policy.json:/etc/mcp-google-workspace/policy.json:ro \
-v ./credentials.json:/secrets/credentials.json:ro \
-e GOOGLE_APPLICATION_CREDENTIALS=/secrets/credentials.json \
ghcr.io/fabiendupont/mcp-google-workspace:latest
cargo build --release
./target/release/mcp-google-workspace --policy gws-policy.json
./target/release/mcp-google-workspace --policy gws-policy.json --http 127.0.0.1:3000
Use a template for quick setup:
mcp-google-workspace init --template assistant > gws-policy.json
Available templates: analyst, assistant, admin-readonly, content-writer, it-admin.
Use mcp-google-workspace init --template list to see descriptions.
Or run the interactive wizard:
mcp-google-workspace init
See policy.example.json for a full example with constraints.
{
"server": { "read_only": false },
"services": [
{
"name": "drive",
"constraints": [
{ "param": "parents", "values": ["folder-id"], "access": "read-write", "location": "body" }
]
},
{
"name": "gmail",
"denied_methods": ["messages.delete", "messages.trash",
"settings.updateAutoForwarding", "settings.delegates.create"]
},
{
"name": "calendar",
"constraints": [
{ "param": "calendarId", "values": ["primary"], "access": "read-write" }
]
}
]
}
Validate before deploying:
mcp-google-workspace --check-policy gws-policy.json
Add to .claude/settings.json:
{
"mcpServers": {
"google-workspace": {
"command": "/path/to/mcp-google-workspace",
"args": ["--policy", "/path/to/gws-policy.json"]
}
}
}
Manifests are in deploy/kubernetes/. Deploy with:
# Create the credentials secret first
kubectl create secret generic mcp-gws-credentials \
--from-file=credentials.json=./your-credentials.json \
-n mcp-google-workspace
# Deploy
kubectl apply -k deploy/kubernetes/
Each user gets their own deployment with their own credentials Secret and policy ConfigMap. See docs/architecture.md for the multi-user deployment pattern.
tracing (stderr, RUST_LOG for filtering)OTEL_EXPORTER_OTLP_ENDPOINT)/metrics (request count, latency, errors, active tasks)The server is discovery-driven: it fetches Google Discovery Documents at runtime to learn each API's resources, methods, and parameters. No hardcoded API list — new endpoints appear automatically.
Each enabled Google service is exposed as a single MCP tool. The agent specifies
resource and method as arguments:
{
"name": "drive",
"arguments": {
"resource": "files",
"method": "list",
"params": { "q": "mimeType='application/pdf'", "fields": "files(id,name)" }
}
}
A gws_discover meta-tool lets the agent introspect available resources,
methods, and parameter schemas before making calls.
Apache-2.0
MCP server for Google Workspace — 53 tools for Drive, Docs, Sheets, Slides, Gmail. JSON policy engine, label-scoped access, lazy discovery. Rust.
工具
尚無工具清單。遠端伺服器會在首次健康檢查後取得工具清單。
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
MCP Google Workspace 透過 stdio 在本機執行。
上次檢查時間:2026-10-28。 MCP server for Google Workspace — 53 tools for Drive, Docs, Sheets, Slides, Gmail. JSON policy engine, label-scoped access, lazy discovery. Rust.