GitHub Integration
DjinnBot integrates with GitHub for repository management, pull requests, and webhook-triggered automation.
MCP GitHub Tools
The default MCP configuration includes a GitHub tool server that gives agents read access to repositories, issues, and context:
{
"github": {
"command": "/usr/local/bin/github-mcp-server",
"args": ["stdio", "--read-only", "--toolsets", "context,repos,issues"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
}
}
}Set GITHUB_TOKEN in your .env to enable this.
Agent Git Workflow
Pipeline Sessions
During pipeline runs, agents work in git worktrees:
- The engine creates a worktree from the project’s repository
- The agent receives the workspace path via
$WORKSPACE_PATH - The agent reads, modifies, and creates files
- The engine commits and pushes after each step completes
Pulse Sessions
During autonomous pulse work:
- Agent calls
claim_task(projectId, taskId)— this provisions an authenticated git workspace on branchfeat/{taskId} - Agent works in
/home/agent/task-workspaces/{taskId}/ - Agent commits and pushes directly (credentials are pre-configured)
- Agent calls
open_pull_request(projectId, taskId, title, body)when ready
GitHub App (Optional)
For organization-level access and webhook support, configure a GitHub App:
- Create a GitHub App at
github.com/organizations/{org}/settings/apps/new - Configure permissions:
- Repository: Contents (Read & Write), Issues (Read & Write), Pull Requests (Read & Write)
- Organization: Members (Read)
- Generate a private key and save it as
secrets/github-app.pem - Set environment variables:
GITHUB_APP_ID=123456 GITHUB_APP_CLIENT_ID=Iv1.abc123 GITHUB_APP_WEBHOOK_SECRET=your-webhook-secret GITHUB_APP_NAME=djinnbot
Webhooks
The API server can receive GitHub webhooks at /v1/github/webhooks. Configure your GitHub App or repository webhook to point to:
https://your-djinnbot-host:8000/v1/github/webhooksThis enables triggering pipelines from GitHub events (issues, PRs, etc.).