Canonical surface
New code usesdocument.modelContext.
| Member | Purpose |
|---|---|
registerTool(tool, { signal }) | Publish a tool and bind its lifetime to an optional abort signal |
getTools() | Discover registered tool objects |
executeTool(tool, inputJson, options?) | Execute a tool object returned by getTools() |
toolchange | Notify consumers that available tools changed |
Compatibility
navigator.modelContextis a deprecated alias for migration.navigator.modelContextTestingis a compatibility surface for testing.listTools(),callTool(), prompts, resources, sampling, elicitation, and transports are MCP-B extensions.
@mcp-b/webmcp-polyfill for the
portable strict runtime.