Skip to content

HostHandlers

Defined in: packages/mcp-query/src/core/types.ts:57

Handlers for server -> client requests. Registering one advertises the capability.

optional elicitation?: (req) => Promise<{ action: "accept" | "decline" | "cancel"; content?: unknown; }>

Defined in: packages/mcp-query/src/core/types.ts:61

Server asks the user for structured input mid-call. Maps to a UI dialog.

string

Record<string, unknown>

Promise<{ action: "accept" | "decline" | "cancel"; content?: unknown; }>


optional roots?: () => object[]

Defined in: packages/mcp-query/src/core/types.ts:66

Filesystem/URI boundaries the client exposes to the server.

object[]


optional sampling?: (req) => Promise<unknown>

Defined in: packages/mcp-query/src/core/types.ts:59

Server asks the host LLM to complete something. Omit in non-agentic apps.

unknown

Promise<unknown>