Skip to content
GitHub Agentic Workflows

Getting Started with MCP

This guide walks you through integrating Model Context Protocol (MCP) servers with GitHub Agentic Workflows, from your first configuration to advanced patterns.

Model Context Protocol (MCP) is a standardized protocol that enables agents to connect to external tools, databases, and APIs. MCP servers act as specialized adapters, giving agents access to GitHub, web search, databases, and third-party services like Notion, Slack, and Datadog.

Get your first MCP integration running in under 5 minutes.

Create a workflow file at .github/workflows/my-workflow.md:

---
on:
issues:
types: [opened]
permissions:
contents: read
issues: read
tools:
github:
toolsets: [default]
---
# Issue Analysis Agent
Analyze the issue and provide a summary of similar existing issues.

The toolsets: [default] configuration gives your agentic workflow access to repository, issue, and pull request tools.

Compile the workflow to generate the GitHub Actions YAML:

Terminal window
gh aw compile my-workflow

Verify the MCP configuration:

Terminal window
gh aw mcp inspect my-workflow

You now have a working MCP integration. The agent can read issues, search repositories, and access pull request information.

Use toolsets: to enable groups of related GitHub tools:

tools:
github:
toolsets: [default] # Expands to: context, repos, issues, pull_requests (action-friendly)

Toolsets remain stable across MCP server versions, while individual tool names may change. See Available Toolsets for the full list.

Use allowed: when configuring custom (non-GitHub) MCP servers:

mcp-servers:
notion:
container: "mcp/notion"
allowed: ["search_pages", "get_page"]

The GitHub MCP server is built into agentic workflows and provides comprehensive access to GitHub’s API.

ToolsetDescriptionTools
contextUser and team informationget_teams, get_team_members
reposRepository operationsget_repository, get_file_contents, list_commits
issuesIssue managementlist_issues, create_issue, update_issue
pull_requestsPR operationslist_pull_requests, create_pull_request
actionsWorkflow runs and artifactslist_workflows, list_workflow_runs
discussionsGitHub Discussionslist_discussions, create_discussion
code_securitySecurity alertslist_code_scanning_alerts
usersUser profilesget_me, get_user, list_users

The default toolset includes: context, repos, issues, pull_requests. When used in workflows, [default] expands to action-friendly toolsets that work with GitHub Actions tokens. Note: The users toolset is not included by default as GitHub Actions tokens do not support user operations.

Remote mode (mode: remote) connects to a hosted server for faster startup with no Docker required. Local mode (mode: local) runs in Docker, enabling version pinning for offline or restricted environments. See Remote vs Local Mode.

The GitHub MCP server always operates read-only. Write operations are handled through safe outputs, which run in a separate permission-controlled job.

The GitHub MCP registry provides a centralized catalog of MCP servers.

Terminal window
# Browse available MCP servers
gh aw mcp add
# Add a specific server
gh aw mcp add my-workflow makenotion/notion-mcp-server
# Add with custom tool ID
gh aw mcp add my-workflow makenotion/notion-mcp-server --tool-id my-notion

The command searches the registry, adds the server configuration, and recompiles the workflow.

Reference registry servers directly in your workflow:

mcp-servers:
markitdown:
registry: https://api.mcp.github.com/v0/servers/microsoft/markitdown
container: "ghcr.io/microsoft/markitdown"
allowed: ["*"]

The registry field provides metadata for tooling while the container or command fields specify how to run the server.

For enterprise or private registries:

Terminal window
gh aw mcp add my-workflow server-name --registry https://custom.registry.com/v1

Configure third-party MCP servers using commands, Docker containers, or HTTP endpoints:

mcp-servers:
# Command-based (stdio)
markitdown:
command: "npx"
args: ["-y", "markitdown-mcp"]
allowed: ["*"]
# Docker container
ast-grep:
container: "mcp/ast-grep:latest"
allowed: ["*"]
# HTTP endpoint with auth
slack:
url: "https://api.slack.com/mcp"
env:
SLACK_BOT_TOKEN: "${{ secrets.SLACK_BOT_TOKEN }}"
network:
allowed: ["api.slack.com"] # Optional egress restrictions
allowed: ["send_message", "get_channel_history"]
---
on:
issues:
types: [opened]
permissions:
contents: read
issues: read
tools:
github:
toolsets: [default]
safe-outputs:
add-comment:
---
# Issue Triage Agent
Analyze issue #${{ github.event.issue.number }} and add a comment with category, related issues, and suggested labels.
---
on: weekly on sunday
permissions:
contents: read
security-events: read
discussions: write
tools:
github:
toolsets: [default, code_security, discussions]
safe-outputs:
create-discussion:
category: "Security"
title-prefix: "[security-scan] "
---
# Security Audit Agent
Review code scanning alerts and create weekly security discussions with findings.

Inspect configured servers and available tools:

Terminal window
# View all MCP servers
gh aw mcp inspect my-workflow
# Get detailed server information
gh aw mcp inspect my-workflow --server github --verbose
# List available tools
gh aw mcp list-tools github my-workflow
# Validate configuration
gh aw compile my-workflow --validate --strict

Tool not found: Run gh aw mcp inspect my-workflow to verify available tools. Ensure the correct toolset is enabled or that tool names in allowed: match exactly.

Authentication errors: Verify the secret exists in repository settings and has required scopes.

Connection failures: Check URL syntax for HTTP servers, network configuration for containers, and verify Docker images exist.

Validation errors: Check YAML syntax, ensure toolsets: uses array format ([default] not default), and verify allowed: is an array.