UNPKG

@tanstack/ai-mcp

Version:

Host-side Model Context Protocol client for TanStack AI: discover and run MCP server tools, resources, and prompts in any adapter's chat() loop, with generated end-to-end types.

28 lines (27 loc) • 902 B
import { MCPEventConfigError } from "../errors.js"; import { listEventDefinitions } from "./list.js"; //#region src/events/discovery.ts /** * Discovery-only events API. `list()` works; subscribe/refresh/unsubscribe throw. * * @experimental */ function createDiscoveryMCPEvents(ctx) { return { list(options) { return listEventDefinitions(ctx, options?.signal); }, async subscribe() { throw new MCPEventConfigError("experimental_events.store or experimental_events.adapter is required to subscribe"); }, async refresh() { throw new MCPEventConfigError("experimental_events.store or experimental_events.adapter is required to refresh"); }, async unsubscribe() { throw new MCPEventConfigError("experimental_events.store or experimental_events.adapter is required to unsubscribe"); } }; } //#endregion export { createDiscoveryMCPEvents }; //# sourceMappingURL=discovery.js.map