Migration note: `ResourceTemplate` from @modelcontextprotocol/server is the high-level class, not the spec type
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu với hướng dẫn di chuyển và phần về mẫu tài nguyên; issue không nêu tên tệp, vì vậy hãy tìm hướng dẫn trong repository. Giải thích rằng kiểu giao thức hiện có tên là ResourceTemplateType và phân biệt nó với lớp cấp cao ResourceTemplate. Hoàn tất khi hướng dẫn di chuyển nêu rõ mã đã di chuyển nên dùng tên nào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 13.8k
- Fork
- 2.5k
- Merge trung bình
- 6 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/typescript-sdk
-
`callTool` with `allowInputRequired: true` throws on an `input_required` result when the tool declares an `outputSchema`Có thể đã có người làm @mgoldsborough đã nhận 6 ngày trước. Đang mởv2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/typescript-sdk#3249 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
modelcontextprotocol/typescript-sdk#3243 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
TypeScript client accepts an unknown `resultType` in the first `server/discover` replyCó thể đã có người làm @Tidehyc đã nhận 7 ngày trước. Đang mởv2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/typescript-sdk#3235 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
UriTemplate.match() throws a TypeError on an empty expression it acceptsCó thể đã có người làm @yunusemrejs đã nhận 12 ngày trước. Đang mởv1 v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
modelcontextprotocol/typescript-sdk#3221 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`OpenIdProviderDiscoveryMetadataSchema` strips `revocation_endpoint`, so clients can't revoke against OIDC-only authorization serversCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởv1 v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/typescript-sdk#3213 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/typescript-sdk
Issue tương tự
-
clawsweeper:intake:bug clawsweeper:intake:needs-environment
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openclaw/openclaw#212827 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Use one constant for the 10,000-character input limitCó thể đã có người làm @NginxL đã nhận hôm nay. Đang mởgood first issue refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
aniru-dh21/snap-validate#51 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
dependencies effort: small good first issue priority: low
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
TMHSDigital/screencast-mcp#509 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
from-review tech-debt testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
blamechris/chroxy#9520 ·
Maintainer thường phản hồi trong vòng 1 ngày