← All integrations

GitHub AI agent integration

Anlyon's GitHub integration gives an AI agent named GitHub actions to call through Anlyon's API: it can triage issues, review pull requests and read code. Each of your users signs in to GitHub on GitHub's own consent page, and your company's account connects the same way. The sign-in runs through your own OAuth app. Your agent calls each action by name and never holds the token.

Let an agent triage issues, review pull requests and read code without a token in its prompt. You create a token limited to the repositories it should touch, and Anlyon holds it. Closing an issue, approving a review or merging can wait for a person.

This page covers Anlyon's own GitHub integration, while GitHub's official MCP server and how to add it to a client are on the GitHub MCP server page.

GitHubsecret · GITHUB
host
api.github.com
connect
Sign in, per user
  • Create issue

    github-create-issue

  • Comment on issue

    github-comment-on-issue

  • Close issue

    github-close-issue

  • Reopen issue

    github-reopen-issue

writes are off until switched on

What can an AI agent do in GitHub? Writes are off until you switch them on.

Each one is a named operation from the pack. Reads change nothing.

Writes

  • Create issue

    read back

    github-create-issue

    Open one issue in a repository.

  • Comment on issue

    read back

    github-comment-on-issue

    Add one comment to an issue or a pull request conversation.

  • Close issue

    read back

    github-close-issue

    Close one issue.

  • Reopen issue

    read back

    github-reopen-issue

    Reopen one closed issue.

  • Update issue

    read back

    github-update-issue

    Change one issue: any of title, body, state (with a state reason), milestone number, and the full lists of labels and assignees, which replace the current ones (an empty list clears them). Fields left out are not changed.

  • Add labels

    read back

    github-add-labels

    Add one or more labels to an issue or pull request, keeping the labels it already has; a name that does not exist yet is created in the repository. Returns every label now on the issue.

  • Remove label

    read back

    github-remove-label

    Remove one label from an issue or pull request. Returns the labels left on it; GitHub answers 404 when the issue does not have that label.

  • Add assignees

    read back

    github-add-assignees

    Add up to 10 people as assignees of an issue or pull request, keeping the current ones. Returns the issue. GitHub silently ignores a login that cannot be assigned, so check `assignees` in the response.

  • Update comment

    read back

    github-update-comment

    Replace the text of one comment on an issue or pull request conversation.

  • Delete comment

    read back

    github-delete-comment

    Delete one comment from an issue or pull request conversation. It cannot be restored.

  • Create label

    read back

    github-create-label

    Create one label in a repository, with a color given as six hex digits without #. GitHub refuses a name that already exists (422).

  • Delete label

    read back

    github-delete-label

    Delete one label from a repository, which also removes it from every issue and pull request that has it. It cannot be restored.

  • Comment on pull request

    read back

    github-comment-on-pull-request

    Add one comment to a pull request's conversation (not to a line of its diff; use create-review for that).

  • Create review

    read back

    github-create-review

    Submit one review on a pull request: APPROVE, REQUEST_CHANGES or COMMENT, with an optional list of comments on lines of the diff. A body is required to request changes or comment. GitHub refuses a review of your own pull request with APPROVE or REQUEST_CHANGES.

  • Request reviewers

    acknowledged

    github-request-reviewers

    Ask people (logins) or teams (slugs, organization repositories only) to review a pull request; give at least one. Returns the pull request with its requested reviewers. GitHub refuses a person who is not a collaborator, and the pull request's author.

  • Merge pull request

    read back

    github-merge-pull-request

    Merge one pull request with a merge commit, a squash or a rebase. `sha` must be the head commit you reviewed (head.sha from get-pull-request); GitHub refuses the merge (409) if the branch has moved since.

  • Create pull request

    read back

    github-create-pull-request

    Open one pull request from a head branch (`branch`, or `owner:branch` for a fork) into a base branch, optionally as a draft.

Reads

  • Search issues

    github-search-issues

    Search issues and pull requests in the repositories the token can reach, with GitHub search syntax such as `repo:acme/widgets is:issue is:open label:bug`. Returns `total_count` and up to 5 `items` per page, bodies included; pass `page` for the next page (GitHub returns at most the first 1,000 results). Include `is:issue` or `is:pr`, and `repo:owner/name` to stay in one repository; GitHub allows 30 searches a minute.

  • List issues

    github-list-issues

    List issues in one repository, newest first by default, 5 per page with bodies; pass `page` for the next page. GitHub includes pull requests in this list (they carry a `pull_request` key). Filters: state (open by default), labels (comma-separated names, all must match), assignee, creator, milestone number, and since (updated after).

  • Get issue

    github-get-issue

    Get one issue by number: title, body, state and state reason, labels, assignees, milestone and comment count. A pull request number also works here and returns the pull request as an issue (with a `pull_request` key).

  • List issue comments

    github-list-issue-comments

    List the comments on one issue or pull request conversation, oldest first, 10 per page; pass `page` for the next page. `since` returns only comments updated after that time. Comments on a pull request's diff are in list-review-comments.

  • List labels

    github-list-labels

    List the labels defined in a repository (name, color, description), 100 per page; pass `page` for the next page.

  • List pull requests

    github-list-pull-requests

    List pull requests in one repository, newest first by default, 3 per page because each one carries full head and base repository objects; pass `page` for the next page. Filters: state (open by default), base branch, and head as `owner:branch`. For a compact list of many pull requests use search-issues with `is:pr`.

  • Get pull request

    github-get-pull-request

    Get one pull request by number: title, body, state, draft, head and base branches with their SHAs, `merged`, `mergeable` (null while GitHub is still computing it; ask again shortly), requested reviewers, and commit, addition, deletion and changed-file counts.

  • List pull request files

    github-list-pull-request-files

    List the files a pull request changes, 10 per page, each with its status, addition and deletion counts and its patch; pass `page` for the next page. GitHub returns at most 3,000 files, and a page with very large patches can reach the 64 KB response cut.

  • List reviews

    github-list-reviews

    List the reviews on a pull request in the order they were submitted, 10 per page, each with its reviewer, state (APPROVED, CHANGES_REQUESTED, COMMENTED, DISMISSED or PENDING), body and commit; pass `page` for the next page.

  • List review comments

    github-list-review-comments

    List the comments left on a pull request's diff, 10 per page, each with its file path, line, diff hunk, body and the review it belongs to; pass `page` for the next page. `since` returns only comments updated after that time.

  • Get repository

    github-get-repository

    Get one repository: full name, description, visibility, default branch, topics, whether issues are enabled, and open issue count.

  • List branches

    github-list-branches

    List a repository's branches, each with its head commit SHA and whether it is protected, 50 per page; pass `page` for the next page. Set `protected` to true for protected branches only.

  • Get file contents

    github-get-file-contents

    Get one file or directory from a repository, at a branch, tag or commit (`ref`; the default branch when left out). A file comes back with its `content` in base64 and its blob `sha`; a directory comes back as a list of entries (up to 1,000). A file over about 45 KB is cut by the 64 KB response limit once encoded, and GitHub returns no content over 1 MB in this form.

  • List commits

    github-list-commits

    List commits newest first from a branch or SHA (the default branch when left out), 8 per page; pass `page` for the next page. Filter by a file path, an author login or email, and a time window (since, until).

  • Search code

    github-search-code

    Search code on the default branches of the repositories the token can reach, for example `retryCharge repo:acme/widgets path:src`. The query needs at least one search term, not only qualifiers. Returns `total_count` and up to 8 matches per page (file name, path, blob sha, repository); pass `page` for the next page. GitHub allows 10 code searches a minute and searches only files under 384 KB.

How do users connect? Each one brings their own GitHub.

  1. 1.Call for the userYour server invokes the action for the signed-in user. Without a GitHub connection, the SDK throws EndUserNotConnectedError with a connect link.
  2. 2.The user pastes a keyThe link opens a form that shows where in GitHub's settings to create the key. The link lasts 10 minutes and works once.
  3. 3.Anlyon checks itThe key is checked with GitHub before it is kept, and bound to api.github.com. It is never shown back.
  4. 4.Your server confirmsYour server confirms the connection for the user who is signed in, and the call goes through.

How do I control what an AI agent does in GitHub? Suggested limits and approvals, for you to review.

Suggested limits

  • 50 issues opened a day
  • 200 comments a day
  • 50 issues closed a day
  • 50 issues reopened a day
  • 100 issues updated a day
  • 200 label additions a day
  • 200 label removals a day
  • 100 assignee additions a day
  • 100 comments edited a day
  • 50 comments deleted a day
  • 20 labels created a day
  • 10 labels deleted a day
  • 200 pull request comments a day
  • 50 reviews a day
  • 50 review requests a day
  • 20 pull requests merged a day
  • 20 pull requests opened a day

Suggested approvals

  • A person approves closing an issue
  • A person approves closing an issue by update
  • A person approves deleting a comment
  • A person approves deleting a label
  • A person approves approving a pull request
  • A person approves merging a pull request

What the key must allow

  • A fine-grained personal access token
  • Limited to the repositories you pick
  • Issues and Pull requests: Read and write; Contents: Read (Read and write to merge)

Good to know

  • The token decides which repositories can be reached. A policy on the owner and repo inputs narrows it further.
  • A fine-grained token expires. Paste a new one when it does.

For your own account

  1. 1.In GitHub, open Settings, Developer settings, Personal access tokens, Fine-grained tokens, and generate a token.
  2. 2.Limit it to the repositories your agent should work in, and give it Issues: Read and write.
  3. 3.In Anlyon, open Actions, then Integrations, choose GitHub and paste the token.
  4. 4.Anlyon checks the token with GitHub before storing it. It becomes a secret named GITHUB, bound to api.github.com.

How do I call GitHub from my agent's code? For one of your users, or for your own account.

Act for one of your users from your server, or connect your company's own GitHub with the CLI.

github.ts
import { Client, EndUserNotConnectedError } from "@anlyonhq/sdk";const anlyon = new Client({ apiKey: process.env.ANLYON_API_KEY! });try {  const { data } = await anlyon    .forUser(session.userId)    .actions.invoke("github-create-issue", {      owner: "acme",      repo: "widgets",      title: "Checkout fails for saved cards",      body: "Reported by three customers this morning."    });  return { status: "done", grade: data.grade };} catch (error) {  if (error instanceof EndUserNotConnectedError) {    // The user connects their own GitHub, then you call again.    return { status: "connect_required", url: error.connectUrl };  }  throw error;}

Questions. GitHub and AI agents.

Anything still unanswered is worth an email.

support@anlyon.com

Email us

Connect a GitHub account in Anlyon, switch on the operations the agent may use, and call them from the TypeScript or Python SDK or over MCP. Each of your users connects their own account through a connect link, where they sign in on GitHub's own consent page. Your agent sees the operations by name and never sees the credential.

Through Anlyon it can triage issues, review pull requests and read code. Reads change nothing. Writes are off until you switch them on, and every write leaves a receipt.

Yes. Every GitHub action you enable is also an MCP tool on Anlyon's hosted MCP server, at https://api.anlyon.com/mcp. Add that address to Claude Code, Cursor or Codex and sign in. This is Anlyon's integration, not GitHub's own MCP server, which has its own page here: GitHub MCP server.

No. The token stays with Anlyon and is sent only in the request to GitHub's API. No API returns it, to you, to the console or to an agent.

Let your agent act for your users, safely.

A few lines of server code, then send a user a connect link. Nothing to host.

$ claude mcp add --transport http anlyon https://api.anlyon.com/mcp