Skip to content

Kiro + GitHub MCP

The GitHub MCP server gives Kiro direct access to GitHub — issues, pull requests, repository content, comments, and more. Instead of copy-pasting issue descriptions into the chat, you can reference them by number and Kiro reads them live.

  • “Fix the bug described in issue #42”
  • “Implement the feature requested in issue #87, following the existing code patterns”
  • “Review this code against the acceptance criteria in PR #15”
  • “List all open issues labelled ‘bug’ and prioritise them”
  • “Read the README of org/repo and explain the project structure”
  • “What changed in the last 5 commits on the main branch?”

  • GitHub account
  • Personal Access Token (PAT) with appropriate scopes

Creating a token:

  1. GitHub → Settings → Developer Settings → Personal Access Tokens → Fine-grained tokens
  2. Select repositories to grant access to
  3. Permissions needed (minimum):
    • Issues: Read
    • Pull requests: Read
    • Contents: Read (for reading file content and commits)
    • Metadata: Read (always required)

Terminal window
# No pre-install needed — npx handles it
# Or install globally
npm install -g @modelcontextprotocol/server-github

Add to .kiro/mcp.json:

{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}

Set the token in your environment:

Terminal window
# Linux/macOS
export GITHUB_TOKEN="github_pat_your_token_here"
# Windows PowerShell
$env:GITHUB_TOKEN = "github_pat_your_token_here"

CapabilityDescription
Read issueTitle, body, labels, assignees, comments
List issuesFilter by label, state, assignee, milestone
Read PRDescription, changed files, review comments
List PRsOpen/closed, by branch, by author
Read fileContents of any file in any branch
List commitsCommit history with messages and diffs
Search codeSearch across repositories
Read repositoryREADME, topics, description

Fix a bug from an issue:

User: Fix issue #42
Kiro:
1. Fetches issue #42 — "NullReferenceException in OrderService.ProcessRefund when order has no items"
2. Reads the stack trace and reproduction steps from the issue
3. Locates the relevant code in your project
4. Implements the fix
5. Writes a regression test matching the reproduction steps

Feature from an issue with design discussion:

User: Implement #87 — be sure to follow the approach agreed in the comments
Kiro:
1. Reads issue #87 body
2. Reads all comments (including the agreed approach in comment #5)
3. Generates spec that follows the agreed design
4. Implements accordingly

Cross-repo context:

User: The shared library repo is MyOrg/shared-lib. Read how ErrorHandler is implemented there and use the same pattern here.
Kiro:
1. Fetches src/ErrorHandler.cs from MyOrg/shared-lib on GitHub
2. Understands the pattern
3. Applies it to the current project

With read access to workflows, Kiro can:

  • Read your CI workflow files and debug failing pipeline logic
  • Generate new workflow files consistent with your existing CI setup
  • Explain what a workflow step does
User: My GitHub Actions workflow is failing on the deploy step. Read .github/workflows/deploy.yml and explain what's wrong.

  • Use fine-grained tokens scoped to specific repositories rather than classic tokens with broad access
  • Set an expiry date on the token (90 days is a reasonable default)
  • The MCP server is read-only — it cannot create issues, push code, or merge PRs unless you grant write permissions (not recommended for normal use)
  • Never commit the token to .kiro/mcp.json — always use ${ENV_VAR} references