Hosted MCP `get_check_runs` fails with 403 where the equivalent REST call succeeds
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- github, go
- 领域
- api, authentication, security
调研方向
从 get_check_runs 方法的 pull_request_read 入口开始,将其 hosted 身份验证和权限路径与此处描述的成功 REST 请求进行比较。检查 #1942 引入的更改;完成的标准是:对于报告的 private repository 情况,hosted 方法能够返回 check runs;或者在无法更改 hosted installation 的情况下,明确记录所需的权限。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
pull_request_read with method: get_check_runs returns 403 Resource not accessible by personal access token [] for a private repo that the same classic PAT can read via the plain REST API (gh pr checks / GET /repos/{owner}/{repo}/commits/{ref}/check-runs). Every other pull_request_read method (get, get_files, get_reviews, get_review_comments, etc.) works with that token on the same PR — only get_check_runs fails.
This means the method shipped via #1942 is effectively unusable against repos where the user's PAT is fine but the underlying MCP app installation is missing Checks: Read. The caller cannot fix it by adding PAT scopes, since the failing call isn't authenticated with the caller's PAT permission surface.
Affected version
Hosted remote MCP at https://api.githubcopilot.com/mcp/. github-mcp-server --version not available for the hosted deployment.
Steps to reproduce the behavior
- Authenticate the hosted Copilot MCP with a classic PAT that has
repo,read:org, and SSO authorization for the org hosting a private repo.k - Invoke
mcp__github__pull_request_readwith:method: get_check_runs owner: <org> repo: <private-repo> pullNumber: <N> - From a local shell using the same PAT:
returns 200 with the full check-runs payload.gh api /repos/<org>/<private-repo>/commits/<head-sha>/check-runs
Expected vs actual behavior
Expected: MCP get_check_runs returns the same payload as the REST API.
Actual:
failed to get check runs: GET https://api.github.com/repos/<org>/<private-repo>/commits/<sha>/check-runs?page=1&per_page=30: 403 Resource not accessible by personal access token []
All other pull_request_read methods succeed against the same PR with the same token.
Logs
Error string as surfaced to the MCP client:
failed to get check runs: GET https://api.github.com/repos/<org>/<private-repo>/commits/<sha>/check-runs?page=1&per_page=30: 403 Resource not accessible by personal access token []
Notes
- Feature was added in #1942 (closed). This report is a regression / follow-up: the method is reachable but consistently 403s under hosted-MCP auth where the caller's PAT has
repo. - Likely fix direction: ensure the hosted MCP's GitHub App installation requests
Checks: Read, or document the fine-grained permission requirement alongside the tool description.
Remark: This issue was analyzed and the report was created with Claude Code.
- 主要语言
- Go
- 星标
- 33.1k
- 派生
- 5k
- 平均合并
- 2 天 1 小时
- 30 天内合并 PR
- 25
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/github-mcp-server 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
github/github-mcp-server#3235 ·
-
enhancement
难度 1/5 1 小时以内 新手友好度 88/100
github/github-mcp-server#3042 · 2 条评论 ·
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
github/github-mcp-server#3032 · 1 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 74/100
github/github-mcp-server#2803 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
github/github-mcp-server#2740 ·
查看 github/github-mcp-server 的全部 Issue
相似的 Issue
-
area/dev-productivity area/disaster-recovery area/ipcei kind/enhancement
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 1/5 1 小时以内 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
kind/bug status/0-triage
难度 2/5 1-3 小时 新手友好度 75/100
-
🤔 refinement needed
难度 2/5 1-3 小时 新手友好度 75/100
equinor/radix-operator#1979 ·