Configuration
Add the following snippet to your OpenCode config file:
"mcp": {
"github": {
"type": "local",
"command": [
"docker",
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"environment": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "your GitHub token"
}
}
}Two things to note:
- Docker must be installed and running on your machine
- The field name is
environment, notenv
Verifying the connection
First, run:
opencode mcp listA healthy result should include:
github connectedTo make an actual call, drop into opencode and try:
use the github tool and tell me my GitHub loginOr:
use the github tool to list my repositoriesIf the GitHub tools respond normally, the setup is done.