UNPKG

openapi-mcp-generator

Version:

Generates MCP server code from OpenAPI specifications

41 lines (40 loc) 1.25 kB
/** * Code generation utilities for OpenAPI to MCP generator */ import { McpToolDefinition } from '../types/index.js'; import { OpenAPIV3 } from 'openapi-types'; /** * Generates the tool definition map code * * @param tools List of tool definitions * @param securitySchemes Security schemes from OpenAPI spec * @returns Generated code for the tool definition map */ export declare function generateToolDefinitionMap(tools: McpToolDefinition[], securitySchemes?: OpenAPIV3.ComponentsObject['securitySchemes']): string; /** * Generates the list tools handler code * * @returns Generated code for the list tools handler */ export declare function generateListToolsHandler(): string; /** * Generates the call tool handler code * * @returns Generated code for the call tool handler */ export declare function generateCallToolHandler(): string; /** * Convert a string to title case * * @param str String to convert * @returns Title case string */ export declare function titleCase(str: string): string; /** * Generates an operation ID from method and path * * @param method HTTP method * @param path API path * @returns Generated operation ID */ export declare function generateOperationId(method: string, path: string): string;