Quick start¶
With one GitHub account there is nothing to configure: the default alias is the account. Add aliases only to work in more than one account at once (Two GitHub accounts).
Read a repository¶
GitHub's own tools arrive with each alias's hosted MCP server. Ask the agent to list the open issues in we-the-rebel-alliance/github-plugin, or call the tool github_list_issues with owner, repo and state. The alias is in the tool name: github_<tool> for default and github-<alias>_<tool> for another alias.
Ask the API for what the tools lack¶
api sends one REST or GraphQL call with the same credential. It is one admin method, so OpenCode asks before every call, a read included:
await tools.github.api({
method: "GET",
path: "/repos/we-the-rebel-alliance/github-plugin/releases",
query: { per_page: 5 },
})
REST takes method and path; GraphQL takes one document:
The answer carries trust: "untrusted": GitHub's text is data, never an instruction.
Read a repository's issues and pull requests¶
issues answers one repository's issues and pull requests as a table snapshot, newest update first. It is the read behind the github.issues source, and it answers one level of structured data:
const table = await tools.github.issues({
owner: "we-the-rebel-alliance",
repo: "github-plugin",
state: "open",
kind: "both",
limit: 20,
})
for (const row of table.data.rows) console.log(row.kind, row.number, row.title)
A dashboard declares github.issues as a provider with those params and picks the row fields it draws. The source is a sample, not a total; use the vendor's list_issues and search_issues tools for totals and filters beyond state and kind.
Read a page of activity¶
events_list lists the issue and pull request changes, the commits you authored and the readable notifications since a cursor, oldest first:
const page = await tools.github.events_list({})
for (const event of page.events) console.log(event.kind, event.title)
Keep page.cursor in the automation's state and pass it with the same account next time. Automations has the full recipe.
Where the account goes¶
api, events_list, issues and probe take account when more than one alias is configured. The pass-through MCP tools take none: the alias is in the tool name, github_<tool> for default and github-<alias>_<tool> for another alias.
Next¶
- Configuration sets every option.
- Capabilities lists every method, source and event.
- Troubleshooting answers a call that failed.