signalk-mcp-server
Version:
MCP server for SignalK marine data integration
54 lines • 1.62 kB
TypeScript
/**
* SDK Generator - Auto-generates TypeScript SDK from MCP tool definitions
*
* This generator converts MCP tool schemas into TypeScript functions that can be
* injected into V8 isolates, providing type-safe access to SignalK data.
*
* Benefits:
* - Keeps SDK in sync with MCP tools automatically
* - Provides TypeScript types and JSDoc comments
* - Handles parameters and options correctly
* - No manual SDK maintenance required
*/
export interface MCPTool {
name: string;
description: string;
inputSchema: {
type: string;
properties?: Record<string, any>;
required?: string[];
additionalProperties?: boolean;
};
}
/**
* Generate TypeScript SDK code from MCP tool definitions
*
* @param tools - Array of MCP tool definitions
* @returns TypeScript code as string
*
* @example
* const tools = [
* {
* name: 'get_vessel_state',
* description: 'Get current vessel navigation data',
* inputSchema: { type: 'object', properties: {} }
* }
* ];
* const sdk = generateSDK(tools);
* // Returns TypeScript function definitions
*/
export declare function generateSDK(tools: MCPTool[]): string;
/**
* Generate SDK code and inject into isolate context
*
* This function generates the SDK code and prepares it for injection
* into a V8 isolate context along with the signalk binding.
*
* @param tools - MCP tool definitions
* @returns Object with SDK code and injection helper
*/
export declare function prepareSDKForIsolate(tools: MCPTool[]): {
code: string;
wrapperCode: string;
};
//# sourceMappingURL=generator.d.ts.map