Skip to content

create_issue and create_pull_request fail with "Requires authentication" but read operations work #2317

@devTech-zhang

Description

@devTech-zhang

Bug Description

Using the GitHub MCP Server via npx in Claude Code, read operations (list_issues, get_file_contents) work fine, but write operations (create_issue, create_pull_request) fail with "Requires authentication" error.

Environment

  • @modelcontextprotocol/server-github@2025.4.8
  • Claude Code with ECC plugin
  • Token has full repo scope (verified via direct API calls work)

Steps to Reproduce

  1. Configure GitHub MCP with GITHUB_PERSONAL_ACCESS_TOKEN env var
  2. Call list_issues → succeeds
  3. Call create_issue → fails with "Requires authentication"

Expected vs Actual

  • Expected: create_issue should create an issue
  • Actual: "Requires authentication" error even though token is valid

Additional Context

Direct API calls with the same token work fine. Only MCP write operations fail.

Error Message

Authentication Failed: Requires authentication
    at githubRequest (file:///Users/xxxxx/.npm/_npx/812ed9af46615848/node_modules/@modelcontextprotocol/server-github/dist/common/utils.js:38:15)

The error occurs in the githubRequest function when attempting write operations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions