Skip to content

GitHub

GitHub organizes code and collaboration around:

  • Repositories - Code projects with version control
  • Issues - Bug reports, feature requests, tasks
  • Pull Requests - Code changes for review and merge
  • Actions - CI/CD workflows
  • Branches (main/master is default)
  • Commits and commit history
  • Tags and releases
  • Can be assigned, labeled, milestoned
  • Support markdown formatting
  • Have a state: open or closed
  • Repos can belong to users or organizations
  • Teams provide access control within orgs

There are three ways to access GitHub from Craft Agents, listed from simplest to most complex. Most users should use Tier 1.


The gh CLI is the simplest and most reliable way to work with GitHub:

  • Zero configuration — works out of the box after gh auth login
  • Full API coveragegh issue list, gh pr view, gh repo clone, gh api repos/{owner}/{repo}/...
  • No tokens to manage — authentication is handled by gh auth
  • Always up to date — no dependency on third-party MCP wrappers

Quick check:

Terminal window
gh --version # Is it installed?
gh auth status # Is it authenticated?

If both pass, you’re done — just use gh commands directly. No source creation needed.

If gh is not installed: install it from cli.github.com, then run gh auth login.


Tier 2 — MCP Source with Personal Access Token (stdio)

Section titled “Tier 2 — MCP Source with Personal Access Token (stdio)”

For users who want structured MCP tool calls instead of raw CLI output, you can set up GitHub as an MCP source using a Personal Access Token (PAT).

Step 1: Create a PAT at GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens. Grant repo access (and optionally read:org).

Step 2: Use this config.json:

{
"name": "GitHub",
"slug": "github",
"enabled": true,
"provider": "github",
"type": "mcp",
"tagline": "GitHub via MCP (stdio)",
"mcp": {
"transport": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<your-pat-here>"
},
"authType": "none"
}
}

Step 3: Use source_credential_prompt to securely collect the PAT from the user instead of hardcoding it.


If you have your own GitHub OAuth App (Settings → Developer settings → OAuth Apps), you can configure GitHub as an API source with automatic OAuth:

{
"name": "GitHub",
"slug": "github",
"enabled": true,
"provider": "github",
"type": "api",
"tagline": "GitHub REST API via OAuth",
"api": {
"baseUrl": "https://api.github.com/",
"authType": "oauth",
"oauth": {
"authorizationUrl": "https://github.com/login/oauth/authorize",
"tokenUrl": "https://github.com/login/oauth/access_token",
"clientId": "<your-oauth-app-client-id>",
"clientSecret": "<your-oauth-app-client-secret>",
"scopes": ["repo", "read:user", "read:org"]
},
"testEndpoint": {
"method": "GET",
"path": "user"
}
}
}

Set your OAuth App’s callback URL to http://localhost:8914/callback.


  • 5000 requests per hour for authenticated users
  • Search API has separate lower limits