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
gws version: 0.6.0
- OS: Linux (Pop!_OS / Ubuntu)
- MCP client: Claude Code
Description
When running
gws mcpas a stdio MCP server withGOOGLE_WORKSPACE_CLI_ACCOUNTset via the MCP client'senvconfig, 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). TheGOOGLE_WORKSPACE_CLI_ACCOUNTenv var is ignored in MCP mode.Workaround
Calling
gwsdirectly 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