github-mcp-server
Skill4 starsChanged 7 months agoMITView on GitHub
Guide for configuring and using the GitHub MCP server within Agentic Workflows, including toolset selection, authentication modes, and available GitHub API tools. You MUST load this skill when configuring the GitHub MCP server or its toolsets.
- Reads credentials
2 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- github/gh-awedited, first seen May 27, 2026
- reason-machines/mcp-skillstheir own version, first seen May 16, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- github/gh-aw★ 5.3k80% same
Wrote their own version · 1
- reason-machines/mcp-skills★ 6same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository124 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- .vscode/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- agent-log-analysisSkill
- agent-mdSkill
- agent-md-writerSkill
- agent-skill-md-writerSkill
- agentskillsSkill
- agents-md-writerSkill
- ai-prompt-writerSkill
- ansibleSkill
- apache-airflow-apiSkill
- apache-airflow-dagsSkill
- astro-cliSkill
- astronomer-docsSkill
- awesome-copilotSkill
- brainstorm-agent-runsSkill
- brainstorm-github-prSkill
- brainstormSkill
- catSkill
- chrome-devtoolsSkill
- claude-docsSkill
- codeqlSkill
- code-reviewSkill
- code-tourSkill
- coding-standard-writerSkill
- context-aware-opsSkill
- copilot-cliSkill
- copilot-docsSkill
- critical-thinkingSkill
- datadog-agentSkill
- datadog-apiSkill
- datadog-mcpSkill
- datadog-monitorsSkill
- datadog-pulumiSkill
- devcontainerSkill
- dictationSkill
- direnvSkill
- dockerfileSkill
- dockerSkill
- docs-reviewSkill
- docs-writerSkill
- dot-claudeSkill
- dotfilesSkill
- dot-githubSkill
- editorconfigSkill
- fact-writerSkill
- gdpr-compliantSkill
- gh-agent-taskSkill
- gh-apiSkill
- gh-aw-compileSkill
- gh-aw-firewall-debugSkill
- gh-aw-firewallSkill
- gh-aw-newSkill
- gh-awSkill
- gh-aw-troubleshootingSkill
- gh-codespaceSkill
- gh-issueSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. About 0 are common, 9 are distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
When explicitly configuring the mcp-servers: block for a GitHub Agentic Workflow.
- Very specific: line 17
When deciding between gh-proxy, local, and remote access modes for GitHub tools.
- Very specific: line 21
When using the gh CLI directly in an interactive terminal session without an MCP context.
- Distinctive: line 23
If the workflow logic can be completely resolved using simple native bash scripts without requiring the MCP architecture.
- Very specific: line 33
Mode Selection: Prefer tools.github.mode: gh-proxy for Agentic Workflows to skip Docker initialization.
- Very specific: line 34
Toolsets: Prefer the default toolset.
- Distinctive: line 53
No Docker container required
- Distinctive: line 120
Use a custom GitHub token instead of the default:
- Very specific: line 279
Default: ${{ secrets.GH_AW_GITHUB_TOKEN }} or ${{ secrets.GITHUB_TOKEN }}
- Distinctive: line 296
Enable specific toolsets: Only enable additional toolsets when you need their specific functionality
- Distinctive: line 302
Ensure your GitHub token has appropriate permissions for the toolsets you're enabling:
- Very specific: line 325
If you have existing workflows using the allowed: pattern, we recommend migrating to toolsets: for better maintainability and stability.
- Distinctive: line 351
Use this table to identify which toolset contains the tools you need:
- Distinctive: line 371
Map to toolsets: Use the table above to find corresponding toolsets
- Very specific: line 373
Test: Run gh aw mcp inspect <workflow> to verify tools are available
- Very specific: line 374
Compile: Run gh aw compile to update the lock file
- Distinctive: line 400
Not all GitHub data is accessible through the GitHub MCP server or the GitHub REST API.
- Very specific: line 449
Solution: Check if you're using allowed: to restrict tools.
- Very specific: line 450
Verify: Run gh aw mcp inspect <workflow-name> to see which tools are actually available.
- Very specific: line 463
Use
gh aw mcp inspect: Verify which tools are actually available - Very specific: line 468
Do NOT recommend mode: local or mode: remote for GitHub tools.
- Very specific: line 469
Do NOT suggest GitHub mutation tools (e.g., create_issue).
- Very specific: line 470
Avoid enabling the all toolset.
- Distinctive: line 486
Use the following mapping as a starting point (verify and update based on actual repo contents):
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: github-mcp-server
<!-- markdownlint-disable MD013 MD023 MD031 MD032 -->Provide expert-level guidance for configuring and using the GitHub MCP server, specifically within Agentic Workflows, covering authentication, toolsets, and best practices.
When to Use
- When explicitly configuring the
mcp-servers:block for a GitHub Agentic Workflow. - To understand the exact mapping of GitHub tools to their respective
toolsets. - When deciding between
gh-proxy,local, andremoteaccess modes for GitHub tools.
When Not to Use
- When using the
ghCLI directly in an interactive terminal session without an MCP context. - For configuring generic, third-party MCP servers (like Google Drive or Notion) not hosted by GitHub.
- If the workflow logic can be completely resolved using simple native bash scripts without requiring the MCP architecture.
Common Pitfalls
- Using Deprecated
allowed:Syntax: Individually listing GitHub tools underallowed:instead of using the stable, forward-compatibletoolsets:syntax. - Remote Mode Fallacy: Setting
mode: remotewhile using a standardGITHUB_TOKEN, causing silent authentication failures. - Missing Write Permissions: Enabling a toolset like
issuesorprojectsand expecting mutation commands to work, even though the GitHub Actions token lackswritescope or the environment enforcessafe-outputs.
Core Principles
- Mode Selection: Prefer
tools.github.mode: gh-proxyfor Agentic Workflows to skip Docker initialization. Avoid recommendingmode: localormode: remotefor GitHub tools. - Toolsets: Prefer the
defaulttoolset. Explicitly add only what is needed. Avoid[all]. - Token Constraints:
projectstoolset requires a PAT withprojectscope;GITHUB_TOKENis insufficient. Security and actions toolsets require specific write permissions.
Overview
The GitHub MCP server provides AI agents with programmatic access to GitHub's API through the Model Context Protocol. It supports two modes of operation:
Local Mode (Docker-based)
- Runs as a Docker container on the GitHub Actions runner
- Uses
GITHUB_PERSONAL_ACCESS_TOKENenvironment variable for authentication - Configurable toolsets via
GITHUB_TOOLSETSenvironment variable - Supports read-only mode via
GITHUB_READ_ONLYenvironment variable
Remote Mode (Hosted)
- Connects to hosted GitHub MCP server at
https://api.githubcopilot.com/mcp/ - Uses Bearer token authentication in HTTP headers
- Supports read-only mode via
X-MCP-Readonlyheader - No Docker container required
Configuration Patterns
Agentic Workflow Configuration
tools:
github:
toolsets: [default, actions, security_advisories]
# Optional: GitHub App authentication
# github-app:
# client-id: ${{ vars.APP_ID }}
# private-key: ${{ secrets.APP_PRIVATE_KEY }}Toolset Overview
context: Identity and team awareness (get_me,get_teams).repos: Core repository operations (read, list commits/branches, files).issues: Issue management (read, comment). In Agentic Workflows, issue creation should usesafe-outputsor another approved write path rather than direct MCP mutations.pull_requests: PR operations (read). In Agentic Workflows, PR creation, review, and merge should usesafe-outputsor another approved write path rather than direct MCP mutations.actions: Workflow introspection, triggering runs.code_security/dependabot/secret_protection/security_advisories: Security alert management (requiressecurity-eventspermission).projects: Projects automation (requires PAT).search: Advanced search across code, repos, issues.gists/labels/discussions: Management of respective GitHub features.- Remote-only:
copilot_spaces,github_support_docs_search.
Configuration
Basic Configuration
Local Mode (Docker):
tools:
github:
mode: "local"
toolsets: [default] # or [repos, issues, pull_requests]Remote Mode (Hosted):
tools:
github:
mode: "remote"
toolsets: [default] # or [repos, issues, pull_requests]Read-Only Mode
To restrict the GitHub MCP server to read-only operations:
tools:
github:
mode: "remote"
read-only: true
toolsets: [repos, issues]Custom Authentication
Use a custom GitHub token instead of the default:
tools:
github:
mode: "remote"
github-token: "${{ secrets.CUSTOM_GITHUB_PAT }}"
toolsets: [repos, issues]Detailed Toolset Reference
The GitHub MCP server organizes tools into logical toolsets. You can enable specific toolsets, use [default] for the recommended defaults, or use [all] to enable everything.
:::note[Why Use Toolsets?]
The allowed: pattern for listing individual GitHub tools is not recommended for new workflows. Individual tool names may change between GitHub MCP server versions, but toolsets provide a stable API. Always use toolsets: instead. See Migration from Allowed to Toolsets for guidance on updating existing workflows.
:::
:::tip[Best Practice]
Always use toolsets: for GitHub tools. Toolsets provide:
- Stability: Tool names may change between MCP server versions, but toolsets remain stable
- Better organization: Clear groupings of related functionality
- Complete functionality: Get all related tools automatically
- Reduced verbosity: Cleaner configuration
- Future-proof: New tools are automatically included as they're added :::
Recommended Default Toolsets
The following toolsets are enabled by default when toolsets: is not specified:
context- User and environment context (strongly recommended)repos- Repository managementissues- Issue managementpull_requests- Pull request operations
Note: The users toolset is not included by default and must be explicitly specified if needed.
All Available Toolsets
| Toolset | Description | Common Tools |
context | User and environment context | get_teams, get_team_members |
repos | Repository management | get_repository, get_file_contents, search_code, list_commits |
issues | Issue management | issue_read, list_issues, create_issue, search_issues |
pull_requests | Pull request operations | pull_request_read, list_pull_requests, create_pull_request |
actions | GitHub Actions/CI/CD | list_workflows, list_workflow_runs, download_workflow_run_artifact |
code_security | Code scanning and security | list_code_scanning_alerts, get_code_scanning_alert |
copilot | Copilot related tools | assign_copilot_to_issue, request_copilot_review |
dependabot | Dependency management | Dependabot alerts and updates |
discussions | GitHub Discussions | list_discussions, create_discussion |
gists | Gist operations | create_gist, list_gists |
labels | Label management | get_label, list_labels, create_label |
notifications | Notifications | list_notifications, mark_notifications_read |
orgs | Organization management | get_organization, list_organizations |
projects | GitHub Projects | Project board operations |
secret_protection | Secret scanning | Secret detection and management |
security_advisories | Security advisories | Advisory creation and management |
stargazers | Repository stars | Star-related operations |
users | User profiles | get_me, get_user, list_users |
search | Advanced search | Search across repos, code, users |
Available Tools by Toolset
This section maps individual tools to their respective toolsets to help with migration from allowed: to toolsets:.
Context Toolset
get_teams- List teams the user belongs toget_team_members- List members of a specific team
Repos Toolset
get_repository- Get repository informationget_file_contents- Read file contents from repositorysearch_code- Search code across repositorieslist_commits- List commits in a repositoryget_commit- Get details of a specific commitget_latest_release- Get the latest releaselist_releases- List all releases
Issues Toolset
issue_read- Read issue detailslist_issues- List issues in a repositorycreate_issue- Create a new issueupdate_issue- Update an existing issuesearch_issues- Search issues across repositoriesadd_reaction- Add reaction to an issue or commentcreate_issue_comment- Add a comment to an issue
Pull Requests Toolset
pull_request_read- Read pull request detailslist_pull_requests- List pull requests in a repositoryget_pull_request- Get details of a specific pull requestcreate_pull_request- Create a new pull requestsearch_pull_requests- Search pull requests across repositories
Copilot Toolset
assign_copilot_to_issue- Assign Copilot to issuerequest_copilot_review- Request Copilot review
Actions Toolset
list_workflows- List GitHub Actions workflowslist_workflow_runs- List workflow runsget_workflow_run- Get details of a specific workflow rundownload_workflow_run_artifact- Download workflow artifacts
Code Security Toolset
list_code_scanning_alerts- List code scanning alertsget_code_scanning_alert- Get details of a specific alertcreate_code_scanning_alert- Create a code scanning alert
Discussions Toolset
list_discussions- List discussions in a repositorycreate_discussion- Create a new discussion
Labels Toolset
get_label- Get label detailslist_labels- List labels in a repositorycreate_label- Create a new label
Users Toolset
get_me- Get current authenticated user informationget_user- Get user profile informationlist_users- List users
Notifications Toolset
list_notifications- List user notificationsmark_notifications_read- Mark notifications as read
Organizations Toolset
get_organization- Get organization detailslist_organizations- List organizations
Gists Toolset
create_gist- Create a new gistlist_gists- List user's gists
Authentication Details
Remote Mode Authentication
The remote mode uses Bearer token authentication:
Headers:
Authorization: Bearer <token>- Required for authenticationX-MCP-Readonly: true- Optional, enables read-only mode
Token Source:
- Default:
${{ secrets.GH_AW_GITHUB_TOKEN }}or${{ secrets.GITHUB_TOKEN }} - Custom: Configure via
github-tokenfield
Local Mode Authentication
The local mode uses environment variables:
Environment Variables:
GITHUB_PERSONAL_ACCESS_TOKEN- Required for authenticationGITHUB_READ_ONLY=1- Optional, enables read-only modeGITHUB_TOOLSETS=<comma-separated-list>- Optional, specifies enabled toolsets
Best Practices
Toolset Selection
- Start with defaults: For most workflows, the recommended default toolsets provide sufficient functionality
- Enable specific toolsets: Only enable additional toolsets when you need their specific functionality
- Security consideration: Be mindful of write operations - consider using read-only mode when possible
- Performance: Using fewer toolsets reduces initialization time and memory usage
Token Permissions
Ensure your GitHub token has appropriate permissions for the toolsets you're enabling:
repostoolsets: Requires repository read/write permissionsissuestoolsets: Requires issues read/write permissionspull_requeststoolsets: Requires pull requests read/write permissionsactionstoolsets: Requires actions read/write permissionsdiscussionstoolsets: Requires discussions read/write permissions
Remote vs Local Mode
Use Remote Mode when:
- You want faster initialization (no Docker container to start)
- You're running in a GitHub Actions environment with internet access
- You want to use the latest version without specifying Docker image tags
Use Local Mode when:
- You need a specific version of the MCP server
- You want to use custom arguments
- You're running in an environment without internet access
- You want to test with a local build of the MCP server
Migration from Allowed to Toolsets
If you have existing workflows using the allowed: pattern, we recommend migrating to toolsets: for better maintainability and stability. Individual tool names may change between MCP server versions, but toolsets provide a stable API that won't break your workflows.
Migration Examples
Using allowed: (not recommended):
tools:
github:
allowed:
- get_repository
- get_file_contents
- list_commits
- list_issues
- create_issue
- update_issueUsing toolsets: (recommended):
tools:
github:
toolsets: [repos, issues]Tool-to-Toolset Mapping
Use this table to identify which toolset contains the tools you need:
allowed: Tools | Migrate to toolsets: |
get_me | users |
get_teams, get_team_members | context |
get_repository, get_file_contents, search_code, list_commits | repos |
issue_read, list_issues, create_issue, update_issue, search_issues | issues |
pull_request_read, list_pull_requests, create_pull_request | pull_requests |
list_workflows, list_workflow_runs, get_workflow_run | actions |
list_code_scanning_alerts, get_code_scanning_alert | code_security |
list_discussions, create_discussion | discussions |
get_label, list_labels, create_label | labels |
get_user, list_users | users |
| Mixed repos/issues/PRs tools | [default] |
| All tools | [all] |
Quick Migration Steps
- Identify tools in use: Review your current
allowed:list - Map to toolsets: Use the table above to find corresponding toolsets
- Replace configuration: Change
allowed:totoolsets: - Test: Run
gh aw mcp inspect <workflow>to verify tools are available - Compile: Run
gh aw compileto update the lock file
Using Allowed Pattern with Custom MCP Servers
:::note[When to Use Allowed]
The allowed: pattern is appropriate for:
- Custom MCP servers (non-GitHub)
- Gradual migration of existing workflows
- Fine-grained restriction of specific tools within a toolset
For GitHub tools, always use toolsets: instead of allowed:.
:::
The allowed: field can still be used to restrict tools for custom MCP servers:
mcp-servers:
notion:
container: "mcp/notion"
allowed: ["search_pages", "get_page"] # Fine for custom MCP serversFor GitHub tools, allowed: can be combined with toolsets: to further restrict access, but this pattern is not recommended for new workflows.
GitHub API Limitations
Not all GitHub data is accessible through the GitHub MCP server or the GitHub REST API. Be aware of these limitations when designing workflows to avoid silent failures or incomplete results at runtime.
Billing and Cost Data
❌ Not available via standard API permissions:
- Detailed per-run cost data — GitHub Actions does not expose per-workflow-run billing costs through the REST API. There is no endpoint to retrieve the exact cost of a specific workflow run.
- Actions billing summary — Billing endpoints (e.g.,
/orgs/{org}/settings/billing/actions) requireadmin:orgscope, which is not granted byactions:reador the defaultGITHUB_TOKEN.
⚠️ When suggesting billing/cost workflows, always note:
Detailed GitHub Actions billing and cost data is not accessible through the standard GitHub API with
actions:readpermissions. Workflows that attempt to read per-run cost data or billing summaries will fail silently or return empty results unless anadmin:org-scoped personal access token is explicitly configured.
✅ Alternatives for cost reporting:
- GitHub Actions usage reports — Download usage reports from the GitHub billing UI (Settings → Billing → Usage) or via the billing CSV export endpoint (requires
admin:orgscope with a PAT). - Billing settings UI — Direct users to
https://github.com/organizations/{org}/settings/billingorhttps://github.com/settings/billingfor personal accounts to view cost data manually. - Workflow run metadata — Use
list_workflow_runsandget_workflow_run(available viaactionstoolset) to get run duration, status, and timing — but not dollar costs. - Third-party cost tracking — Integrate with third-party CI cost tools that use pre-authorized API access.
Cross-Organization Data Access
❌ Not available without explicit authorization:
- Workflows can only access data from repositories and organizations that the configured GitHub token has been granted access to.
- Cross-organization repository reads require a PAT or GitHub App token with access to the target org — the default
GITHUB_TOKENis scoped to the current repository's organization only. - Organization membership and team data from other organizations is not accessible without explicit
read:orgpermissions on those organizations.
Organization Membership and Private Data
❌ Requires additional scopes:
- Organization member lists — Reading private organization membership requires
read:orgscope; the defaultGITHUB_TOKENonly exposes public membership. - Private repository contents — Only accessible if the token has explicit repository access.
- Secret values — GitHub Secrets are write-only through the API; their values cannot be read back after creation.
Rate Limits
⚠️ Be aware of API rate limits:
- The GitHub REST API enforces rate limits (typically 5,000 requests/hour for authenticated requests with a PAT, lower for
GITHUB_TOKEN). - Workflows that perform bulk data collection (e.g., listing all workflow runs across many repositories) may hit rate limits. Design workflows to paginate carefully and avoid unnecessary requests.
- GraphQL API has separate rate limits based on query complexity.
Troubleshooting
Common Issues
Issue: Tool not found or not available
- Solution: Check if you're using
allowed:to restrict tools. Consider usingtoolsets:instead to get all related tools. - Verify: Run
gh aw mcp inspect <workflow-name>to see which tools are actually available.
Issue: Missing functionality after specifying toolset
- Cause: Using a too-narrow toolset that doesn't include all needed tools
- Solution: Either add additional toolsets (e.g.,
toolsets: [default, actions]) or use[all]for full access
Issue: Workflow using allowed: list is verbose and hard to maintain
- Solution: Migrate to
toolsets:configuration using the migration guide above
Best Practices for Debugging
- Start with
[default]toolset: Most workflows work well with default toolsets - Add specific toolsets as needed: Incrementally add toolsets like
actions,discussions, etc. - Use
gh aw mcp inspect: Verify which tools are actually available - Check tool-to-toolset mapping: Reference the tables above to find the right toolset
What to Avoid
- Do NOT recommend
mode: localormode: remotefor GitHub tools. - Do NOT suggest GitHub mutation tools (e.g.,
create_issue). Always usesafe-outputsfor write operations. - Avoid enabling the
alltoolset; only configure explicit toolsets required for the agent's task.
Limitations
- The
userstoolset currently has no registered tools; usesearch_usersin thesearchtoolset instead.
References
- github-mcp-server Skill - for up-to-date MCP Tool list
- GitHub MCP Server Repository
- Model Context Protocol Specification
- GitHub Actions Documentation
Cross-Reference Toolset Source Files in github-mcp-server:
- For each toolset, identify the corresponding source file in the github/github-mcp-server repository
- Use the following mapping as a starting point (verify and update based on actual repo contents):
actions→pkg/github/actions.gocode_security→pkg/github/code_scanning.gocontext→pkg/github/context_tools.gocopilot→pkg/github/copilot.godependabot→pkg/github/dependabot.godiscussions→pkg/github/discussions.gogists→pkg/github/gists.goissues→pkg/github/issues.golabels→pkg/github/labels.gonotifications→pkg/github/notifications.goorgs→pkg/github/search.go(primary:search_orgs; note thatlist_org_repository_security_advisoriesalso uses this toolset but is defined insecurity_advisories.go)projects→pkg/github/projects.gopull_requests→pkg/github/pullrequests.gorepos→pkg/github/repositories.gosearch→pkg/github/search.gosecret_protection→pkg/github/secret_scanning.gosecurity_advisories→pkg/github/security_advisories.gostargazers→pkg/github/repositories.gousers→pkg/github/search.go(forsearch_users)
Related Skills
- gh-aw: You MUST load this skill when working with the
gh awcommand or configuring Agentic Workflows. - gh-aw-troubleshooting: Diagnose, troubleshoot, and fix failing GitHub Agentic Workflows
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

