-32042 without elicitations drops JSON-RPC error data

未关闭 适合新手
#381 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@EhsanAzish80 已经在做这个了。

开始于 2026年11月26日。

  • #382 来自 @EhsanAzish80 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
67/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
swift

调研方向

首先在 Swift SDK 中找到 MCPError.init(from:) 和现有的 -32021 解码规则。检查解码器如何根据错误的 data 字段区分错误,然后为包含和不包含 elicitations 数组的 -32042 添加或更新有针对性的解码器测试。数组存在时仍为 urlElicitationRequired,而数组缺失或不是数组时,原始数据仍作为 serverError 保留,即为完成。

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

描述

MCPError.init(from:) currently maps every -32042 error to urlElicitationRequired. When data.elicitations is absent or is not an array, the decoder creates an empty list and loses other data, including data.challenges.

The 1.0 decoder can follow its existing -32021 rule: decode a -32042 without an elicitations array as serverError(code:message:data:), keeping the original data. A -32042 with an array should still decode as urlElicitationRequired.

This is the remaining data-preservation part of #229. It does not add payment-protocol support or a new MCPError case.

主要语言
Swift
星标
1.6k
派生
278
平均合并
11 小时 15 分钟
30 天内合并 PR
46

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelcontextprotocol/swift-sdk 的其他 Issue

查看 modelcontextprotocol/swift-sdk 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

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