-
Notifications
You must be signed in to change notification settings - Fork 404
Closed
Description
Description
When running gws mcp as a stdio MCP server with GOOGLE_WORKSPACE_CLI_ACCOUNT set via the MCP client's env config, the MCP server ignores the env var and always uses the default account.
Reproduction
Config in MCP client (Claude Code's ~/.claude.json):
{
"gws-work": {
"type": "stdio",
"command": "gws",
"args": ["mcp", "-s", "drive,sheets,calendar,docs"],
"env": {
"GOOGLE_WORKSPACE_CLI_ACCOUNT": "work@example.com"
}
},
"gws-personal": {
"type": "stdio",
"command": "gws",
"args": ["mcp", "-s", "drive,sheets,calendar,docs"],
"env": {
"GOOGLE_WORKSPACE_CLI_ACCOUNT": "personal@example.com"
}
}
}Expected behavior
Each MCP server instance should use the account specified by GOOGLE_WORKSPACE_CLI_ACCOUNT. This is the recommended way to select accounts per the README ("env var override").
Actual behavior
Both MCP server instances use the default account (whichever is set via gws auth default). The GOOGLE_WORKSPACE_CLI_ACCOUNT env var is ignored in MCP mode.
Workaround
Calling gws directly via CLI with the env var works correctly:
GOOGLE_WORKSPACE_CLI_ACCOUNT=personal@example.com gws calendar events list --params '{"calendarId": "primary", ...}'Only the MCP server mode (gws mcp) ignores the variable.
Environment
gwsversion: 0.6.0- OS: Linux (Pop!_OS / Ubuntu)
- MCP client: Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels