@odel/module-sdk
Version:
SDK for building Odel modules - MCP protocol over HTTP for Cloudflare Workers
40 lines • 986 B
TypeScript
/**
* Module builder for creating MCP-compliant Odel modules
*/
import { z } from 'zod';
import type { ModuleTool } from './types';
/**
* Module builder class for creating MCP-compliant modules
*/
export declare class ModuleBuilder<Env = any> {
private tools;
/**
* Add a tool to the module
*/
tool<TInput extends z.ZodType, TOutput extends z.ZodType>(tool: ModuleTool<TInput, TOutput>): this;
/**
* Convert module tools to MCP format
*/
private toMCPTools;
/**
* Build the Cloudflare Worker handler
*/
build(): ExportedHandler<Env>;
}
/**
* Create a new module builder with optional environment typing
*
* @example
* ```typescript
* interface Env {
* RESEND_API_KEY: string;
* ANALYTICS: AnalyticsEngine;
* }
*
* export default createModule<Env>()
* .tool({ ... })
* .build();
* ```
*/
export declare function createModule<Env = any>(): ModuleBuilder<Env>;
//# sourceMappingURL=module-builder.d.ts.map