-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Open
Labels
Description
Problem
When working across multiple GitHub accounts or organizations (e.g., personal repos + work org), users currently need to either:
- Run multiple MCP server instances with different tokens (leads to duplicate toolsets)
- Manually switch tokens when context changes
- Use a single token that may not have access to all repos they work with
This creates friction for developers who contribute to both personal projects and organization repositories.
Proposed Solution
Add support for automatic token selection based on the owner parameter in API calls.
Configuration
{
"accounts": {
"MagnetForensics": "ghp_org_token...",
"coconutbird": "ghp_personal_token...",
"*": "ghp_default_fallback..."
}
}Or via environment variables:
GITHUB_ACCOUNT_MAGNETFORENSICS=ghp_org_token...
GITHUB_ACCOUNT_COCONUTBIRD=ghp_personal_token...
GITHUB_PERSONAL_ACCESS_TOKEN=ghp_default_fallback... # fallbackBehavior
- When a tool is called with
owner: "MagnetForensics", use the mapped token - When a tool is called with
owner: "coconutbird", use that token - Fall back to default/
*token for unmapped owners - For tools without an
ownerparam (e.g.,list_notifications), use the default token
Use Cases
- Work + Personal - Developer uses personal GitHub for side projects, org account for work
- Multiple orgs - Contractor working across several client organizations
- Bot accounts - Using a bot token for CI-related operations, personal token for reviews
- Scoped permissions - Read-only token for some orgs, full access for others
Alternatives Considered
- Running multiple server instances (works but duplicates all tools)
- Manual token switching (poor UX)
- GitHub App (more complex setup, not always feasible)
Reactions are currently unavailable