Skip to content

toolmark-monorepo / @toolmark/core/webmcp / WebMcpOptions

Interface: WebMcpOptions ​

Defined in: packages/core/src/webmcp/index.ts:29

Experimental

Options for webmcp. WebMCP is an origin-trial API; this adapter is outside semver (D28).

Properties ​

exposedTo? ​

optional exposedTo?: string[]

Defined in: packages/core/src/webmcp/index.ts:39

Experimental

Origins allowed to call the tools (native WebMCP only; the polyfill reports it as a failure).


filter? ​

optional filter?: (t) => boolean

Defined in: packages/core/src/webmcp/index.ts:37

Experimental

Narrows the tools registered with WebMCP (applied after the webmcp caller policy).

Parameters ​

t ​

ToolManifest

Returns ​

boolean


modelContext? ​

optional modelContext?: () => ModelContextLike | undefined

Defined in: packages/core/src/webmcp/index.ts:44

Experimental

Advanced: supplies the model context (node tests, embedders). When it returns undefined, the adapter falls back to document.modelContext, then the legacy navigator.modelContext.

Returns ​

ModelContextLike | undefined


polyfill? ​

optional polyfill?: "none" | (() => Promise<WebMcpPolyfillModule>)

Defined in: packages/core/src/webmcp/index.ts:35

Experimental

'none' (default) or an app-supplied loader, e.g. () => import('@mcp-b/webmcp-polyfill'), used only when the browser has no model context. The adapter never imports the polyfill itself, so bundlers resolve the optional peer only when the app opts in.