fix(types): forbid csp/permissions on McpUiToolMeta via never (#624)
* fix(types): forbid csp/permissions on McpUiToolMeta via never Hosts read _meta.ui.csp and _meta.ui.permissions from the resource (resources/read content item, with resources/list entry as fallback), never from the tool. Typing them as `never` on McpUiToolMeta gives TypeScript users a compile-time error pointing at McpUiResourceMeta instead of silently accepting and ignoring them. Companion to anthropics/apps#38705 (host-side console.warn). Refs anthropics/claude-ai-mcp#40. * drop misleading #40 link from McpUiToolMeta.csp JSDoc
This commit is contained in:
parent
3fb521b71f
commit
4995746759
1 changed files with 28 additions and 0 deletions
|
|
@ -783,6 +783,17 @@ export interface McpUiToolMeta {
|
|||
* - "app": Tool callable by the app from this server only
|
||||
*/
|
||||
visibility?: McpUiToolVisibility[];
|
||||
/**
|
||||
* `csp` belongs on the UI **resource** (see {@link McpUiResourceMeta}),
|
||||
* not the tool. Hosts read it from the `resources/read` content item
|
||||
* (with `resources/list` entry as fallback) and ignore it here.
|
||||
*/
|
||||
csp?: never;
|
||||
/**
|
||||
* `permissions` belongs on the UI **resource** (see {@link McpUiResourceMeta}),
|
||||
* not the tool. Hosts ignore it here.
|
||||
*/
|
||||
permissions?: never;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue