GitHub Workflow
Prerequisites
brew install gh git
gh auth login
Configure MCP in .cursor/mcp.json:
{
"mcpServers": {
"github-local": {
"command": "npx",
"args": ["-y", "github:valentierro/mcp-github"]
}
}
}
Standard flow
auth_status— confirm gh is authenticated.list_repos— find the target repo (owner defaults to@me).clone_repo— clone to a known path if not local.git_checkout— create/switch branch for the task.- Make changes in the workspace.
git_status— review before commit (use shellgit commitper user rules).git_push— push withsetUpstream: trueon new branches.create_pull_request— open PR via gh.
Tool selection
| Task | MCP tool |
|---|---|
| List all repos | list_repos |
| Clone | clone_repo |
| Sync local | sync_repo |
| Push | git_push |
| Open PR | create_pull_request |
| API-only (issues, code search) | Official github/github-mcp-server |
Safety
- Never force-push
main/masterunless explicitly requested. - Never commit unless the user asks.
- Prefer
sync_repobefore starting work on stale branches.
Account
Default GitHub user: valentierro