Skip to content

Commit 8028e6b

Browse files
olaservoclaude
andcommitted
Add TODO tracking links to all SDK shim workarounds
Each shim function now has a TODO with the specific PR link for when/if it can be removed. Uses "if" not "when" since the upstream PRs are drafts not guaranteed to merge. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c2afcfc commit 8028e6b

2 files changed

Lines changed: 19 additions & 8 deletions

File tree

examples/skills-server/typescript/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const server = new McpServer(
7171
);
7272

7373
// Cast to access low-level Server internals for SEP shims.
74-
// These workarounds can be removed once the SDK supports:
74+
// These workarounds can be removed if the SDK adds support for:
7575
// - extensions in capabilities (typescript-sdk#1630)
7676
// - uri parameter on resources/list (SEP-2093)
7777
const lowLevelServer = server.server as unknown as ServerInternals;

typescript/sdk/src/resource-extensions.ts

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
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

1720
import { 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+
*/
2632
export 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
*/
3745
export 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
*/
98107
export 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
*/
222234
export 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
*/
265276
export function declareSkillsExtension(server: ServerInternals): void {
266277
if (!server._capabilities) {

0 commit comments

Comments
 (0)