`add_issue_comment`, `update_issue`, and `get_issue` reject valid integer `issue_number`
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
從 add_issue_comment、update_issue 和 get_issue 的實作及請求驗證路徑入手,重點關注將 issue_number 插值到 URL 路徑中。使用整數重現這些呼叫,並將其與 milestone 之類的正常運作整數參數進行比較。完成標準是 issue_number 的整數值能夠通過驗證並到達相應的 GitHub REST 端點,且三個工具都有回歸測試涵蓋。
由索引模型根據 Issue 內容生成。
描述
Summary
Three endpoints that take issue_number as a required parameter consistently fail when invoked with an integer, even though the tool schema declares issue_number as number. Other endpoints on the same server that take integer parameters work correctly, and the failure survives reconnecting the MCP server.
Affected tools
add_issue_commentupdate_issueget_issue
Unaffected tools (for comparison, same session, same repo, same auth)
create_issue— succeeds (does not takeissue_number)list_issues,search_issues— succeedcreate_branch,create_or_update_file,push_files,create_pull_request— all succeed, including calls with integer fields likemilestone
Reproduction
- Any repo the caller can write issues on.
- Call, e.g.:
{ "tool": "add_issue_comment", "arguments": { "owner": "<owner>", "repo": "<repo>", "issue_number": 11, "body": "test" } } - Call fails. Retrying multiple times, including after fully reconnecting the MCP server, reproduces the failure.
create_issueagainst the same repo in the same session succeeds, ruling out auth, permissions, and rate limiting.- Reproduced across at least two independent sessions on the same day.
Expected
Comment is posted / issue is updated / issue is fetched, matching a direct REST call to POST /repos/{owner}/{repo}/issues/{issue_number}/comments (etc.).
Actual
Call is rejected before it reaches GitHub. The failure pattern is consistent with issue_number being serialised as a string somewhere in the request pipeline and then rejected by the server's own integer validation.
[TODO fill in with error string on next occurrence]
Hypothesis
The three broken endpoints are exactly the ones where issue_number is templated into a URL path segment (/repos/{owner}/{repo}/issues/{issue_number}[/comments]), whereas the working endpoints pass their integers in the request body or query string. Likely culprits:
- A path-parameter substitution step stringifies the value before an internal validator runs.
- A schema-validation layer runs after path substitution and sees a string where a
numberis required.
Anywhere issue_number is interpolated into a URL is worth checking first.
Affected version
- MCP server: GitHub MCP http server
- Transport: stdio.
- Client: custom provider
Workaround
None from the client side; the caller cannot influence how the server serialises the parameter. Affected users have to fall back to the GitHub REST API directly or edit the issue in the web UI.
- 主要語言
- Go
- 星號
- 33.3k
- 分支
- 5.1k
- 平均合併
- 1 天 1 小時
- 30 天內合併 PR
- 19
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/github-mcp-server 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
github/github-mcp-server#3235 · 1 則留言 ·
維護者通常 1 天內回覆
-
enhancement
難度 1/5 1 小時以內 新手友好度 88/100
github/github-mcp-server#3042 · 2 則留言 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 72/100
github/github-mcp-server#3032 · 1 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
github/github-mcp-server#2803 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
github/github-mcp-server#2740 ·
維護者通常 1 天內回覆
查看 github/github-mcp-server 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
type/bug
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
[E2E Scenario Tests] HTTP logs capture export requests from test framework, polluting golden files未關閉
難度 2/5 1-3 小時 新手友好度 88/100
GoogleCloudPlatform/k8s-config-connector#13675 ·
維護者通常 1 天內回覆
-
ai-inspected
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 1 天內回覆
-
type/bug
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆