@odel/module-sdk
Version:
SDK for building Odel modules - MCP protocol over HTTP for Cloudflare Workers
37 lines • 1.14 kB
TypeScript
/**
* MCP Protocol Compliance Tests
*
* These tests validate that a module correctly implements the MCP protocol.
* All modules should use these tests to ensure protocol compliance.
*/
import type { ExecutionContext } from '@cloudflare/workers-types';
export interface MCPTestContext {
worker: ExportedHandler<any>;
env: any;
createExecutionContext: () => ExecutionContext;
waitOnExecutionContext: (ctx: ExecutionContext) => Promise<void>;
}
/**
* Standard MCP protocol compliance tests
*
* @param getContext - Function that returns test context with worker and environment
* @param expectedTools - Array of tool names that should be registered
*
* @example
* ```typescript
* import { testMCPCompliance } from '@odel/module-sdk/testing';
* import worker from './src/index';
*
* testMCPCompliance(
* () => ({
* worker,
* env: {},
* createExecutionContext,
* waitOnExecutionContext
* }),
* ['add', 'subtract']
* );
* ```
*/
export declare function testMCPCompliance(getContext: () => MCPTestContext, expectedTools: string[]): void;
//# sourceMappingURL=mcp-compliance.d.ts.map