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
Generate GitHub Token
Create a Personal Access Token (classic) with
repo scope:- Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click “Generate new token (classic)”
- Select scopes:
- ✅
repo(Full control of private repositories)
- ✅
- Copy the generated token
Configure Environment Variable
Add to your Mission Control Optionally set a default repository:
.env file:Sync GitHub Issues to Tasks
Preview Issues
Fetch issues from a repository without importing:Must be
issues for preview or stats for repository statisticsRepository in
owner/repo format (overrides GITHUB_DEFAULT_REPO)Issue state:
open, closed, or allComma-separated label filter (e.g.,
bug,enhancement)Import Issues as Tasks
Must be
syncRepository in
owner/repo formatIssue state to sync:
open, closed, or allComma-separated label filter
Automatically assign imported tasks to this agent
- Duplicate Prevention: Issues already imported (matching
github_repo+github_issue_number) are skipped - Status Mapping:
open→inbox,closed→done - 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:| GitHub Label | Task Priority |
|---|---|
priority:critical, critical | critical |
priority:high, high | high |
priority:medium | medium |
priority:low, low | low |
| (no match) | medium |
Post Comments to Issues
Send a comment to a GitHub issue:Must be
commentRepository in
owner/repo formatGitHub issue number
Comment text (Markdown supported)
Close GitHub Issues
Close an issue (optionally with a final comment):Must be
closeRepository in
owner/repo formatGitHub issue number to close
Optional closing comment (posted before closing)
- Posts
comment(if provided) - Closes the GitHub issue
- Updates linked Mission Control task metadata:
github_state→closed
Sync History
Retrieve recent sync operations:GitHub Stats
Fetch authenticated user profile and repository statistics:Stats endpoint filters out inactive forks (forks where you’ve never pushed commits).
Automation Examples
Daily Issue Sync (Cron)
Sync high-priority bugs daily: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 markeddone:
API Rate Limits
GitHub API rate limits:- Authenticated: 5,000 requests/hour
- Search API: 30 requests/minute
- 15-second timeout per request
- Exponential backoff on errors
- Automatic retry on rate limit (429)
Troubleshooting
GITHUB_TOKEN not configured
GITHUB_TOKEN not configured
Error:
{"error": "GITHUB_TOKEN not configured"}Solution:- Verify
.envfile containsGITHUB_TOKEN=ghp_... - Restart Mission Control
- Check token has
reposcope in GitHub settings
GitHub API error 403: Resource not accessible
GitHub API error 403: Resource not accessible
Cause: Token lacks permissions or repository is private.Solution:
- For private repos: Token needs
reposcope (not justpublic_repo) - Verify token owner has access to the repository
- Check repository name format:
owner/repo(not URL)
Issues imported but priority is always 'medium'
Issues imported but priority is always 'medium'
Cause: GitHub labels don’t match expected format.Solution: Add labels to your GitHub repo:
priority:critical→ criticalpriority:high→ highpriority:low→ low
mapPriority() function in /src/app/api/github/route.ts.Duplicate tasks created on re-sync
Duplicate tasks created on re-sync
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:
- Generate new token
- Update
GITHUB_TOKEN - Restart Mission Control
- Revoke old token
Scope Principle
Use minimum required scopes:
- Read-only sync:
repo(read) - Comment/close:
repo(write) - Never use
admin:orgunless necessary
Webhook Security
If receiving GitHub webhooks:
- Verify
X-Hub-Signature-256header - Use webhook secrets
- Validate payload structure
Token Storage
Never commit tokens:
- Use
.envfiles (gitignored) - Or environment variables
- Or secrets management (Vault, AWS Secrets Manager)
Related Docs
Webhooks
Receive events when tasks change
Tasks API
Programmatic task management
CLI Integration
Connect agents directly