mcp-adr-analysis-server 2.7.39 → 2.7.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,282 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * MCP ADR Analysis Server
4
- * Main entry point for the Model Context Protocol server
4
+ * Main entry point for the Model Context Protocol server.
5
5
  *
6
- * This server provides Tools, Resources, and Prompts for analyzing
7
- * Architectural Decision Records and project architecture.
6
+ * Tools and resources are registered in mcp-adr-analysis-server.ts
7
+ * from the canonical MCP_TOOL_SCHEMAS list.
8
8
  */
9
- /**
10
- * Main server class
11
- */
12
- export declare class McpAdrAnalysisServer {
13
- private server;
14
- private maskingConfig;
15
- private config;
16
- private logger;
17
- private kgManager;
18
- private stateReinforcementManager;
19
- private conversationMemoryManager;
20
- private memoryEntityManager;
21
- private rootManager;
22
- private contextGenerator;
23
- constructor();
24
- /**
25
- * Validate configuration and project setup
26
- */
27
- private validateConfiguration;
28
- /**
29
- * Public health check method for testing
30
- */
31
- healthCheck(): Promise<void>;
32
- /**
33
- * Setup MCP protocol handlers
34
- *
35
- * @description Configures all Model Context Protocol request handlers for the ADR Analysis Server.
36
- * Implements the complete MCP specification including tools, resources, and prompts.
37
- *
38
- * @private
39
- * @since 2.0.0
40
- * @category MCP Protocol
41
- */
42
- private setupHandlers;
43
- /**
44
- * Tool implementations
45
- */
46
- private checkAIExecutionStatus;
47
- private getWorkflowGuidance;
48
- private getDevelopmentGuidance;
49
- private analyzeProjectEcosystem;
50
- private getArchitecturalContext;
51
- private generateAdrsFromPrd;
52
- private compareAdrProgress;
53
- /**
54
- * Detect and validate environment context
55
- */
56
- private detectAndValidateEnvironment;
57
- /**
58
- * Perform local ADR progress analysis without relying on AI execution
59
- */
60
- private performLocalAdrProgressAnalysis;
61
- /**
62
- * Parse TODO.md content to extract tasks
63
- */
64
- private parseTodoTasks;
65
- /**
66
- * Map TODO tasks to ADRs to identify alignment (now environment-aware)
67
- */
68
- private mapTasksToAdrs;
69
- /**
70
- * Check file existence for completed tasks
71
- */
72
- private performFileExistenceChecks;
73
- /**
74
- * Analyze code for mock vs production implementation
75
- */
76
- private performMockVsProductionAnalysis;
77
- /**
78
- * Calculate environment-specific compliance score
79
- */
80
- private calculateEnvironmentScore;
81
- /**
82
- * Perform environment compliance analysis
83
- */
84
- private performEnvironmentComplianceAnalysis;
85
- /**
86
- * Analyze security compliance based on security level
87
- */
88
- private analyzeSecurityCompliance;
89
- /**
90
- * Content masking tool implementations
91
- */
92
- private analyzeContentSecurity;
93
- private generateContentMasking;
94
- private configureCustomPatterns;
95
- private applyBasicContentMasking;
96
- private validateContentMasking;
97
- private manageCache;
98
- private configureOutputMasking;
99
- /**
100
- * Helper method to get domains based on PRD type
101
- */
102
- private getPrdTypeDomains;
103
- /**
104
- * Helper method to get domains for ecosystem analysis based on technology focus
105
- */
106
- private getEcosystemAnalysisDomains;
107
- /**
108
- * Helper method to create base ADR generation prompt
109
- */
110
- private createBaseAdrPrompt;
111
- /**
112
- * ADR suggestion tool implementations
113
- */
114
- private suggestAdrs;
115
- private generateAdrFromDecision;
116
- private generateAdrBootstrap;
117
- private bootstrapValidationLoop;
118
- private discoverExistingAdrs;
119
- private analyzeAdrTimeline;
120
- private reviewExistingAdrs;
121
- /**
122
- * ADR validation tool implementations
123
- */
124
- private validateAdr;
125
- private validateAllAdrs;
126
- /**
127
- * Research integration tool implementations
128
- */
129
- private incorporateResearch;
130
- private createResearchTemplate;
131
- private requestActionConfirmation;
132
- /**
133
- * Rule generation and validation tool implementations
134
- */
135
- private generateRules;
136
- private validateRules;
137
- private createRuleSet;
138
- /**
139
- * Environment analysis tool implementation
140
- */
141
- private analyzeEnvironment;
142
- /**
143
- * Research question generation tool implementation
144
- */
145
- private generateResearchQuestions;
146
- /**
147
- * Perform research tool implementation
148
- */
149
- private performResearch;
150
- /**
151
- * Search codebase tool implementation
152
- */
153
- private searchCodebase;
154
- /**
155
- * Deployment analysis tool implementation
156
- */
157
- private analyzeDeploymentProgress;
158
- /**
159
- * Apply content masking to MCP response
160
- */
161
- /**
162
- * Track memory operations performed by tools
163
- */
164
- private trackMemoryOperations;
165
- /**
166
- * Extract memory operation details from tool execution
167
- */
168
- private extractMemoryOperations;
169
- /**
170
- * Track tool execution in knowledge graph
171
- */
172
- private trackToolExecution;
173
- private applyOutputMasking;
174
- /**
175
- * Enrich response with state reinforcement and apply masking
176
- *
177
- * Implements Phase 2 of context decay mitigation by injecting
178
- * context reminders every N turns or when response exceeds token threshold.
179
- *
180
- * Phase 3 extension: Records conversation turns to structured external memory.
181
- */
182
- private enrichResponseWithStateReinforcement;
183
- /**
184
- * Read MCP resource with prompt-driven caching
185
- */
186
- private readResource;
187
- /**
188
- * Start the server
189
- */
190
- start(): Promise<void>;
191
- /**
192
- * File system tool implementations
193
- */
194
- /**
195
- * List accessible roots (MCP best practice)
196
- */
197
- private listRoots;
198
- /**
199
- * Read directory contents (MCP best practice for autonomous file discovery)
200
- */
201
- private readDirectory;
202
- private readFile;
203
- private writeFile;
204
- private listDirectory;
205
- private generateDeploymentGuidance;
206
- private smartGitPush;
207
- private deploymentReadiness;
208
- private releaseTracking;
209
- private generateAdrTodo;
210
- private troubleshootGuidedWorkflow;
211
- private smartScore;
212
- private mcpPlanning;
213
- private memoryLoading;
214
- private expandAnalysisSection;
215
- private interactiveAdrPlanning;
216
- /**
217
- * Tool chain orchestrator implementation
218
- */
219
- private toolChainOrchestrator;
220
- /**
221
- * Phase 3: Expand Memory Tool
222
- * Retrieves and expands stored content from tiered responses
223
- */
224
- private expandMemory;
225
- /**
226
- * Phase 3: Query Conversation History Tool
227
- * Searches and retrieves conversation sessions
228
- */
229
- private queryConversationHistory;
230
- /**
231
- * Phase 3: Get Conversation Snapshot Tool
232
- * Retrieves current conversation context
233
- */
234
- private getConversationSnapshot;
235
- /**
236
- * Phase 3: Get Memory Statistics Tool
237
- * Retrieves conversation memory statistics
238
- */
239
- private getMemoryStats;
240
- /**
241
- * Update Knowledge Tool (ADR-018)
242
- * Simple CRUD operations for knowledge graph
243
- */
244
- private updateKnowledge;
245
- /**
246
- * Get Server Context Tool
247
- * Generates comprehensive server context file for LLM @ referencing
248
- */
249
- private getServerContext;
250
- /**
251
- * Get Current Datetime Tool
252
- * Returns the current date and time in various formats for ADR generation and timestamping
253
- */
254
- private getCurrentDatetime;
255
- /**
256
- * Set Project Path Tool - Dynamic Session Configuration
257
- *
258
- * @description Dynamically sets the active project path for the current session.
259
- * This allows switching between projects without restarting the server or modifying
260
- * environment variables. Updates both the config and the RootManager.
261
- *
262
- * @param args - Set project path arguments
263
- * @param args.path - Absolute path to the project directory
264
- * @param args.validatePath - Whether to validate the path exists (default: true)
265
- * @returns Promise<CallToolResult> - Confirmation of the path change
266
- */
267
- private setProjectPath;
268
- /**
269
- * Load Prompt Tool - CE-MCP Phase 4 Lazy Loading
270
- *
271
- * @description Loads prompts on-demand instead of eagerly loading all prompts at startup.
272
- * This reduces token usage by ~96% (from 28K tokens to ~1K on-demand).
273
- *
274
- * @param args - Load prompt arguments
275
- * @param args.promptName - Name of the prompt to load
276
- * @param args.section - Optional section within the prompt
277
- * @param args.estimateOnly - If true, returns only token estimate
278
- * @returns Promise<CallToolResult> - Loaded prompt content or estimate
279
- */
280
- private loadPrompt;
281
- }
9
+ import { getToolListForMCP } from './tools/tool-dispatcher.js';
10
+ export { McpAdrAnalysisServer, getPackageVersion } from './mcp-adr-analysis-server.js';
11
+ export { getToolListForMCP };
282
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG;AAgIH;;GAEG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,SAA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