Skip to content

403 Resource not accessible by personal access token [] #283

Open
@algoORgoal

Description

@algoORgoal

Describe the bug

When attempting to create a pull request using the mcp_github_create_pull_request tool, the operation fails with a 403 error despite having what appears to be a valid personal access token configured.

Affected version

docker run -i --rm ghcr.io/github/github-mcp-server ./github-mcp-server --version

server version v0.1.1 (7ab5d96) 2025-04-07T16:05:06Z

(Version information to be added after running the command)

Steps to reproduce the behavior

  1. Configure GitHub PAT in ~/.cursor/mcp.json (macOS)
  2. Run a workflow using the GitHub MCP tools
  3. Attempt to create a pull request using mcp_github_create_pull_request
  4. Observe the error response

mcp.json

{
  "mcpServers": {
    "Framelink Figma MCP": {
      "command": "npx",
      "args": [
        "-y",
        "figma-developer-mcp",
        "--figma-api-key=...",
        "--stdio"
      ]
    },
    "github": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN",
        "ghcr.io/github/github-mcp-server"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..."
      }
    },
    "toolbox": {
      "command": "npx",
      "args": [
        "-y",
        "@smithery/cli@latest",
        "run",
        "@smithery/toolbox",
        "--key",
        "..."
      ]
    }
  }
}

Expected vs actual behavior

Expected behavior:
The pull request should be created successfully in the specified repository.

Actual behavior:
The operation fails with a 403 error:

MCP error -32603: failed to create pull request: POST https://api.github.com/repos/Project-Unifest/unifest-web/pulls: 403 Resource not accessible by personal access token []

Logs

{
  "error": "MCP error -32603: failed to create pull request: POST https://api.github.com/repos/Project-Unifest/unifest-web/pulls: 403 Resource not accessible by personal access token []"
}

Additional information

  • Multiple tokens were tried (both fine-grained and classic PATs)
  • Token has appropriate repo permissions for the repository

Have a nice day, @bruce

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions