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

# GitHub

The GitHub connector gives the Notara agent read access to your repositories and the ability to create issues and pull requests. Useful for engineering teams that want the agent to navigate code, reference PRs, and file issues without leaving Slack.

## What It Enables

| Tool                   | Capability | Description                                 |
| ---------------------- | ---------- | ------------------------------------------- |
| `github_list_repos`    | `read`     | List repositories in an org or user account |
| `github_get_repo`      | `read`     | Get repo details, description, topics       |
| `github_search_code`   | `read`     | Full-text search across code in your org    |
| `github_list_prs`      | `read`     | List open or recently merged PRs            |
| `github_get_pr`        | `read`     | Get PR details, diff summary, review status |
| `github_list_issues`   | `read`     | List open issues with filters               |
| `github_get_issue`     | `read`     | Get a specific issue by number              |
| `github_search_issues` | `read`     | Full-text search across issues and PRs      |
| `github_create_issue`  | `write`    | Open a new issue                            |
| `github_create_pr`     | `write`    | Open a new pull request                     |
| `github_add_comment`   | `write`    | Add a comment to an issue or PR             |

## Setup

### Option A: Personal Access Token (Recommended for most teams)

1. Go to **GitHub → Settings → Developer Settings → Personal Access Tokens → Tokens (classic)**.
2. Click **Generate new token (classic)**.
3. Give it a descriptive name (e.g., "Notara agent").
4. Select these scopes:
   * `repo` — full repository access (read + write for issues/PRs)
   * `read:org` — list organization repositories
   * `read:user` — resolve user info
5. Click **Generate token** and copy it.
6. In the Notara dashboard, go to **Tools → GitHub**, paste the token, and click **Verify & Save**.

### Option B: Fine-Grained Personal Access Token

If you prefer more granular control:

1. Go to **GitHub → Settings → Developer Settings → Personal Access Tokens → Fine-grained tokens**.
2. Set **Repository access** to the repos you want Notara to access.
3. Grant these permissions:
   * **Contents**: Read-only (for code search)
   * **Issues**: Read and write
   * **Pull requests**: Read and write
   * **Metadata**: Read-only (required)
4. Generate, copy, and paste into Notara as above.

## Usage Examples

**Find a PR:**

```
@Notara Find the PR that introduced the rate limiting middleware.
```

**Review open issues:**

```
@Notara List all open bugs in the acme-api repo from the last week.
```

**Search code:**

```
@Notara Search the codebase for where we handle Stripe webhook validation.
```

**Create an issue from a conversation:**

```
@Notara The login flow has a race condition when two tabs submit simultaneously. 
Create a GitHub issue with steps to reproduce.
```

## Permissions

Write tools (`github_create_issue`, `github_create_pr`, `github_add_comment`) require approval by default. This prevents the agent from filing issues or PRs without a human explicitly authorizing it.

For engineering channels where this is low-risk, you can lower the permission level to `open` for specific write tools via the per-channel permission overrides in **Settings → Permissions**.

## Using with Claude Code via MCP

When you connect Claude Code to your Notara MCP endpoint and have the GitHub connector active, Claude Code can search your repos directly from the IDE without needing a separate GitHub tool. This is particularly useful for:

* Searching for prior art before implementing something
* Looking up open issues related to a file you're editing
* Creating an issue when you spot a bug during a code review

The governance and approval flows still apply — Claude Code submitting `github_create_issue` triggers the same approval request as a Slack user doing so.


---

# 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://notara.gitbook.io/notara-docs/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.
