> For the complete documentation index, see [llms.txt](https://docs.groundcover.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.groundcover.com/use-groundcover/connectors/github.md).

# GitHub

Connect GitHub to let Agent Mode correlate production behavior with code, issues, pull requests, and Actions runs—and take follow-up actions without losing investigation context.

## What You Can Do

**Read and investigate**

> Find recent pull requests that changed the checkout service, inspect their diffs, and identify changes that could explain this latency regression.
>
> Summarize the failing GitHub Actions run for this repository and check whether an open issue or pull request already tracks it.

**Take action**

> Create a GitHub issue for this monitor problem with the impact, relevant telemetry, suspected code path, and a link to the groundcover investigation.
>
> Add the confirmed root cause and reproduction steps to the existing issue, then draft a pull request with the fix for me to review.

The available repositories and actions depend on the connected account, token scopes, and tool restrictions.

## Setup with a Personal Access Token

GitHub uses personal access tokens by default.

1. A workspace admin goes to **Integrations → Connectors → Org Connectors**, selects **GitHub**, and enables it.
2. The admin enters a GitHub personal access token to discover the available tools and reviews the [tool restrictions](/use-groundcover/connectors/mcp.md#managing-tool-restrictions).
3. Each user goes to **Integrations → Connectors → My Connections**, selects **GitHub**, and clicks **Connect**.
4. Enter a personal access token with access to the repositories and operations Agent Mode should use.

## Optional: Switch to OAuth

A workspace admin can switch GitHub to OAuth after creating a GitHub OAuth App:

1. Open [GitHub Developer settings](https://github.com/settings/developers), select **OAuth Apps**, and click **New OAuth App**.
2. Complete the form:
   * **Application name**: Any recognizable name, such as `groundcover`.
   * **Homepage URL**: Any valid URL, such as your top-level groundcover URL (<https://app.groundcover.com> unless you use a custom domain).
   * **Application description**: Optional.
   * **Authorization callback URL**: `https://app.groundcover.com/connectors/mcp/oauth/callback` (replace the base URL if you use a custom domain).
3. Leave **Enable Device Flow** disabled and click **Register application**.
4. Copy the **Client ID** and generate a **Client Secret**.
5. In groundcover, open **Integrations → Connectors → Org Connectors → GitHub** and click **Edit** under **General Information**.
6. Set **Authentication Method** to **OAuth**, enter the Client ID and Client Secret, and click **Save**.
7. Click **Connect** under **Tool Restrictions** and complete authorization.

<div data-with-frame="true"><figure><img src="/files/65HtO0zJZp3i06CRc44q" alt="GitHub form for registering a new OAuth app"><figcaption><p>Set the Homepage URL to your UI domain, the Authorization callback URL to https://app.groundcover.com/connectors/mcp/oauth/callback and leave Device Flow disabled.</p></figcaption></figure></div>

groundcover includes the tenant UUID and backend ID in the OAuth `state` parameter. The callback URL must be set to `https://app.groundcover.com/connectors/mcp/oauth/callback` exactly GitHub will reject the OAuth flow if the registered redirect URI does not match.

New personal connections use OAuth after the switch; existing token connections continue to work. Switching back to **Token** removes the stored OAuth client, but existing OAuth connections continue until they expire and must then reconnect with a token.

{% hint style="info" %}
Agent Mode acts with the connected user's GitHub permissions, subject to groundcover's tool restrictions. Write actions may require approval.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.groundcover.com/use-groundcover/connectors/github.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
