Skip to Content

GitHub Connector

One GitHub connection syncs repositories into Knowledge and gives agents GitHub’s own MCP serverΒ  as a tool. When connecting, members choose Let agents use GitHub (on by default) and Sync into Knowledge with a repository to sync.

  • Knowledge. Each synced repository is one source, read with the connection’s token and synced on the chosen schedule.
  • Tools. By default agents use the read-only endpoint https://api.githubcopilot.com/mcp/readonly. Also let agents make changes (issues, comments, pull requests) is off by default; see Letting agents make changes.

Members connect this service from Settings > Connectors. See Connectors for the full GitHub setup.

Connect with a personal access token

Always available, with no admin setup. Create a fine-grained personal access tokenΒ  for the repositories DocsGPT should read, with Contents set to Read-only. Add read-only Issues and Pull requests if agents should read those through the tools. Paste the token when you pick GitHub in Settings > Connectors.

Sign in with GitHub (optional, a GitHub App)

An admin can register a GitHub App so members can Sign in with GitHub and choose repositories when they install the app. Register the app with the redirect URI from Admin > Connectors as its callback URL, create a client secret, then set:

GITHUB_CLIENT_ID=Iv23li... # the app's Client ID GITHUB_CLIENT_SECRET=your-client-secret GITHUB_APP_SLUG=docsgpt-acme # from the app's public link, github.com/apps/<slug>

Restart the API and the worker. The app’s permissions and installation options are listed in Sign in with GitHub.

Rate limits

GitHub allows about 5,000 API requests an hour per GitHub account, and that limit covers every token the account owns. DocsGPT downloads a repository as one archive, so a sync costs a few requests whatever the repository’s size. It falls back to one request per file only when the archive is unavailable or larger than GITHUB_INGEST_MAX_ARCHIVE_BYTES (512 MiB by default). Repositories added from one connection download one after another.

If GitHub rate-limits the account anyway, the sync fails instead of skipping files. Its error, and the connect screen, show the time the limit resets. Try again after that time.

Public repositories

The GitHub tile in Add knowledge ingests a public repository from its URL without a connection. GITHUB_ACCESS_TOKEN, if set, only raises GitHub’s rate limit there. For a private repository, use a GitHub connection.

Last updated on