`create_branch` returns a bare 404 when the token has no push access

Open Beginner friendly
#3,994 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@aloneangel45 is already working on this.

Since Dec 1, 2026.

  • #3995 by @aloneangel45 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
github, go

Research direction

Start by locating the create_branch tool implementation and its error handling for the GitHub git/refs request; compare it with request_copilot_review and its copilotReviewErrMsg, both mentioned in the issue. Add a hint for the case where the caller can read the private repository but lacks push access, and check that other 404 causes remain understandable.

Written by the indexing model from the issue text.

Description

Describe the bug

create_branch fails with 404 Not Found on a private repo I can read but can't push to. My agent took the 404 for a wrong repo or base branch and needed gh api repos/<owner>/<repo> --jq .permissions to find the cause. request_copilot_review explains this same 404 (copilotReviewErrMsg), so I think the write tools could do the same. Would you take a PR for create_branch, or would you rather have it in one place for all write tools?

Affected version

Remote server (https://api.githubcopilot.com/mcp/), 2026-12-01

Steps to reproduce the behavior
  1. Pick a private repo where permissions.push is false for your user
  2. Call create_branch with owner, repo and branch
Expected vs actual behavior

Actual: failed to create branch: POST https://api.github.com/repos/<owner>/<repo>/git/refs: 404 Not Found []

Expected: the same error plus a hint that you can read the repo but your credentials have no write access

Dominant language
Go
Stars
34.8k
Forks
5.4k
Avg merge
2d 15h
Merged PRs (30d)
34

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/github-mcp-server

All issues in github/github-mcp-server

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.