UNPKG

mcp-adr-analysis-server

Version:

MCP server for analyzing Architectural Decision Records and project architecture

82 lines 2.84 kB
/** * ADRs Review Resource - Review specific ADR against code implementation * URI Pattern: adr://adrs/{id}/review */ import { URLSearchParams } from 'url'; import { ResourceGenerationResult } from './index.js'; export interface AdrReviewData { adrId: string; title: string; status: string; complianceScore: number; codeCompliance: { implemented: boolean; partiallyImplemented: boolean; notImplemented: boolean; evidence: string[]; gaps: string[]; }; recommendations: { updateAdr: boolean; updateCode: boolean; createPlan: boolean; actions: string[]; }; analysis: string; timestamp: string; projectPath: string; analysisDepth: string; } /** * Generate ADR review resource showing compliance analysis against code. * * Returns a comprehensive review of a specific ADR including: * - Compliance score against actual implementation * - Evidence of implementation found in code * - Gaps between ADR decisions and code * - Recommendations for updates * * **URI Pattern:** `adr://adrs/{id}/review` * * **Query Parameters:** * - `projectPath`: Override project root path (default: process.cwd()) * - `analysisDepth`: 'basic' | 'detailed' | 'comprehensive' (default: 'detailed') * - `includeTreeSitter`: Use tree-sitter for analysis (default: true) * * @param params - URL path parameters containing: * - id: ADR identifier (e.g., "001", "database-architecture") * @param searchParams - URL query parameters for customization * * @returns Promise resolving to resource generation result containing: * - data: Complete ADR review data with compliance analysis * - contentType: "application/json" * - lastModified: ISO timestamp of generation * - cacheKey: Unique identifier "adr-review:{id}" * - ttl: Cache duration (180 seconds / 3 minutes) * - etag: Entity tag for cache validation * * @throws {McpAdrError} When review generation fails * * @example * ```typescript * // Get review for ADR 001 * const review = await generateAdrsReviewResource( * { id: '001' }, * new URLSearchParams() * ); * * console.log(`Compliance score: ${review.data.complianceScore}/10`); * console.log(`Gaps: ${review.data.codeCompliance.gaps.join(', ')}`); * * // Comprehensive review with custom project path * const detailed = await generateAdrsReviewResource( * { id: 'database-architecture' }, * new URLSearchParams('analysisDepth=comprehensive&projectPath=/my/project') * ); * ``` * * @since v2.2.0 * @see {@link reviewExistingAdrs} for the underlying review logic */ export declare function generateAdrsReviewResource(params: Record<string, string>, searchParams: URLSearchParams): Promise<ResourceGenerationResult>; //# sourceMappingURL=adrs-review-resource.d.ts.map