anthropics / anthropics/claude-ai-mcp

claude.ai connector advertises MCP 2026-07-28 but surfaces a state-only InputRequiredResult as "Error occurred during tool execution" and never retries

未关闭
#1,027 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
没有语言数据
星标
471
派生
76
PR 合并指标
30 天内没有已合并 PR

描述

## Summary

The claude.ai MCP client (`clientInfo` name `Anthropic/ClaudeAI`, version `1.0.0`) sends 2026-07-28 requests and handles ordinary `resultType: "complete"` results, but when a `tools/call` returns a state-only `InputRequiredResult` (`resultType: "input_required"` with `requestState` and no `inputRequests`) it shows the user "Error occurred during tool execution" and never re-issues the request with `requestState`. The official TypeScript and Python SDK clients retry the same response automatically and complete the call.

MRTR is a core message pattern in 2026-07-28 ("All implementations MUST support the base protocol, versioning, and the message patterns"), and the state-only shape is explicitly allowed (MRTR server requirement 6: at least one of `inputRequests` or `requestState`). Servers that use it for long-running writes are unusable from claude.ai.

## Reproduction against Anthropic's own server SDK

Server: `@modelcontextprotocol/server` 2.x (`McpServer` + `createMcpHandler`, `@hono/node-server`), one tool `slow_write` that returns `inputRequired({ requestState: codec.mint(...) })` on the first entry and completes when the state is echoed. Exposed over HTTPS, no auth, added as a custom connector.

Server log, claude.ai session (UTC):

```
22:06:04.464 server/discover clientInfo=Anthropic/ClaudeAI/1.0.0 proto=2026-07-28 -> 200 complete
22:06:04.853 tools/list clientInfo=Anthropic/ClaudeAI/1.0.0 proto=2026-07-28 -> 200 complete
22:06:40.411 tools/call fast_write hasRequestState=false -> 200 complete (shown to user)
22:06:44.435 tools/call slow_write hasRequestState=false -> 200 input_required
(no further request for this call; user sees "Error occurred during tool execution")
```

Same server, official TypeScript client (`@modelcontextprotocol/client` 2.x, default options), minutes earlier:

```
21:29:46.631 tools/call slow_write hasRequestState=false -> 200 input_required
21:29:47.111 tools/call slow_write hasRequestState=true -> 200 complete
```

The response body sent to both clients was identical:
`{"resultType":"input_required","requestState":"","_meta":{"io.modelcontextprotocol/serverInfo":{...}}}`.

## Real-world impact

Reported against a Hubitat MCP server (kingpanther13/Hubitat-local-MCP-server#421): every write that used continuation failed from claude.ai with the generic error while working from Claude Code and from the SDK clients. The server has since been changed to complete fast writes in the first request (kingpanther13/Hubitat-local-MCP-server#422), but long-running writes still return `requestState` and claude.ai still shows the error while the work finishes server-side.

## Expected

Retry the original request with `requestState` echoed (MRTR client requirement 2), as the official SDK clients do, or at minimum surface the result to the model as a pending continuation rather than an error.

## Environment

claude.ai web, custom connector, no auth, Streamable HTTP. Client capabilities declared only the `io.modelcontextprotocol/ui` extension.

贡献指南

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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