InProcessTransport

class InProcessTransport(registry: ToolRegistry, resources: ResourceRegistry = ResourceRegistry(), prompts: PromptRegistry = PromptRegistry())

Direct, in-process access to a ToolRegistry — no JSON-RPC, no network. Intended for on-device LLMs that call tools straight from the same process. Mirrors the surface an MCP client gets over HttpTransport (tools, resources, prompts) without the protocol envelope.

Constructors

Link copied to clipboard
constructor(registry: ToolRegistry, resources: ResourceRegistry = ResourceRegistry(), prompts: PromptRegistry = PromptRegistry())

Functions

Link copied to clipboard
suspend fun callTool(name: String, params: Map<String, Any>): ToolResult

Invoke a tool; honours runtime gating and runs on Dispatchers.IO (see ToolRegistry.executeTool).

suspend fun callTool(name: String, params: Map<String, Any>, onProgress: suspend (ProgressUpdate) -> Unit): ToolResult

Like callTool, delivering the tool's reportProgress updates to onProgress.

Link copied to clipboard
suspend fun getPrompt(name: String, arguments: Map<String, String> = emptyMap()): PromptResult?

Render the named prompt, or return null when it isn't listed.

Link copied to clipboard

Prompts whose McpPrompt.requiredTools are all enabled, like prompts/list.

Link copied to clipboard

Resources of every provider whose required tools are enabled, like resources/list (unpaginated). Providers run in parallel; one that fails or times out contributes nothing.

Link copied to clipboard

URI templates of every provider whose required tools are enabled, like resources/templates/list.

Link copied to clipboard

The enabled tools as live McpTool instances — tools the host gated off are excluded.

Link copied to clipboard

The enabled tools serialised to a JSON array, each entry carrying name, description, a parameters JSON Schema (type: object with properties and a required list), plus title, outputSchema and annotations when set. For LLM runtimes that want the tool catalogue as a string. Gated-off tools are excluded, matching tools/list over HTTP.

Link copied to clipboard

The contents at uri, or null when no visible provider handles it, it can't be read, or the host's confirmer (configured for the provider's required tools) declined.