import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js'; import type { z } from 'zod'; import type { McpCapabilityVerifier, VerifiedMcpCapability } from '../types.js'; export type NodeMcpToolRegistrationContext = { server: McpServer; capability: VerifiedMcpCapability; requestSignal: AbortSignal; }; /** Product-owned model-visible tools plugged into the generic MCP edge. */ export interface NodeMcpToolset { readonly serverInfo: Readonly<{ name: string; version: string; }>; registerAllowedTools(context: NodeMcpToolRegistrationContext): void; } export type NodeMcpJsonToolExecutionContext = { capability: VerifiedMcpCapability; signal: AbortSignal; }; /** * One product-owned JSON tool exposed through the standard Node MCP edge. * * The generic toolset owns capability admission, cancellation composition, * lifetime checks, safe failures, and JSON result projection. The definition * owns only product vocabulary, validation, annotations, and behavior. */ export type NodeMcpJsonToolDefinition> = { name: TTool; title?: string; description: string; inputSchema: z.ZodType; annotations?: ToolAnnotations; /** Stable model-visible text; thrown product errors are never reflected. */ failureMessage: string; execute(input: TInput, context: NodeMcpJsonToolExecutionContext): unknown | Promise; }; export type AnyNodeMcpJsonToolDefinition = NodeMcpJsonToolDefinition>; export type NodeMcpJsonToolsetConfig = { serverInfo: Readonly<{ name: string; version: string; }>; tools: readonly AnyNodeMcpJsonToolDefinition[]; now?: () => Date; }; export type NodeStreamableHttpMcpServiceConfig = { capabilityVerifier: McpCapabilityVerifier; toolset: NodeMcpToolset; maxBodyBytes?: number; }; //# sourceMappingURL=types.d.ts.map