MCP
developer

GitHub

Manage repositories, branches, issues, and pull requests on GitHub.

Requires Growth plan or above.

Connect GitHub

Create a fine-grained personal access token at github.com/settings/personal-access-tokens (grant repo and read:org), then paste it on the GitHub card at /dashboard/connections.

Example

Open an issue in a repository, including labels and an initial assignee.

app/api/file-issue/route.ts
export async function POST() {
const res = await fetch('https://leash.build/api/integrations/github/create_issue', {
method: 'POST',
headers: {
'x-api-key': process.env.LEASH_API_KEY!,
'content-type': 'application/json',
},
body: JSON.stringify({
owner: 'leash-build',
repo: 'leash-platform',
title: 'Provider page rewrite — LEA-225',
body: 'Tracking issue for the docs sweep.',
labels: ['docs'],
assignees: ['arvingopi'],
}),
})
const { data } = await res.json()
// data =>
// {
// number: 142,
// html_url: 'https://github.com/leash-build/leash-platform/issues/142',
// state: 'open',
// title: 'Provider page rewrite — LEA-225',
// user: { login: 'arvingopi' },
// labels: [{ name: 'docs', color: '0e8a16' }],
// created_at: '2026-05-12T15:01:42Z'
// }
return Response.json(data)
}

Available tools

  • create_repository / fork_repository / search_repositories — repo lifecycle.
  • create_branch / list_commits — branch and commit ops.
  • get_file_contents / create_or_update_file / push_files / search_code — file IO.
  • create_issue / get_issue / list_issues / update_issue / add_issue_comment / search_issues — issue tracking.
  • create_pull_request / get_pull_request / list_pull_requests / merge_pull_request / update_pull_request_branch — PR workflow.
  • get_pull_request_files / get_pull_request_comments / get_pull_request_reviews / create_pull_request_review / get_pull_request_status — PR review surface.

Common gotchas

  • Fine-grained tokens are repo-scoped. Add every target repo to the token before calling write tools, or use a classic token with repo.
  • create_or_update_file needs the current SHA. First call get_file_contents; PUT without SHA on an existing path returns 409.
  • REST rate limit is 5,000/hour per token. Use search_* sparingly — it has a stricter 30-req/min cap.

See the GitHub REST API reference for the underlying provider docs.

Other languages: see SDK overview.