anthropics / anthropics/claude-code

[BUG] GitHub Connector — "state: Field required" error blocks repo access

Đang mở
#92,284 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
invalid
Ngôn ngữ chính
Python
Star
145k
Fork
23.1k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code

### What's Wrong?

The GitHub connector shows as "Connected" in Claude's Settings → Connectors, but Claude never gets access to any repositories — no GitHub tools appear in any chat (including brand-new chats), and the DanceUp repo can't be checked.

Digging into GitHub's own settings showed the root of it:

Installed GitHub Apps (github.com/settings/installations) — showed no apps installed
Authorized OAuth Apps — empty
Authorized GitHub Apps — "Claude" and "Claude Github MCP Connector" both listed as authorized, both marked "Never used"

So the app had been authorized (OAuth-level consent) but never actually installed with repository access — which is why nothing ever synced to Claude no matter how many times the connector was reconnected on Claude's side.

Steps already tried
Disconnected and reconnected the GitHub Integration in Claude's Connectors settings — multiple times
Fully uninstalled and reinstalled the app on GitHub's side (not just disconnect)
Attempted a manual install directly from GitHub (Configure/Install button), granting "All repositories" access
Error encountered

During the manual install attempt, GitHub redirected to Claude's callback URL:

claude.ai/api/mcp/auth_callback?code=d58fa01116138073fab5&installation_id=159210758&setup_action=install

Which returned:

json
{"type":"error","error":{"type":"invalid_request_error","message":"state: Field required"},"request_id":"req_011CejsPj9nGSuvh4FAMCsQ3"}

This happened consistently across repeated attempts.

Current state

Went back into the GitHub app's installation settings (Permissions / Repository access page) and found that an installation now genuinely exists — installation_id=159210758 — with "All repositories" access configured. So GitHub did create the installation despite the callback erroring out. Claude's side, however, never completes the link: no GitHub tools show up in Claude regardless of how many fresh chats are tried.

### What Should Happen?

Either:

Claude's auth_callback endpoint should accept this callback instead of erroring on a missing state parameter, so the connector setup completes normally, or
The existing installation (installation_id=159210758) should be manually linked/synced to my account on the backend.

### Error Messages/Logs

```shell

```

### Steps to Reproduce

Go to github.com/settings/applications → Authorized GitHub Apps, and click into "Claude Github MCP Connector" (it shows as authorized but "Never used").
From the app's page, click Configure / Install.
On the Permissions & Repository access page, select "All repositories" and click Save.
GitHub redirects to claude.ai/api/mcp/auth_callback?code=...&installation_id=159210758&setup_action=install.
Instead of completing the connection, the page returns the state: Field required JSON error shown below.
Checking Claude's Connectors settings afterward still shows GitHub as not properly linked — no GitHub tools are available in any chat, new or old.

### Claude Model

Sonnet (default)

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

The claude command isn't on PATH in this shell environment, so I can't run claude --version directly here (this session itself is running inside Claude Code, but the CLI binary isn't resolvable in this particular shell).

### Platform

Anthropic API

### Operating System

Windows

### Terminal/Shell

Windows Terminal

### Additional Information

Request

Could someone take a look at linking installation 159210758 to my account, or point me to a workaround in the meantime? Happy to provide more screenshots or details if useful.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start from the GitHub connector install flow and the claude.ai/api/mcp/auth_callback endpoint mentioned in the report. Use the callback URL parameters, installation_id=159210758, and request_id=req_011CejsPj9nGSuvh4FAMCsQ3 to inspect backend handling of missing state. Done means the install callback completes or the existing installation is linked so GitHub tools appear in new chats.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
github, python
Lĩnh vực
api, authentication, backend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
32/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.