import { RpcMessage, type TRpcId, type TRpcRawRequest, type TRpcResponse } from "./rpc"; import * as s from "jsonv-ts"; import { Tool, type ToolConfig, type ToolHandler } from "./tool"; import { Resource, type ResourceConfig, type ResourceHandler, type TResourceUri } from "./resource"; declare const serverInfoSchema: s.ObjectSchema<{ readonly name: s.StringSchema & s.IStringOptions; readonly version: s.StringSchema & s.IStringOptions; }, s.Merge>; export type McpServerInfo = s.Static; export declare const logLevels: { emergency: string; alert: string; critical: string; error: string; warning: string; notice: string; info: string; debug: string; }; export type LogLevel = keyof typeof logLevels; export declare const logLevelNames: LogLevel[]; export declare const protocolVersion = "2025-06-18"; export declare class McpServer[] = Tool[], Resources extends Resource[] = Resource[]> { readonly serverInfo: s.Static; readonly context: ServerContext; tools: Tools; resources: Resources; protected readonly messages: RpcMessage[]; readonly version = "2025-06-18"; protected currentId: TRpcId | undefined; _id: string; protected logLevel: LogLevel; readonly history: Map; protected onNotificationListener?: (message: TRpcRawRequest) => void; constructor(serverInfo?: s.Static, context?: ServerContext, tools?: Tools, resources?: Resources); onNotification(handler: (message: TRpcRawRequest) => void): this; clone(): McpServer; setLogLevel(level: LogLevel): void; addTool>(tool: T): this; tool(name: Name, config: Config, handler: ToolHandler): this; addResource>(resource: R): this; resource, Config extends ResourceConfig | undefined = undefined>(name: Name, uri: Uri, handler: Handler, config?: Config): this; get console(): { [K in keyof typeof logLevels]: (...args: any[]) => void; }; handle(payload: TRpcRawRequest, raw?: unknown): Promise; toJSON(): { serverInfo: { version: string; name: string; }; tools: { name: any; title: string | undefined; description: string | undefined; inputSchema: s.JSONSchemaDefinition; outputSchema: s.JSONSchemaDefinition | undefined; annotations: { title?: string | undefined; readOnlyHint?: boolean | undefined; destructiveHint?: boolean | undefined; idempotentHint?: boolean | undefined; openWorldHint?: boolean | undefined; } | undefined; _meta: { [key: string]: unknown; } | undefined; }[]; resources: { [x: string]: string | number | { [key: string]: unknown; } | undefined; name: any; title: string | undefined; description: string | undefined; mimeType: string | undefined; size: number | undefined; _meta: { [key: string]: unknown; } | undefined; }[]; }; } export interface McpServerOptions { tools?: Tool[]; resources?: Resource[]; context?: object; serverInfo?: McpServerInfo; logLevel?: LogLevel; } export declare function mcpServer(opts: Opts): McpServer[], Resource[]>; export {};