99 * 3. Per-resource capabilities — expressed via _meta
1010 * 4. Extension declaration — io.modelcontextprotocol/skills in capabilities
1111 *
12- * When the SDK adds native support, this shim can be removed.
12+ * If the SDK adds native support, this entire module can be removed.
1313 *
14- * @see https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2093
14+ * TODO: Remove if/when resolved:
15+ * - resources/metadata & uri-scoped list: https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2093
16+ * - extensions in capabilities: https://github.com/modelcontextprotocol/typescript-sdk/pull/1630
17+ * - per-resource capabilities field: https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2093
1518 */
1619
1720import { z } from "zod" ;
@@ -22,7 +25,10 @@ import { buildSkillUri, MANIFEST_PATH, PROMPT_XML_URI } from "./uri.js";
2225// Structural types (avoids duplicate-SDK private-property issues)
2326// ---------------------------------------------------------------------------
2427
25- /** Minimal interface for Server.setRequestHandler(). */
28+ /**
29+ * Minimal interface for Server.setRequestHandler().
30+ * TODO: Remove if SDK adds native SEP-2093 support — use Server type directly.
31+ */
2632export interface RequestHandlerRegistrar {
2733 setRequestHandler < T extends z . ZodType > (
2834 schema : T ,
@@ -33,6 +39,8 @@ export interface RequestHandlerRegistrar {
3339/**
3440 * Minimal interface for the low-level Server internals we need to access.
3541 * We reach into private fields to override handlers and patch capabilities.
42+ * TODO: Remove if SDK adds extensions support (typescript-sdk#1630) and
43+ * uri param on resources/list (SEP-2093).
3644 */
3745export interface ServerInternals extends RequestHandlerRegistrar {
3846 /** Private Map of method → handler. We use this to grab and wrap existing handlers. */
@@ -93,7 +101,8 @@ export const ScopedListResourcesRequestSchema = z.object({
93101
94102/**
95103 * Build a _meta object with per-resource capabilities.
96- * Capabilities live in _meta until the SDK adds a native field.
104+ * TODO: Replace with native `capabilities` field on Resource if SEP-2093
105+ * lands in the SDK. See: https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2093
97106 */
98107export function buildCapabilitiesMeta (
99108 capabilities : ResourceCapabilities ,
@@ -218,6 +227,9 @@ export function registerMetadataHandler(
218227 *
219228 * Must be called AFTER McpServer has registered its resources/list handler
220229 * (i.e., after the first server.resource() call).
230+ *
231+ * TODO: Remove if the SDK adds native `uri` param support on resources/list.
232+ * See: https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2093
221233 */
222234export function overrideResourcesListWithScoping (
223235 server : ServerInternals ,
@@ -258,9 +270,8 @@ export function overrideResourcesListWithScoping(
258270 * Must be called BEFORE server.connect() (capabilities are sent during
259271 * the initialize handshake).
260272 *
261- * This is a workaround — the SDK's ServerCapabilities schema doesn't
262- * include `extensions` yet (see typescript-sdk#1630). When merged,
263- * this can be replaced with a normal registerCapabilities() call.
273+ * TODO: Replace with registerCapabilities({ extensions: { ... } }) if
274+ * the SDK adds support. See: https://github.com/modelcontextprotocol/typescript-sdk/pull/1630
264275 */
265276export function declareSkillsExtension ( server : ServerInternals ) : void {
266277 if ( ! server . _capabilities ) {
0 commit comments