mcp-adr-analysis-server
Version:
MCP server for analyzing Architectural Decision Records and project architecture
45 lines • 1.38 kB
TypeScript
/**
* Resource Router - URI routing infrastructure for templated resources
* Supports parameterized URIs like adr://adr/{id} and adr://research/{topic}
*/
import { URLSearchParams } from 'url';
import { ResourceGenerationResult } from './index.js';
export type ResourceHandler = (params: Record<string, string>, searchParams: URLSearchParams) => Promise<ResourceGenerationResult>;
export interface RouteRegistration {
pattern: string;
handler: ResourceHandler;
description?: string;
}
/**
* URI Router for templated resources
* Matches URI patterns and extracts parameters
*/
export declare class ResourceRouter {
private routes;
/**
* Register a route pattern with its handler
*/
register(pattern: string, handler: ResourceHandler, description?: string): void;
/**
* Route a URI to its handler and execute
*/
route(uri: string): Promise<ResourceGenerationResult>;
/**
* Check if a pattern matches a path
*/
private matchPattern;
/**
* Extract parameters from path based on pattern
*/
private extractParams;
/**
* Get all registered routes
*/
getRoutes(): RouteRegistration[];
/**
* Check if a URI can be routed
*/
canRoute(uri: string): boolean;
}
export declare const resourceRouter: ResourceRouter;
//# sourceMappingURL=resource-router.d.ts.map