Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Hosted MCP `get_check_runs` fails with 403 where the equivalent REST call succeeds

未关闭
#2,381 1 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
github, go

调研方向

从 get_check_runs 方法的 pull_request_read 入口开始,将其 hosted 身份验证和权限路径与此处描述的成功 REST 请求进行比较。检查 #1942 引入的更改;完成的标准是:对于报告的 private repository 情况,hosted 方法能够返回 check runs;或者在无法更改 hosted installation 的情况下,明确记录所需的权限。

由索引模型根据 Issue 内容生成。

描述

bug request ai review
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
  1. 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
  2. Invoke mcp__github__pull_request_read with:
    method: get_check_runs
    owner: <org>
    repo:  <private-repo>
    pullNumber: <N>
    
  3. From a local shell using the same PAT:
    gh api /repos/<org>/<private-repo>/commits/<head-sha>/check-runs
    
    returns 200 with the full check-runs payload.
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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/github-mcp-server 的其他 Issue

查看 github/github-mcp-server 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。