Skip to main content
Context7 can clone and index repositories from any self-managed Git host that isn’t GitHub or GitLab, such as Gerrit, Gitea, or self-hosted Bitbucket, over HTTPS or SSH. Under Settings → Integrations → Other Git, enter the repository host, choose HTTPS or SSH, and then add repositories with their normal clone URL. The host is shared by both authentication methods and also selects which repositories use the review publishing settings. If you use Gerrit, see the Gerrit integration guide to submit generated code documentation through refs/for/{branch}.
These hosts have no GitHub-style webhooks. Drive re-indexing on merge from your CI, for example Jenkins, by calling POST /api/projects/<id>/refresh after a push. Use POST /api/gitops/reconcile when your GitOps manifest changes.

HTTPS (basic auth)

Enter the host, select HTTPS, and fill in the account credentials:
Other Git HTTPS settings: host, username, and HTTP password under Settings, Integrations
Then add a repository with its HTTPS clone URL, for example https://gerrit.your-company.com/a/platform/sdk.
Presenting a private or self-signed TLS certificate? Point NODE_EXTRA_CA_CERTS at your CA bundle (recommended), or set GIT_TLS_INSECURE=true for testing only. Always use https:// for credentialed clones. A plaintext http:// host to a non-loopback address is logged as a warning.

SSH (deploy key)

When a repository is added with an ssh:// URL, for example ssh://<user>@gerrit.your-company.com:29418/platform/sdk, Context7 authenticates with a deploy key. Enter the repository host, select SSH, and register the key’s public half on a service account in your Git host that can read the repositories you want to index. Then give Context7 the private half one of two ways. On the SSH tab, paste the private key. It is stored encrypted and used for all ssh:// clones. Optionally paste a known_hosts entry to pin the host key; if you leave it blank, the host key is trusted on first use.
Other Git SSH settings: private key and known hosts under Settings, Integrations
Generate the known_hosts entry with ssh-keyscan, for example:
That’s all you need. Add repositories with their ssh:// URL and they clone with the pasted key.

Mount a key into the container (alternative)

If you prefer the private key never touch the application (it is never written to the database or included in backups), mount it into the container instead and point Git at it with GIT_SSH_COMMAND. Leave the UI SSH key blank, and a mounted key is used whenever no key is configured in the UI.
The on-premise image ships with an SSH client, so no extra packages are needed either way.

Add a repository

Once the host is configured, add repositories the same as any other source:
1

Open Add Repository

From Add Repository, choose the Other Git source.
2

Paste the clone URL

Enter the repository’s clone URL. The scheme selects how it authenticates:
  • HTTPS: https://gerrit.your-company.com/a/platform/sdk (uses the HTTPS credentials above).
  • SSH: ssh://<user>@gerrit.your-company.com:29418/platform/sdk (uses the deploy key).
3

Parse

Context7 clones, indexes the documentation, and serves it over MCP. Re-index later with the project’s Refresh action or from CI. See GitOps.
You can also declare these repositories in a GitOps manifest to manage the whole index as code.