Home / Fixes

GitHub MCP: "403 Resource not accessible by personal access token" on create_pull_request

Error: failed to create pull request: POST https://api.github.com/repos/OWNER/REPO/pulls: 403 Resource not accessible by personal access token

What causes it

In our Oct 19, 2026 test of GitHub's remote MCP server (api.githubcopilot.com/mcp) with a fine-grained personal access token that had Contents and Issues set to read and write but no Pull requests permission, the agent could create a branch, commit files with create_or_update_file and push_files, and open and close issues, but create_pull_request failed with this 403. The same message comes back for any write to a repo outside the token's repository list: our create_branch on a repo the token did not cover got it too.

How to fix it

  1. Edit the token under GitHub Settings > Developer settings > Fine-grained tokens and set Pull requests to Read and write for the repo. Contents: write alone lets an agent push a branch but not open the PR.
  2. Check that the token's Repository access includes the target repo. Outside it, reads of public repos still work, but every write returns this 403.
  3. If the repo belongs to an organization, the organization may need to approve fine-grained tokens before they can write.
  4. In a plain MCP client, use a token: in our Oct 16 test GitHub's server refused OAuth dynamic client registration ("Incompatible auth server").

Where we hit it

Related fixes

All MCP fixes | Setup guides | Hit a different error? Request a test