VS Code Github Copilot calling create_pull_request_with_copilot on remote MCP using fine-grained PAT gets 401
維護者通常 4 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- github, vscode
- 領域
- api, authentication
研究方向
首先,使用 issue 中描述的 VS Code 設定和 fine-grained PAT,針對遠端 Copilot MCP endpoint 重現 create_pull_request_with_copilot。將它與 list_branches 和 repos MCP endpoint 進行比較,然後追蹤驗證流程;完成的標準是該函式回傳 pull request URL,而不是 401 回應。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
The create_pull_request_with_copilot function from the remote GitHub MCP server (https://api.githubcopilot.com/mcp/x/copilot) consistently returns "API returned status 401: Unauthorized" even when authentication appears to be properly configured. This affects the ability to create pull requests programmatically through GitHub Copilot's MCP integration.
Affected version
Remote GitHub MCP Server: https://api.githubcopilot.com/mcp/x/copilot
(This is the hosted service, not the self-hosted Docker version)
Steps to reproduce the behavior
-
Create fine grained PAT
Repository access This token has access to all repositories owned by the organization. Organization permissions Read access to organization administration, organization copilot seat management, and organization private registries Repository permissions Read access to metadata Read and Write access to actions, administration, code, codespaces, issues, pull requests, and workflows -
Make sure the owner of the PAT has a copilot seat and the copilot coding agent is enabled for the target repositories
- I was able to assign a task to the coding agent using github.com UI in the target repo and get a pull request from it.
-
Make sure other tools work with the PAT
- I tested
list_brancheson the target repositories with the PAT and it worked
- I tested
-
Configure VS Code with GitHub Copilot authentication a the remote MCP server at
https://api.githubcopilot.com/mcp/x/copilot"github_copilot": { "type": "http", "url": "https://api.githubcopilot.com/mcp/x/copilot", "headers": { "Authorization": "Bearer ${github_pat}" } }, -
Call
mcp_github_copilo_create_pull_request_with_copilotwith valid parameters:{ "owner": "org", "repo": "repo", "base_ref": "release/2025.8.21", "title": "Fix bug", "problem_statement": "Fix this bug..." } -
Observe the 401 Unauthorized error response
{ "kind": "toolInvocationSerialized", "invocationMessage": { "value": "Running Perform task with GitHub Copilot coding agent", "isTrusted": false, "supportThemeIcons": false, "supportHtml": false }, "pastTenseMessage": { "value": "Ran Perform task with GitHub Copilot coding agent ", "isTrusted": false, "supportThemeIcons": false, "supportHtml": false }, "originMessage": { "value": "[github\\_copilot \\(MCP Server\\)](command:workbench.mcp.showConfiguration?%255B%2522mcp.config.usrlocal%2522%252C%2522mcp.config.usrlocal.github_copilot%2522%255D)", "isTrusted": true, "supportThemeIcons": false, "supportHtml": false }, "isConfirmed": true, "isComplete": true, "resultDetails": { "input": "{\n \"owner\": \"org\",\n \"repo\": \"repo\",\n \"base_ref\": \"release/2025.8.21\",\n \"title\": \"Fix bug\",\n \"problem_statement\": \"Fix bug...\"\n}", "output": [ { "type": "embed", "isText": true, "value": "API returned status 401: Unauthorized\n" } ], "isError": true }, "toolSpecificData": { "kind": "input", "rawInput": { "owner": "org", "repo": "repo", "base_ref": "release/2025.8.21", "title": "Fix bug", "problem_statement": "Fix bug..." } }, "toolCallId": "eb01d33e-8afb-4b0e-b014-5a1150131e91", "toolId": "mcp_github_copilo_create_pull_request_with_copilot" }
Expected vs actual behavior
Expected: The function should successfully create a pull request using GitHub Copilot's PR creation capabilities, returning a success response with the PR URL.
Actual: The function returns "API returned status 401: Unauthorized" indicating authentication failure, despite having valid GitHub Copilot authentication configured in VS Code.
Additional Context
- Using the remote GitHub MCP server at
https://api.githubcopilot.com/mcp/x/copilot(not Docker version) - The
create_pull_request_with_copilotfunction is only available in this remote server, not in the self-hosted version - GitHub Copilot is properly authenticated in VS Code and other Copilot features work correctly
- Other GitHub MCP functions from the repos server (
https://api.githubcopilot.com/mcp/x/repos) work correctly with the same authentication setup - The issue appears to be specific to the Copilot MCP server endpoint or the PR creation function
- This blocks automated workflows that depend on programmatic PR creation through Copilot
- The error suggests either insufficient permissions for the Copilot service or an issue with the authentication flow between the MCP client and the remote Copilot server
- 主要語言
- Go
- 星號
- 33.4k
- 分支
- 5.1k
- 平均合併
- 3 天 1 小時
- 30 天內合併 PR
- 35
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/github-mcp-server 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
github/github-mcp-server#3450 ·
維護者通常 4 天內回覆
-
request ai review
難度 2/5 1-3 小時 新手友好度 74/100
github/github-mcp-server#3439 ·
維護者通常 4 天內回覆
-
get_job_logs with failed_only misses failed jobs after the first 30 jobs of a run可能已有人在做 @jayhemnani9910 於 2 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 74/100
github/github-mcp-server#3428 ·
維護者通常 4 天內回覆
-
create_or_update_file writes to the wrong file when the path contains # or ?可能已有人在做 @jayhemnani9910 於 2 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
github/github-mcp-server#3427 ·
維護者通常 4 天內回覆
-
pull_request_read drops merge_commit_sha可能已有人在做 @thejdubb02 於 31 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 84/100
github/github-mcp-server#3235 · 1 則留言 ·
維護者通常 4 天內回覆
查看 github/github-mcp-server 的全部 Issue
相似的 Issue
-
proxy logs "no user in context" at error level for every data gateway download可能已有人在做 @paul43210 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 83/100
txn2/mcp-data-platform#2063 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 83/100
kubernetes-sigs/kueue#16990 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 1 天內回覆
-
enhancement exporter/awss3 needs triage
難度 2/5 1-3 小時 新手友好度 66/100
open-telemetry/opentelemetry-collector-contrib#51905 · 1 則留言 ·
維護者通常 1 天內回覆