Skip to main content

Overview

Mission Control’s GitHub integration enables seamless synchronization between GitHub Issues and Mission Control tasks. Import issues as tasks, post comments, and close issues directly from Mission Control.
Requires GITHUB_TOKEN environment variable with repo scope.

Setup

1

Generate GitHub Token

Create a Personal Access Token (classic) with repo scope:
  1. Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
  2. Click “Generate new token (classic)”
  3. Select scopes:
    • repo (Full control of private repositories)
  4. Copy the generated token
Store the token securely. GitHub only shows it once.
2

Configure Environment Variable

Add to your Mission Control .env file:
Optionally set a default repository:
3

Restart Mission Control

Sync GitHub Issues to Tasks

Preview Issues

Fetch issues from a repository without importing:
Query Parameters:
string
required
Must be issues for preview or stats for repository statistics
string
required
Repository in owner/repo format (overrides GITHUB_DEFAULT_REPO)
string
default:"open"
Issue state: open, closed, or all
string
Comma-separated label filter (e.g., bug,enhancement)
Response:

Import Issues as Tasks

string
required
Must be sync
string
required
Repository in owner/repo format
string
default:"open"
Issue state to sync: open, closed, or all
string
Comma-separated label filter
string
Automatically assign imported tasks to this agent
Response:
Sync Behavior:
  • Duplicate Prevention: Issues already imported (matching github_repo + github_issue_number) are skipped
  • Status Mapping: openinbox, closeddone
  • Priority Mapping: Extracted from labels (see below)
  • Tags: All GitHub labels are imported as task tags

Label to Priority Mapping

Mission Control automatically maps GitHub labels to task priorities:
Add priority labels to your GitHub issues for better task organization:
  • priority:critical - Production outages, security issues
  • priority:high - Blocking bugs, urgent features
  • priority:medium - Standard work
  • priority:low - Nice-to-have improvements

Post Comments to Issues

Send a comment to a GitHub issue:
string
required
Must be comment
string
required
Repository in owner/repo format
number
required
GitHub issue number
string
required
Comment text (Markdown supported)
Response:

Close GitHub Issues

Close an issue (optionally with a final comment):
string
required
Must be close
string
required
Repository in owner/repo format
number
required
GitHub issue number to close
string
Optional closing comment (posted before closing)
Response:
Behavior:
  • Posts comment (if provided)
  • Closes the GitHub issue
  • Updates linked Mission Control task metadata: github_stateclosed

Sync History

Retrieve recent sync operations:
Response:

GitHub Stats

Fetch authenticated user profile and repository statistics:
Response:
Stats endpoint filters out inactive forks (forks where you’ve never pushed commits).

Automation Examples

Daily Issue Sync (Cron)

Sync high-priority bugs daily:
Add to crontab:

Auto-comment on Task Assignment

When an agent is assigned to a GitHub-linked task, post a comment:

Close Issue When Task Completes

Automatically close GitHub issues when tasks are marked done:

API Rate Limits

GitHub API rate limits:
  • Authenticated: 5,000 requests/hour
  • Search API: 30 requests/minute
Mission Control includes:
  • 15-second timeout per request
  • Exponential backoff on errors
  • Automatic retry on rate limit (429)
Batch sync operations count as multiple API calls (1 per issue). Plan accordingly.

Troubleshooting

Error: {"error": "GITHUB_TOKEN not configured"}Solution:
  1. Verify .env file contains GITHUB_TOKEN=ghp_...
  2. Restart Mission Control
  3. Check token has repo scope in GitHub settings
Cause: Token lacks permissions or repository is private.Solution:
  • For private repos: Token needs repo scope (not just public_repo)
  • Verify token owner has access to the repository
  • Check repository name format: owner/repo (not URL)
Cause: GitHub labels don’t match expected format.Solution: Add labels to your GitHub repo:
  • priority:critical → critical
  • priority:high → high
  • priority:low → low
Alternatively, edit mapPriority() function in /src/app/api/github/route.ts.
Cause: Task metadata doesn’t match expected schema.Solution: Mission Control prevents duplicates by checking:
Ensure tasks have this metadata structure. Re-import will skip existing tasks.

Security Best Practices

Rotate Tokens

Rotate GitHub tokens every 90 days:
  1. Generate new token
  2. Update GITHUB_TOKEN
  3. Restart Mission Control
  4. Revoke old token

Scope Principle

Use minimum required scopes:
  • Read-only sync: repo (read)
  • Comment/close: repo (write)
  • Never use admin:org unless necessary

Webhook Security

If receiving GitHub webhooks:
  • Verify X-Hub-Signature-256 header
  • Use webhook secrets
  • Validate payload structure

Token Storage

Never commit tokens:
  • Use .env files (gitignored)
  • Or environment variables
  • Or secrets management (Vault, AWS Secrets Manager)

Webhooks

Receive events when tasks change

Tasks API

Programmatic task management

CLI Integration

Connect agents directly