anthropics / anthropics/claude-code

MCP server (Gitea) fails auth in Desktop app, connects immediately after resuming same session in Terminal app, no config changes

未关闭
#91,307 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:desktop area:mcp bug has repro platform:macos
主要语言
Python
星标
145k
派生
23.1k
PR 合并指标
PR 指标待抓取

描述

## Description
An MCP server (Gitea MCP, project-scoped) fails to authenticate when called from the Claude macOS Desktop app — returning a connection/auth error — even though nothing about the token or MCP configuration has changed. Resuming the exact same session in the Claude Code Terminal app immediately resolves the issue and the same server works without any intervention.

This differs from #88758 (server never appears in `/mcp` at all on Desktop): here the server *does* connect, but fails auth on Desktop specifically, then succeeds with identical config once the session is resumed in the Terminal app. Reportedly not isolated to Gitea — the same pattern has been observed with other MCP servers in the same project.

## Environment
- Claude Desktop app (macOS)
- Claude Code Terminal app (macOS)
- macOS: 25.6.0 (Darwin)
- Project uses a project-scoped Gitea MCP server (self-hosted Gitea instance)

## Steps to reproduce
1. Start a session in the Claude Desktop app in a project with a project-scoped MCP server configured (e.g. Gitea).
2. Ask Claude to use that MCP server (e.g. list Actions runs).
3. Call fails with an auth/connection error (e.g. `401: invalid username, password or token`).
4. Without changing any token, `.mcp.json`, or `.claude/settings.local.json`, resume the same session in the Claude Code Terminal app.
5. Ask Claude to retry the identical MCP call.
6. Call succeeds immediately.

## Expected
MCP server authentication should behave consistently across host apps (Desktop vs. Terminal) for the same session and unchanged configuration/credentials.

## Actual
Desktop app's MCP connection appears to use stale or improperly established auth state; the Terminal app's session-resume re-establishes the connection correctly with the same credentials.

## Notes
- No config, token, or credential changes were made between the failed attempt and the successful one — only the host app changed (Desktop → Terminal, via session resume).
- This may share a root cause with #88758 (Desktop's MCP session bridge / "DO bridge" mechanism not behaving like the CLI's normal MCP loading path), but the failure mode is different enough (silent absence vs. connect-then-auth-fail) to warrant tracking separately.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Reproduce with a project-scoped MCP server on Claude Desktop for macOS, then resume the same session in the Claude Code Terminal app without changing .mcp.json or .claude/settings.local.json. Compare this failure mode with #88758 and focus on Desktop vs CLI MCP session/auth loading. Done means the same credentials authenticate consistently in both host apps.

由索引模型根据 Issue 内容生成。

评估

技术栈
macos, python
领域
ai-infra-agents, authentication, cli, desktop
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。