This repo helps users set up Google Workspace and Slack MCP servers for Claude Code.
You are a setup assistant. Walk the user through configuring MCP servers for their Google account(s) and optionally Slack. Be concise and direct.
npm install -g @googleworkspace/cliVerify: gws --version (should be 0.7+)
Guide the user to https://console.cloud.google.com/projectcreate
- Project name: something like
gws-mcp(must be globally unique) - Note the project ID — you'll need it
gcloud services enable gmail.googleapis.com drive.googleapis.com calendar-json.googleapis.com sheets.googleapis.com docs.googleapis.com --project=PROJECT_IDGuide user to: https://console.cloud.google.com/apis/credentials/consent?project=PROJECT_ID
- User Type: External (unless Google Workspace admin)
- App name: anything (e.g., "Claude MCP")
- Support email: user's email
- Scopes: skip (scopes are requested at login)
- Test users: Add ALL Google accounts they want to use (critical for unverified apps)
- Save
Guide user to: https://console.cloud.google.com/apis/credentials?project=PROJECT_ID
For EACH Google account:
- Create Credentials → OAuth client ID
- Application type: Desktop app
- Name: descriptive (e.g., "MCP - personal" or "MCP - work")
- Download the JSON → save to
~/.config/gws/client_secret_ACCOUNTNAME.json
CRITICAL: Each Google account MUST have its own OAuth client. Using one client for two accounts causes refresh token invalidation.
For each account:
# Copy this account's client secret into place
cp ~/.config/gws/client_secret_ACCOUNTNAME.json ~/.config/gws/client_secret.json
# Login (browser opens — sign in with the correct Google account)
gws auth login -s drive,gmail,calendar,sheets,docs
# Export credentials
gws auth export --unmasked > ~/.config/gws/ACCOUNTNAME.jsonImportant: When the browser opens, make sure the user signs in with the correct account. The gws CLI opens whichever browser is in the foreground.
cp scripts/gws-token-wrapper.sh ~/.config/gws/gws-token-wrapper.sh
chmod +x ~/.config/gws/gws-token-wrapper.shCreate .mcp.json in the TARGET project root (not this repo — the project where they want to use the MCPs).
CRITICAL: .mcp.json MUST be at the project root. settings.local.json SILENTLY IGNORES mcpServers.
Template for one Google account:
{
"mcpServers": {
"gws-ACCOUNTNAME": {
"command": "HOME_DIR/.config/gws/gws-token-wrapper.sh",
"args": [
"HOME_DIR/.config/gws/ACCOUNTNAME.json",
"-s", "gmail,drive,calendar,sheets,docs"
]
}
}
}Template for two Google accounts + Slack:
{
"mcpServers": {
"gws-personal": {
"command": "HOME_DIR/.config/gws/gws-token-wrapper.sh",
"args": [
"HOME_DIR/.config/gws/personal.json",
"-s", "gmail,drive,calendar,sheets,docs"
]
},
"gws-work": {
"command": "HOME_DIR/.config/gws/gws-token-wrapper.sh",
"args": [
"HOME_DIR/.config/gws/work.json",
"-s", "gmail,drive,calendar,sheets,docs"
]
},
"slack": {
"command": "npx",
"args": ["-y", "slack-mcp-server@latest"],
"env": {
"SLACK_MCP_XOXP_TOKEN": "xoxp-your-token-here"
}
}
}
}Replace HOME_DIR with the actual home directory path (e.g., /Users/username).
Add .mcp.json to .gitignore — it contains tokens.
MCP servers only load at session start. Restart to pick up the new config.
Use ToolSearch to load and test:
# List recent emails
ToolSearch: "select:mcp__gws-ACCOUNTNAME__gmail_users_messages_list"
→ mcp__gws-ACCOUNTNAME__gmail_users_messages_list(params: {"userId": "me", "maxResults": 3})
# Search Drive
ToolSearch: "select:mcp__gws-ACCOUNTNAME__drive_files_list"
→ mcp__gws-ACCOUNTNAME__drive_files_list(params: {"q": "name contains 'test'", "pageSize": 5})
# Slack channels
ToolSearch: "select:mcp__slack__channels_list"
→ mcp__slack__channels_list(channel_types: "public_channel")
- Go to https://api.slack.com/apps → Create New App → From scratch
- Name: "Claude MCP" (or anything)
- Select workspace
OAuth & Permissions → User Token Scopes → Add:
channels:history,channels:readgroups:history,groups:readim:history,im:readmpim:history,mpim:readsearch:readusers:read,users:read.emailusergroups:read
Optional (for posting):
chat:write
OAuth & Permissions → Install to Workspace → Copy the xoxp-... User OAuth Token.
See the Slack entry in the template above. Replace xoxp-your-token-here with the actual token.
Note: Message posting is disabled by default in slack-mcp-server. To enable, add "SLACK_MCP_ADD_MESSAGE_TOOL": "true" to the env section.
- Verify
.mcp.jsonis at the project root (same directory as.git/) - NOT inside
.claude/— that doesn't work - NOT in
settings.local.json— silently ignored
- Check the GCP project has the right APIs enabled
- For multiple accounts: verify
chris@work.comhasroles/serviceusage.serviceUsageConsumeron the GCP project:gcloud projects add-iam-policy-binding PROJECT_ID \ --member="user:work@example.com" \ --role="roles/serviceusage.serviceUsageConsumer"
- Each account MUST use a different OAuth client ID
- Check
~/.config/gws/ACCOUNTNAME.json— theclient_idfields should differ
- Add the account as a test user on the OAuth consent screen
- Go to:
https://console.cloud.google.com/apis/credentials/consent?project=PROJECT_ID - Under "Test users" → Add the email
- This is normal — access tokens are short-lived
- Restart Claude Code to get fresh tokens
- The wrapper script mints a new token each time a session starts
If tokens stop working:
# 1. Swap to the account's OAuth client
cp ~/.config/gws/client_secret_ACCOUNTNAME.json ~/.config/gws/client_secret.json
# 2. Re-login (browser opens)
gws auth login -s drive,gmail,calendar,sheets,docs
# Sign in with the correct Google account
# 3. Re-export
gws auth export --unmasked > ~/.config/gws/ACCOUNTNAME.json
# 4. Restart Claude CodemcpServersinsettings.local.jsonis SILENTLY IGNORED — no error, no log, servers just don't start.mcp.jsonmust be at project root — not inside.claude/- One OAuth client per Google account — same client_id across accounts = token invalidation
- MCP servers start at session launch only — config changes require restart
- Access tokens expire ~1hr — restart for fresh tokens on long sessions
gwsuses single-dash CLI flags —-t stdionot--transport stdio.mcp.jsoncontains tokens — add to.gitignore