github / github/github-mcp-server

Hosted MCP cannot resolve review threads with a fine-grained PAT that succeeds via GraphQL

未關閉
#3,249 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
ai:bug-report-review:unable-to-process bug server
主要語言
Go
星號
33k
分支
5k
平均合併
2 天 1 小時
30 天內合併 PR
52

描述

## Summary

GitHub hosted remote MCP fails to resolve pull request review threads with a fine-grained personal access token, returning:

```text
Resource not accessible by personal access token
```

The same token successfully performs both `unresolveReviewThread` and `resolveReviewThread` through GitHub GraphQL. This appears related to #2381, which reports a different hosted-MCP PR operation failing while the equivalent direct API request succeeds.

## Environment

- Server: GitHub-hosted remote MCP
- Endpoint: `https://api.githubcopilot.com/mcp/`
- Transport: Remote HTTP
- Client: OpenCode
- Authentication: fine-grained PAT supplied in the `Authorization: Bearer` header
- MCP toolsets: `repos,issues,pull_requests`
- Repository: `crsiebler/pogo-gbl-analyzer`
- Token repository permission: **Pull requests: Read and write**
- Approximate failure time: `2026-09-08 05:35 UTC`

## Reproduction

1. Configure the hosted server with `oauth: false`, the endpoint above, an `Authorization: Bearer {env:GITHUB_MCP_TOKEN}` header, and `X-MCP-Toolsets: repos,issues,pull_requests`.
2. Authenticate with a fine-grained PAT that has access to `crsiebler/pogo-gbl-analyzer` and **Pull requests: Read and write**.
3. Read review threads for `crsiebler/pogo-gbl-analyzer#10`.
4. Attempt to resolve `PRRT_kwDOPgvNY86gGnRD` with the MCP review-thread resolution tool.
5. Observe:

```text
failed to resolve review thread: Resource not accessible by personal access token
```

## Expected Behavior

The MCP operation resolves the review thread, matching GitHub GraphQL behavior for the same token.

## Actual Behavior

The MCP operation returns a personal-access-token authorization error. Other writes succeeded in the same MCP workflow: inline replies were posted to five pull request review-comment threads.

## Direct GraphQL Verification

Using the same fine-grained PAT outside MCP, unresolving the thread succeeded:

```bash
GH_TOKEN=github_pat_REDACTED gh api graphql \
-f query='mutation($threadId: ID!) {
unresolveReviewThread(input: {threadId: $threadId}) {
thread { id isResolved }
}
}' \
-f threadId='PRRT_kwDOPgvNY86gGnRD'
```

Response:

```json
{
"data": {
"unresolveReviewThread": {
"thread": {
"id": "PRRT_kwDOPgvNY86gGnRD",
"isResolved": false
}
}
}
}
```

Resolving it again with the same token also succeeded:

```bash
GH_TOKEN=github_pat_REDACTED gh api graphql \
-f query='mutation($threadId: ID!) {
resolveReviewThread(input: {threadId: $threadId}) {
thread { id isResolved }
}
}' \
-f threadId='PRRT_kwDOPgvNY86gGnRD'
```

Response:

```json
{
"data": {
"resolveReviewThread": {
"thread": {
"id": "PRRT_kwDOPgvNY86gGnRD",
"isResolved": true
}
}
}
}
```

## Impact

Agents can reply to inline review feedback but cannot complete the normal review workflow by resolving addressed threads through the hosted GitHub MCP server, despite the configured PAT being authorized for the underlying GraphQL mutation.

## Notes

- The token value is intentionally omitted.
- The hosted endpoint does not expose a locally inspectable server version.
- Inline reply timestamps immediately preceding the failure were `2026-09-08T05:35:45Z` and `2026-09-08T05:35:46Z`.

貢獻指南

開啟貢獻指南

研究方向

Start at the hosted MCP review-thread resolution tool entry point and reproduce the failure using the listed endpoint, toolsets, and fine-grained PAT. Compare the operation's authorization path with the successful GraphQL resolveReviewThread mutation. Done means the MCP operation resolves the review thread with the same token and preserves the existing inline-reply behavior.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
github, go
領域
api, authentication, backend
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
活躍
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。