GitHub MCP Server Instructions

May 24, 2026 · View on GitHub

Source: github/github-mcp-server Mapping File: pkg/workflow/data/github_toolsets_permissions.json Last Updated: 2026-05-24

Overview

The GitHub MCP server provides tools to interact with GitHub APIs through the Model Context Protocol (MCP). It operates in two modes:

  • Remote mode: Connects to GitHub's hosted MCP endpoint (https://api.githubcopilot.com/mcp/)
  • Local mode: Runs gh mcp (GitHub CLI) as a local subprocess

Authentication

Remote mode: Uses a Bearer token in the Authorization header:

Authorization: Bearer <github-token>

Read-only mode: Add the X-MCP-Readonly: true header to restrict to read operations only:

X-MCP-Readonly: true

Local mode: Uses the GitHub CLI's existing authentication (gh auth login).

Configuration

In Agentic Workflows

tools:
  github:
    toolsets: [default]     # or specific toolsets
    # Optional: GitHub App authentication
    github-app:
      client-id: ${{ vars.APP_ID }}
      private-key: ${{ secrets.APP_PRIVATE_KEY }}

⚠️ Do NOT use mode: remote in GitHub Actions workflows. Remote mode does not work with the GitHub Actions token (GITHUB_TOKEN) — it requires a special PAT or GitHub App token with MCP access. The default mode: local (Docker-based) works with GITHUB_TOKEN and should always be used.

Toolset Options

  • [default] — Recommended defaults: context, repos, issues, pull_requests
  • [all] — Enable all toolsets
  • Specific toolsets: [repos, issues, pull_requests, discussions]
  • Extend defaults: [default, discussions, actions]

The following toolsets are recommended as defaults for typical agentic workflows:

ToolsetRationale
contextIdentity and team awareness (get_me, get_teams) — essential for any GitHub-aware agent
reposCore repository operations (read files, list commits/branches) — most workflows need file access
issuesIssue management (read, comment, create) — common in CI/CD and automation workflows
pull_requestsPR operations (read, create, review) — critical for code review and merge automation

Enable explicitly when needed (not in defaults):

ToolsetWhen to Enable
actionsWorkflow introspection, triggering runs
code_securityCode scanning alert management
copilot_spacesGitHub Copilot Spaces (remote mode only)
dependabotDependency vulnerability management
discussionsCommunity discussion workflows
experimentsDynamic toolset management
gistsGist creation and management
gitGit API operations (tree, refs)
github_support_docs_searchGitHub support documentation search (remote mode only)
labelsLabel management automation
notificationsNotification processing agents
orgsOrganization-level security advisories
projectsGitHub Projects automation (requires PAT)
searchCross-repository search operations
secret_protectionSecret scanning alert management
security_advisoriesAdvisory database queries
stargazersStar/unstar repository operations
users(currently empty — no tools registered)

Tools by Toolset

context

Description: GitHub context and environment (current user, teams)

ToolPurposeKey Parameters
get_meGet details of the authenticated user
get_team_membersList members of a GitHub teamorg, team_slug
get_teamsList teams the authenticated user belongs toorg

copilot_spaces

Description: GitHub Copilot Spaces (remote-only)

Note: Remote-only toolset — only available when using the GitHub MCP server in remote mode (https://api.githubcopilot.com/mcp/). Not available with the local gh mcp mode.

ToolPurposeKey Parameters
get_copilot_spaceGet details of a specific Copilot Spaceowner, name
list_copilot_spacesList Copilot Spaces for a user or organizationowner

repos

Description: Repository operations

ToolPurposeKey Parameters
create_branchCreate a new branchowner, repo, branch, from_branch
create_or_update_fileCreate or update a file in a repositoryowner, repo, path, content, message, branch
create_repositoryCreate a new GitHub repositoryname, description, private, auto_init
delete_fileDelete a file from a repositoryowner, repo, path, message, sha, branch
fork_repositoryFork a repositoryowner, repo, organization
get_commitGet details of a specific commitowner, repo, sha
get_file_contentsRead file or directory contentsowner, repo, path, ref
get_latest_releaseGet the latest release for a repositoryowner, repo
get_release_by_tagGet a release by its tag nameowner, repo, tag
get_tagGet details of a specific tagowner, repo, tag
list_branchesList branches in a repositoryowner, repo, page, per_page
list_commitsList commits in a repositoryowner, repo, sha, path, page
list_releasesList all releases for a repositoryowner, repo, page, per_page
list_repository_collaboratorsList collaborators of a repositoryowner, repo, affiliation, page, per_page
list_tagsList tags in a repositoryowner, repo, page, per_page
push_filesPush multiple files in a single commitowner, repo, branch, files, message

git

Description: Git API operations (tree, refs)

ToolPurposeKey Parameters
get_repository_treeGet the file tree of a repositoryowner, repo, sha, recursive

Description: GitHub support documentation search (remote-only)

Note: Remote-only toolset — only available when using the GitHub MCP server in remote mode (https://api.githubcopilot.com/mcp/). Not available with the local gh mcp mode.

ToolPurposeKey Parameters
github_support_docs_searchSearch GitHub support documentationquery

issues

Description: Issue management

ToolPurposeKey Parameters
add_issue_commentAdd a comment to an issueowner, repo, issue_number, body
issue_readRead issue details and commentsowner, repo, issue_number
issue_writeCreate or update an issueowner, repo, title, body, labels, assignees
list_issue_typesList available issue types for a repositoryowner, repo
list_issuesList issues in a repositoryowner, repo, state, labels, page
search_issuesSearch issues across GitHubquery, page, per_page
sub_issue_writeCreate or manage sub-issuesowner, repo, issue_number

pull_requests

Description: Pull request operations

ToolPurposeKey Parameters
add_comment_to_pending_reviewAdd a comment to a pending PR reviewowner, repo, pull_number, review_id
add_reply_to_pull_request_commentReply to a PR review commentowner, repo, pull_number, comment_id, body
create_pull_requestCreate a new pull requestowner, repo, title, body, head, base
list_pull_requestsList pull requests in a repositoryowner, repo, state, head, base
merge_pull_requestMerge a pull requestowner, repo, pull_number, merge_method
pull_request_readRead PR details, reviews, and commentsowner, repo, pull_number
pull_request_review_writeCreate or submit a PR reviewowner, repo, pull_number, event, body
search_pull_requestsSearch pull requests across GitHubquery, page, per_page
update_pull_requestUpdate PR title, body, or stateowner, repo, pull_number, title, body
update_pull_request_branchUpdate PR branch with latest baseowner, repo, pull_number

actions

Description: GitHub Actions workflows

ToolPurposeKey Parameters
actions_getGet details of a specific workflow runowner, repo, run_id
actions_listList GitHub Actions workflows and runsowner, repo, method, resource_id, per_page, page
actions_run_triggerTrigger a workflow runowner, repo, workflow_id, ref, inputs
get_job_logsDownload logs for a specific workflow jobowner, repo, job_id

code_security

Description: Code scanning alerts

ToolPurposeKey Parameters
get_code_scanning_alertGet details of a specific code scanning alertowner, repo, alert_number
list_code_scanning_alertsList code scanning alerts for a repositoryowner, repo, state, severity

dependabot

Description: Dependabot alerts

ToolPurposeKey Parameters
get_dependabot_alertGet details of a specific Dependabot alertowner, repo, alert_number
list_dependabot_alertsList Dependabot alerts for a repositoryowner, repo, state, severity

discussions

Description: GitHub Discussions

ToolPurposeKey Parameters
get_discussionGet details of a specific discussionowner, repo, discussion_number
get_discussion_commentsGet comments for a specific discussionowner, repo, discussion_number
list_discussion_categoriesList discussion categories for a repositoryowner, repo
list_discussionsList discussions in a repositoryowner, repo, category_id

experiments

Description: Experimental features — dynamic toolset management

ToolPurposeKey Parameters
enable_toolsetDynamically enable a toolsettoolset
get_toolset_toolsGet tools available in a specific toolsettoolset
list_available_toolsetsList all available toolsets

gists

Description: Gist operations

ToolPurposeKey Parameters
create_gistCreate a new gistdescription, files, public
get_gistGet a specific gist by IDgist_id
list_gistsList gists for a userusername, page, per_page
update_gistUpdate an existing gistgist_id, description, files

labels

Description: Label management

ToolPurposeKey Parameters
get_labelGet details of a specific labelowner, repo, name
label_writeCreate or update a labelowner, repo, name, color, description
list_labelList labels in a repositoryowner, repo, page, per_page

notifications

Description: Notification management

ToolPurposeKey Parameters
dismiss_notificationDismiss a specific notificationnotification_id
get_notification_detailsGet details of a specific notificationnotification_id
list_notificationsList user notificationsall, participating, page
manage_notification_subscriptionManage notification subscription for a threadthread_id, subscribed
manage_repository_notification_subscriptionManage notifications for a repositoryowner, repo, subscribed
mark_all_notifications_readMark all notifications as readlast_read_at

orgs

Description: Organization operations

ToolPurposeKey Parameters
list_org_repository_security_advisoriesList security advisories for all repos in an orgorg, state

projects

Description: GitHub Projects (requires PAT — not supported by GITHUB_TOKEN)

ToolPurposeKey Parameters
projects_getGet details of a specific projectowner, project_number
projects_listList GitHub Projects for a user or organizationowner, per_page
projects_writeCreate or update project items/fieldsowner, project_number

Description: Advanced search across GitHub

ToolPurposeKey Parameters
search_codeSearch code across repositoriesquery, page, per_page
search_orgsSearch GitHub organizationsquery, page, per_page
search_repositoriesSearch for repositoriesquery, page, per_page
search_usersSearch GitHub usersquery, page, per_page
semantic_issue_similarity_searchFind GitHub issues semantically similar to a given issueowner, repo, issue_number
semantic_issues_searchSearch issues using natural language queriesquery, owner, repo

secret_protection

Description: Secret scanning

ToolPurposeKey Parameters
get_secret_scanning_alertGet details of a specific secret scanning alertowner, repo, alert_number
list_secret_scanning_alertsList secret scanning alerts for a repositoryowner, repo, state
run_secret_scanningScan file contents or diffs for exposed secretscontent

security_advisories

Description: Security advisories

ToolPurposeKey Parameters
check_dependency_vulnerabilitiesCheck dependencies against known vulnerabilities in the GitHub Advisory Databaseowner, repo, dependencies
get_global_security_advisoryGet a specific global security advisoryghsa_id
list_global_security_advisoriesList advisories from the GitHub Advisory Databasetype, severity, ecosystem
list_repository_security_advisoriesList security advisories for a specific repositoryowner, repo, state

stargazers

Description: Repository stars

ToolPurposeKey Parameters
list_starred_repositoriesList repositories starred by a userusername, page, per_page
star_repositoryStar a repositoryowner, repo
unstar_repositoryUnstar a repositoryowner, repo

users

Description: User information

Note: No tools are currently registered in the users toolset. User search is available via the search toolset (search_users).


Best Practices

Toolset Selection

  1. Start with defaults (context, repos, issues, pull_requests) for most workflows
  2. Add toolsets incrementally based on actual needs rather than enabling all
  3. Security toolsets (code_security, dependabot, secret_protection, security_advisories) require security-events permission
  4. Write operations require appropriate GitHub token permissions (see write_permissions in the JSON mapping)
  5. Projects toolset requires a PAT (Personal Access Token) — GITHUB_TOKEN lacks the required project scope

Permission Requirements

Most toolsets work with the default GITHUB_TOKEN in GitHub Actions. Exceptions:

  • projects — Requires a PAT with project scope
  • security_advisories (write) — Requires security-events: write permission
  • actions (write for actions_run_trigger) — Requires actions: write permission