import type { OpenAPIDefinition } from '@redocly/openapi-docs'; import type { XMcpConfig, McpEndpoint, McpServerType } from '../types.js'; /** * Extracts the x-mcp configuration from an MCP endpoint. * * This function safely retrieves the x-mcp extension property from an endpoint object. * The x-mcp property contains server-specific configuration for MCP (Model Context Protocol) endpoints. * * @param endpoint - The MCP endpoint object to extract configuration from. * @returns The x-mcp configuration object or undefined if not present. * * @example * getXMcpConfig({ 'x-mcp': { gateway: { hide: true } } }); // { gateway: { hide: true } } * getXMcpConfig({}); // undefined */ export declare function getXMcpConfig(endpoint: McpEndpoint): XMcpConfig | undefined; /** * Checks if an endpoint should be hidden for a specific server type. * * This function determines whether an MCP endpoint should be hidden based on the * x-mcp configuration and the target server type (gateway or catalog). * * @param endpoint - The MCP endpoint to check. * @param serverType - The server type to check visibility for ('gateway' or 'catalog'). * @returns `true` if the endpoint should be hidden, `false` otherwise. * * @example * isEndpointHidden({ 'x-mcp': { docs: { hide: false } } }, 'docs'); // false */ export declare function isEndpointHidden(endpoint: McpEndpoint, serverType: McpServerType): boolean; /** * Checks endpoint visibility and removes x-mcp configuration from output. * * This function first checks if an endpoint should be hidden for the given server type. * If the endpoint is accessible, it removes the x-mcp configuration to clean up the output. * This is typically used to prepare endpoints for public API documentation. * * @param endpoint - The MCP endpoint to process. * @param serverType - The server type to check visibility for. * @returns `true` if the endpoint is accessible and processed, `false` if hidden. * * @example * checkEndpointAndDeleteXMcp(endpoint, 'docs'); * // Returns true and removes x-mcp from endpoint if accessible */ export declare function checkEndpointAndDeleteXMcp(endpoint: McpEndpoint, serverType: McpServerType): boolean; /** * Checks if an OpenAPI definition should be hidden based on x-mcp configuration. * * This function examines the info section of an OpenAPI definition for x-mcp configuration * and determines if the definition should be hidden for the specified server type. * If no server type is provided, it checks if the definition is hidden for any server type. * * @param info - The OpenAPI info object to check. * @param serverType - Optional server type to check ('docs' or 'gateway'). * @returns `true` if the definition should be hidden, `false` otherwise. * * @example * isDefinitionHidden({ 'x-mcp': { docs: { hide: false } } }); // false */ export declare function isDefinitionHidden(info: OpenAPIDefinition['info'], serverType?: McpServerType): boolean; //# sourceMappingURL=xmcp-utils.d.ts.map