mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-22 06:56:35 +00:00
76c8c349b1
* refactor(server): fold @trek/nest-mcp into server/src/nest-mcp * docs(server): point nest-mcp references at server/src/nest-mcp * remove tracked md file
15 lines
601 B
TypeScript
15 lines
601 B
TypeScript
import { McpRegistry, type McpRegistryOptions } from './registry';
|
|
|
|
/**
|
|
* Builds a registry from hand-constructed `@McpController()` instances —
|
|
* no Nest app required. For test harnesses that assemble a bare `McpServer`
|
|
* (e.g. over an in-memory transport).
|
|
*/
|
|
export function createTestRegistry(instances: readonly object[], options: McpRegistryOptions = {}): McpRegistry {
|
|
const registry = new McpRegistry(options);
|
|
for (const instance of instances) registry.register(instance);
|
|
// Same fail-fast contract as McpRegistryService.onModuleInit.
|
|
registry.validate();
|
|
return registry;
|
|
}
|