anthropics / anthropics/claude-code
[BUG] GitHub Connector — "state: Field required" error blocks repo access
- 主要语言
- Python
- 星标
- 145k
- 派生
- 23.1k
- PR 合并指标
- PR 指标待抓取
描述
### 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.
贡献指南
这个仓库没有索引到贡献指南
调研方向
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.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- github, python
- 领域
- api, authentication, backend
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 32/100