Skip to content

MCP asks RW grants for RO access #2812

Description

@4ertus2

Describe the bug

MCP with GITHUB_PERSONAL_ACCESS_TOKEN and GITHUB_READ_ONLY asks for auth with lots of write rights.

Affected version

GitHub MCP Server
Version: v1.5.0
Commit: 8cd03c0
Build Date: 2026-06-27T07:57:40Z

Steps to reproduce the behavior

  1. Create GITHUB_PERSONAL_ACCESS_TOKEN with RO-access grants
  2. Run MCP from qwen-code with such configuration
  "mcpServers": {
    "github": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/github/github-mcp-server"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "github_pat_...",
        "GITHUB_READ_ONLY": 1
      }
    }
  },
  1. Asks to show your open issues on github
  2. Find that additional MCP auth needed with lots of unwanted grants asked
   ✓ get_me (github MCP Server) {}
     Visit https://github.com/login/device and enter the code XXXX-XXXX to authorize the GitHub MCP Server.

     After authorizing, retry your request.

Expected vs actual behavior

  1. MCP use just the grants it could get from GITHUB_PERSONAL_ACCESS_TOKEN
  2. No additional authentication needed
  3. MCP disallow comands that need more grants that MCP has. Without attemps to get additional ones.

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    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