VS Code Github Copilot calling create_pull_request_with_copilot on remote MCP using fine-grained PAT gets 401
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github, vscode
- Lĩnh vực
- api, authentication
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện create_pull_request_with_copilot trên endpoint MCP Copilot từ xa bằng cấu hình VS Code và fine-grained PAT được mô tả trong issue. So sánh nó với list_branches và endpoint MCP repos, sau đó lần theo luồng xác thực; hoàn tất có nghĩa là hàm trả về URL pull request thay vì phản hồi 401.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Go
- Star
- 33.1k
- Fork
- 5k
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 25
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/github-mcp-server
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
github/github-mcp-server#3235 ·
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
github/github-mcp-server#3042 · 2 bình luận ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/github-mcp-server#3032 · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
github/github-mcp-server#2803 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
github/github-mcp-server#2740 ·
Tất cả issue của github/github-mcp-server
Issue tương tự
-
Remove PSPs from Helm chart Đang mởfeature-request helm
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
gravitational/teleport#69785 ·
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
crossplane/crossplane#7859 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100