Migration note: `ResourceTemplate` from @modelcontextprotocol/server is the high-level class, not the spec type
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 72/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
从迁移指南及其中关于资源模板的章节开始;issue 没有指出文件,因此请在仓库中找到该指南。说明协议类型现在名为 ResourceTemplateType,并将它与高层 ResourceTemplate 类区分开。迁移指南清楚指出迁移后的代码应该使用哪个名称时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Package: @modelcontextprotocol/server 2.4.0
Compared with: @modelcontextprotocol/sdk 1.32.1 (types.js)
Summary
In 1.x, ResourceTemplate imported from @modelcontextprotocol/sdk/types.js was the protocol type ({ uriTemplate: string, name, … }), and the high-level class lived in server/mcp.js. In 2.x the root of @modelcontextprotocol/server exports both the protocol types and the high-level API, and ResourceTemplate there is the class (uriTemplate: UriTemplate); the protocol type is ResourceTemplateType. Code migrated by swapping @modelcontextprotocol/sdk/types.js for @modelcontextprotocol/server (or a library that re-exports the server's types) compiles against the class instead of the protocol type and fails in unrelated places.
Reproduction
import type { ResourceTemplate } from '@modelcontextprotocol/server';
export const listed: ResourceTemplate = { uriTemplate: 'file:///{path}', name: 'files' };
Expected
With 1.x's types.js this was the protocol type and compiled.
Actual
error TS2322: Type 'string' is not assignable to type 'UriTemplate'.
Suggestion
Mention the rename in the migration guide (ResourceTemplate → ResourceTemplateType for the protocol type), or export the protocol type under a name that doesn't collide with the class.
- 主要语言
- TypeScript
- 星标
- 13.8k
- 派生
- 2.5k
- 平均合并
- 6 天 23 小时
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/typescript-sdk 的其他 Issue
-
`callTool` with `allowInputRequired: true` throws on an `input_required` result when the tool declares an `outputSchema`可能已有人在做 @mgoldsborough 于 6 天前认领。 未关闭v2
难度 2/5 1-3 小时 新手友好度 78/100
modelcontextprotocol/typescript-sdk#3249 ·
维护者通常 1 天内回复
-
v2
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/typescript-sdk#3243 · 3 条评论 ·
维护者通常 1 天内回复
-
TypeScript client accepts an unknown `resultType` in the first `server/discover` reply可能已有人在做 @Tidehyc 于 7 天前认领。 未关闭v2
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/typescript-sdk#3235 · 3 条评论 ·
维护者通常 1 天内回复
-
UriTemplate.match() throws a TypeError on an empty expression it accepts可能已有人在做 @yunusemrejs 于 12 天前认领。 未关闭v1 v2
难度 2/5 1-3 小时 新手友好度 80/100
modelcontextprotocol/typescript-sdk#3221 · 3 条评论 ·
维护者通常 1 天内回复
-
`OpenIdProviderDiscoveryMetadataSchema` strips `revocation_endpoint`, so clients can't revoke against OIDC-only authorization servers可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭v1 v2
难度 2/5 1-3 小时 新手友好度 78/100
modelcontextprotocol/typescript-sdk#3213 · 3 条评论 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/typescript-sdk 的全部 Issue
相似的 Issue
-
clawsweeper:intake:bug clawsweeper:intake:needs-environment
难度 2/5 1-3 小时 新手友好度 82/100
openclaw/openclaw#212827 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Use one constant for the 10,000-character input limit可能已有人在做 @NginxL 今天认领。 未关闭good first issue refactor
难度 2/5 1-3 小时 新手友好度 78/100
aniru-dh21/snap-validate#51 ·
维护者通常 1 天内回复
-
dependencies effort: small good first issue priority: low
难度 1/5 1-3 小时 新手友好度 88/100
TMHSDigital/screencast-mcp#509 ·
维护者通常 1 天内回复
-
from-review tech-debt testing
难度 2/5 1-3 小时 新手友好度 82/100
blamechris/chroxy#9520 ·
维护者通常 1 天内回复