import { a as GQP } from '../../engine-Bg3M08x9.mjs'; import { y as ToolCallParams } from '../../types-CqJN-Ev5.mjs'; /** * MCP Bridge for GQP * Generates MCP server with single tool from GQP graph */ /** * MCP Tool Definition */ interface MCPTool { name: string; description: string; inputSchema: { type: "object"; properties: Record; required?: string[]; }; } /** * MCP Server Options */ interface MCPServerOptions { /** Server name */ name?: string; /** Server version */ version?: string; /** Tool customization */ tool?: { /** Custom tool name */ name?: string; /** Custom description */ description?: string; }; /** Lifecycle hooks */ hooks?: { beforeQuery?: (params: ToolCallParams) => Promise; afterQuery?: (result: unknown) => Promise; onError?: (error: Error) => Promise; }; } /** * Create MCP tool definition from GQP */ declare function createMCPTool(graph: GQP, options?: MCPServerOptions): MCPTool; /** * Create MCP tool handler */ declare function createMCPHandler(graph: GQP, options?: MCPServerOptions): (params: unknown) => Promise<{ type: "text"; text: string; }[]>; /** * Serve GQP as MCP server * * This creates a complete MCP server with a single tool that consolidates * all data access into one navigable interface. * * @example * ```typescript * import { GQP } from '@mzhub/gqp'; * import { serveMCP } from '@mzhub/gqp/mcp'; * import { fromPrisma } from '@mzhub/gqp/prisma'; * * const graph = new GQP({ * sources: { db: fromPrisma(prisma) } * }); * * serveMCP(graph, { * name: 'my-data-server', * hooks: { * beforeQuery: async (params) => { * console.log('Query:', params); * return params; * } * } * }); * ``` */ declare function serveMCP(graph: GQP, options?: MCPServerOptions): Promise; /** * Create MCP server configuration for external use * Returns the configuration without starting the server */ declare function getMCPConfig(graph: GQP, options?: MCPServerOptions): { tool: MCPTool; handler: (params: Record) => Promise<{ type: "text"; text: string; }[]>; serverInfo: { name: string; version: string; }; }; export { type MCPServerOptions, type MCPTool, createMCPHandler, createMCPTool, getMCPConfig, serveMCP };