GitHub Operations
Use the GitHub MCP Server to manage repositories, issues, pull requests, and file operations.
When to Use
Use this skill when you need to automate GitHub-related tasks such as managing issues, reviewing pull requests, or performing remote file commits.
Prerequisites
- GitHub MCP server installed and configured.
- Valid
GITHUB_TOKEN with appropriate scopes available in the environment.
Capabilities
- Repository Management: Search, fork, and configure repositories.
- Issue Tracking: Create, list, search, and comment on issues.
- Pull Requests: Create, review, merge, and update PRs.
- File Operations: Read, write (commit), and delete files remotely.
- Branch Management: Create, list, and delete branches.
Process
- Authentication: Ensure
GITHUB_TOKEN is available in the environment.
- Context Loading: Use
search_repositories or list_repositories to find the target.
- Operation: Execute the specific tool (e.g.,
create_issue, get_file_contents).
- Verification: Check operations (e.g., verify PR creation).
Example Usage
Creating an Issue
response = await client.chat.completions.create(
messages=[{"role": "user", "content": "Create a bug report for the login crash"}],
tools=[{
"type": "mcp",
"name": "github",
"command": "docker", # Managed by MCP config
"args": ["run", ...]
}]
)
Reading a File
# Get content of README.md
content = await github.get_file_contents(
owner="owner-name",
repo="repo-name",
path="README.md"
)
Best Practices
- Security: Never hardcode tokens; use environment variables.
- Scope: Verify the token has appropriate permissions (repo, read:org, etc.).
- Rate Limiting: Be mindful of API limits when performing bulk operations.
Related
- MCP Server:
github-mcp-server
1---2agents:3- knowledge-operations-specialist4category: routing5description: 'GitHub operations and repository management using the GitHub MCP Server67 '8knowledge:9- none10name: operating-github11related_skills:12- none13templates:14- none15tools:16- none17type: skill18version: 1.0.019references:20- none21settings:22 auto_approve: false23 retry_limit: 324 timeout_seconds: 30025 safe_to_parallelize: false26 orchestration_pattern: routing27---2829# GitHub Operations3031Use the GitHub MCP Server to manage repositories, issues, pull requests, and file operations.3233## When to Use34Use this skill when you need to automate GitHub-related tasks such as managing issues, reviewing pull requests, or performing remote file commits.3536## Prerequisites37- GitHub MCP server installed and configured.38- Valid `GITHUB_TOKEN` with appropriate scopes available in the environment.3940## Capabilities4142- **Repository Management**: Search, fork, and configure repositories.43- **Issue Tracking**: Create, list, search, and comment on issues.44- **Pull Requests**: Create, review, merge, and update PRs.45- **File Operations**: Read, write (commit), and delete files remotely.46- **Branch Management**: Create, list, and delete branches.4748## Process49501. **Authentication**: Ensure `GITHUB_TOKEN` is available in the environment.512. **Context Loading**: Use `search_repositories` or `list_repositories` to find the target.523. **Operation**: Execute the specific tool (e.g., `create_issue`, `get_file_contents`).534. **Verification**: Check operations (e.g., verify PR creation).5455## Example Usage5657### Creating an Issue58```python59response = await client.chat.completions.create(60 messages=[{"role": "user", "content": "Create a bug report for the login crash"}],61 tools=[{62 "type": "mcp",63 "name": "github",64 "command": "docker", # Managed by MCP config65 "args": ["run", ...]66 }]67)68```6970### Reading a File71```python72# Get content of README.md73content = await github.get_file_contents(74 owner="owner-name",75 repo="repo-name",76 path="README.md"77)78```7980## Best Practices8182- **Security**: Never hardcode tokens; use environment variables.83- **Scope**: Verify the token has appropriate permissions (repo, read:org, etc.).84- **Rate Limiting**: Be mindful of API limits when performing bulk operations.8586## Related87- MCP Server: `github-mcp-server`