Skip to content

MCP server ignores GOOGLE_WORKSPACE_CLI_ACCOUNT env var #221

@ItsiW

Description

@ItsiW

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions