Skip to content

feat: add GOOGLE_MCP_PROFILE for multi-account token storage#64

Merged
a-bonus merged 2 commits intoa-bonus:mainfrom
a-pedraza:main
Feb 23, 2026
Merged

feat: add GOOGLE_MCP_PROFILE for multi-account token storage#64
a-bonus merged 2 commits intoa-bonus:mainfrom
a-pedraza:main

Conversation

@a-pedraza
Copy link
Copy Markdown

Closes #63

Summary

Adds support for a GOOGLE_MCP_PROFILE environment variable that stores OAuth tokens in profile-specific subdirectories, enabling multiple Google accounts across different projects.

Change

A two-line addition to getConfigDir() in src/auth.ts:

const profile = process.env.GOOGLE_MCP_PROFILE;
return profile ? path.join(baseDir, profile) : baseDir;

Token storage with profiles

~/.config/google-docs-mcp/
├── token.json                # default (no profile)
├── work/token.json           # GOOGLE_MCP_PROFILE=work
├── personal/token.json       # GOOGLE_MCP_PROFILE=personal

Usage

{
  "mcpServers": {
    "google-docs": {
      "env": {
        "GOOGLE_CLIENT_ID": "...",
        "GOOGLE_CLIENT_SECRET": "...",
        "GOOGLE_MCP_PROFILE": "work"
      }
    }
  }
}

Backward compatible

Without GOOGLE_MCP_PROFILE set, behavior is unchanged — tokens are stored in the default location.

Test plan

  • Existing tests pass (107/107)
  • Prettier formatting check passes
  • Verified: with profile set, token is stored in subdirectory
  • Verified: without profile set, falls back to default path

Andres Pedraza added 2 commits February 22, 2026 13:24
When the GOOGLE_MCP_PROFILE env var is set, tokens are stored in a
profile-specific subdirectory (e.g. ~/.config/google-docs-mcp/hoffman/).
This allows using different Google accounts per project.
Without the env var, behavior is unchanged (backward-compatible).
Document the multiple Google accounts feature with usage example,
config snippet, and token storage layout.
@a-bonus a-bonus merged commit fda15ea into a-bonus:main Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Support multiple Google accounts via GOOGLE_MCP_PROFILE env var

2 participants