Skip to content

Two GitHub accounts

The plugin gives each github.com alias its own GitHub MCP server and its own credential. Configure the aliases, sign in each one, and each alias's tools reach only that account.

Configure the aliases

Add one empty profile for each alias in opencode.json:

{ "accounts": { "work": {}, "personal": {} } }

default is the alias with no name and needs no entry. An alias is a lowercase word. work becomes the MCP server github-work, personal becomes github-personal, and default stays github.

Sign in each alias

Run /connect once per alias: choose GitHub (work) for work, GitHub (personal) for personal, and GitHub for default. GitHub's hosted MCP server holds each alias's OAuth credential, and OpenCode keys it per server. A token pasted for one alias is never used for another.

Name the account on a call

api, events_list, issues and probe take account: "<alias>":

await tools.github.api({
  account: "work",
  method: "GET",
  path: "/repos/we-the-rebel-alliance/github-plugin/issues",
  query: { state: "open" },
})

With two aliases and no account, the call is refused with ACCOUNT_REQUIRED. An alias the plugin does not serve is ACCOUNT_UNKNOWN. status lists every alias and its state.

Name the alias in the tool

The pass-through MCP tools take no account, because the alias is in the tool name:

Alias MCP server Tool name
default github github_<tool>
work github-work github-work_<tool>
personal github-personal github-personal_<tool>

The plugin generates one access rule per alias, so a rule or grant for github-work_* cannot reach github-personal_*. A person's own rule for one tool still wins.

Keep cursors apart

A cursor belongs to the account and the sign-in that issued it. One issued for work is refused for personal with CURSOR_INVALID, and so is a cursor issued before the alias was signed in to another GitHub login. Keep one cursor per alias in an automation's state.

An Enterprise Server beside github.com

A profile with host names a GitHub Enterprise Server:

{ "accounts": { "work": {}, "enterprise": { "host": "github.example.com" } } }

GitHub does not host an MCP server for an Enterprise Server, so that alias gets an integration of its own under the same name, with the same two sign-in methods, and api is its tool. No pass-through MCP tools exist for it.