GitHub Operations
Maps 20+ GitHub API operations to MCP tool calls for repository, issue, PR, workflow, and security management.
What this file does
Maps 20+ GitHub API operations to MCP tool calls for repository, issue, PR, workflow, and security management.
When to use it
- Automating GitHub workflows from an MCP agent
- Building a skill that needs to search code or manage issues
- Integrating release management into a development pipeline
- Adding security scanning alerts to a CI/CD monitoring skill
Assumes this stack
description: Comprehensive GitHub operations including repository management, issues, pull requests, code search, workflows, and release management argument-hint: [operation] [parameters] model: inherit
GitHub Operations
Perform GitHub operations using the full suite of GitHub MCP tools. This skill provides comprehensive access to GitHub functionality including repository search, code search, issue management, pull request operations, workflow management, and release handling.
Variables
OPERATION: $1 - The GitHub operation to perform PARAMETERS: $2 - Operation-specific parameters as JSON
Available Operations
Repository Operations
search_repositories - Find repositories
{
"query": "language:typescript stars:>100",
"sort": "stars|forks|updated",
"order": "asc|desc",
"perPage": 30
}
get_file_contents - Read repository files
{
"owner": "username",
"repo": "repository",
"path": "path/to/file.ts",
"ref": "branch-name"
}
Code Search
search_code - Search across all GitHub repositories
{
"query": "function handleSubmit language:typescript",
"sort": "indexed",
"order": "desc"
}
Issue Management
list_issues - List repository issues
{
"owner": "username",
"repo": "repository",
"state": "OPEN|CLOSED",
"labels": ["bug", "enhancement"],
"perPage": 30
}
issue_read - Get issue details
{
"owner": "username",
"repo": "repository",
"issue_number": 123,
"method": "get|get_comments|get_labels"
}
list_issue_types - List available issue types for organization
{
"owner": "organization"
}
Pull Request Operations
list_pull_requests - List pull requests
{
"owner": "username",
"repo": "repository",
"state": "open|closed|all",
"sort": "created|updated|popularity",
"direction": "asc|desc"
}
search_pull_requests - Search PRs with advanced filters
{
"owner": "username",
"repo": "repository",
"query": "is:pr author:username label:bug",
"sort": "created|updated|comments",
"order": "asc|desc"
}
pull_request_read - Get PR details
{
"owner": "username",
"repo": "repository",
"pullNumber": 456,
"method": "get|get_diff|get_status|get_files|get_review_comments|get_reviews|get_comments"
}
Commit Operations
list_commits - List repository commits
{
"owner": "username",
"repo": "repository",
"sha": "branch-name",
"author": "username",
"perPage": 30
}
get_commit - Get commit details
{
"owner": "username",
"repo": "repository",
"sha": "commit-hash",
"include_diff": true
}
Branch and Tag Operations
list_branches - List repository branches
{
"owner": "username",
"repo": "repository",
"perPage": 30
}
list_tags - List repository tags
{
"owner": "username",
"repo": "repository",
"perPage": 30
}
get_tag - Get tag details
{
"owner": "username",
"repo": "repository",
"tag": "v1.0.0"
}
Release Management
list_releases - List repository releases
{
"owner": "username",
"repo": "repository",
"perPage": 30
}
get_latest_release - Get latest release
{
"owner": "username",
"repo": "repository"
}
get_release_by_tag - Get specific release
{
"owner": "username",
"repo": "repository",
"tag": "v1.0.0"
}
GitHub Actions
actions_list - List workflows or runs
{
"owner": "username",
"repo": "repository",
"method": "list_workflows|list_workflow_runs",
"resource_id": "workflow-id-or-filename"
}
actions_get - Get workflow details
{
"owner": "username",
"repo": "repository",
"method": "get_workflow|get_workflow_run|get_workflow_job",
"resource_id": "workflow-id"
}
get_job_logs - Get workflow job logs
{
"owner": "username",
"repo": "repository",
"job_id": 12345,
"return_content": true,
"tail_lines": 500
}
Security Scanning
list_code_scanning_alerts - List code scanning alerts
{
"owner": "username",
"repo": "repository",
"state": "open|closed|dismissed|fixed",
"severity": "critical|high|medium|low"
}
get_code_scanning_alert - Get alert details
{
"owner": "username",
"repo": "repository",
"alertNumber": 1
}
list_secret_scanning_alerts - List secret scanning alerts
{
"owner": "username",
"repo": "repository",
"state": "open|resolved"
}
get_secret_scanning_alert - Get secret alert details
{
"owner": "username",
"repo": "repository",
"alertNumber": 1
}
User Search
search_users - Find GitHub users
{
"query": "location:seattle followers:>100",
"sort": "followers|repositories|joined",
"order": "asc|desc"
}
Label Management
get_label - Get repository label
{
"owner": "username",
"repo": "repository",
"name": "bug"
}
Workflow
- Parse Operation - Determine which GitHub operation to perform from OPERATION parameter
- Validate Parameters - Ensure PARAMETERS contains required fields for the operation
- Execute Operation - Call appropriate GitHub MCP tool with parameters
- Format Results - Present results in a clear, actionable format
- Handle Errors - Provide helpful error messages if operation fails
Usage Examples
Search for repositories:
Operation: search_repositories
Parameters: {"query": "language:typescript mcp server", "sort": "stars"}
List open issues:
Operation: list_issues
Parameters: {"owner": "anthropics", "repo": "mcp", "state": "OPEN"}
Get PR diff:
Operation: pull_request_read
Parameters: {"owner": "user", "repo": "repo", "pullNumber": 42, "method": "get_diff"}
Check workflow status:
Operation: actions_list
Parameters: {"owner": "user", "repo": "repo", "method": "list_workflow_runs"}
Search code across GitHub:
Operation: search_code
Parameters: {"query": "createServer language:typescript"}
Best Practices
- Use specific queries to narrow results
- Leverage pagination for large result sets
- Cache frequently accessed data when appropriate
- Handle rate limits gracefully
- Provide clear error messages
- Format output for readability
- Include relevant links to GitHub UI
- Combine multiple operations for complex workflows
Error Handling
- Check for authentication errors
- Handle rate limiting with exponential backoff
- Validate repository/owner existence
- Provide actionable error messages
- Suggest corrections for invalid parameters
What's inside
10 operation groups, 28 JSON parameter templates, 5 workflow steps, 5 usage examples
Change this for your project
- Replace
"owner": "username"with your GitHub username or organization - Replace
"repo": "repository"with your repository name - Replace
"owner": "organization"in list_issue_types with your org name
Where it goes
Save as SKILL.md inside a skill folder. Loaded when the agent selects that skill.
Worth borrowing
- Parameterized operation dispatch via a single OPERATION variable
- JSON parameter templates that mirror the GitHub API shape exactly
Related Documents
Video Script
Guides an AI to write ready-to-film two-column AV scripts with hooks, segment breakdowns, B-roll cues, text overlays, timing estimates, and shot lists.
Image Generation Skill
Provides Python functions for generating, editing, and transforming images via DALL-E 3, FLUX (Replicate/fal.ai), and local Stable Diffusion, plus utilities and prompt engineering helpers.
AI Artist — Engineering Specification
Defines a 21-section engineering specification for a prompt construction skill, covering contracts, deterministic design, error taxonomy, and production readiness.
Karis
Turns an AI agent into a marketing CMO with brand analysis, SEO audits, Reddit monitoring, and viral tweet optimization via CLI or API.