Skip to content

Commit 8059a3d

Browse files
cliffhallclaude
andcommitted
docs(test-servers): note custom resource handlers must re-add _meta
Address round-3 code-review note on PR #1587: resource `_meta` is applied only by the default read handler; a customHandler from onRegisterResource replaces the contents wholesale and would drop it. Document this on ResourceDefinition._meta so a future App UI resource with a custom read handler knows to re-add _meta itself. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01S3fTN8H3R8YV4yUGvZjYnX
1 parent 39f9baa commit 8059a3d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎test-servers/src/composable-test-server.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ export interface ResourceDefinition {
127127
description?: string;
128128
mimeType?: string;
129129
text?: string;
130-
/** Included on the returned content item so clients can read resource-level `_meta` (e.g. `_meta.ui.csp` for MCP App UI resources). */
130+
/**
131+
* Included on the returned content item so clients can read resource-level `_meta` (e.g. `_meta.ui.csp` for MCP App UI resources).
132+
* Only the default read handler applies this; a `customHandler` from `config.onRegisterResource` replaces the `contents` wholesale, so such a handler must re-add `_meta` itself if the resource needs it on the read response.
133+
*/
131134
_meta?: Record<string, unknown>;
132135
}
133136

0 commit comments

Comments
 (0)