Skip to content

Class: MCPRuntime ​

Defined in: packages/core/src/mcp/mcp-runtime.ts:49

MCP Runtime for IWSDK that provides framework-specific tools. This is set on window.FRAMEWORK_MCP_RUNTIME during World.create() for the vite-plugin-dev to route requests to.

Constructors ​

Constructor ​

new MCPRuntime(world): MCPRuntime

Defined in: packages/core/src/mcp/mcp-runtime.ts:50

Parameters ​

world ​

World

Returns ​

MCPRuntime

Methods ​

dispatch() ​

dispatch(method, params): Promise<unknown>

Defined in: packages/core/src/mcp/mcp-runtime.ts:68

Dispatch a method call. Returns result or throws an error.

Parameters ​

method ​

string

The MCP tool name (e.g., 'get_scene_hierarchy')

params ​

Record<string, unknown>

Parameters passed to the tool

Returns ​

Promise<unknown>

Promise resolving to the tool result


handles() ​

handles(method): boolean

Defined in: packages/core/src/mcp/mcp-runtime.ts:58

Returns true if this runtime handles the given method. Used by vite-plugin-dev to route requests appropriately.

Parameters ​

method ​

string

Returns ​

boolean

Privacy | Terms