mcp-adr-analysis-server 1.1.0
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.
- package/LICENSE +21 -0
- package/README.md +608 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +1722 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/prompts/adr-suggestion-prompts.d.ts +24 -0
- package/dist/src/prompts/adr-suggestion-prompts.d.ts.map +1 -0
- package/dist/src/prompts/adr-suggestion-prompts.js +383 -0
- package/dist/src/prompts/adr-suggestion-prompts.js.map +1 -0
- package/dist/src/prompts/analysis-prompts.d.ts +24 -0
- package/dist/src/prompts/analysis-prompts.d.ts.map +1 -0
- package/dist/src/prompts/analysis-prompts.js +489 -0
- package/dist/src/prompts/analysis-prompts.js.map +1 -0
- package/dist/src/prompts/deployment-analysis-prompts.d.ts +54 -0
- package/dist/src/prompts/deployment-analysis-prompts.d.ts.map +1 -0
- package/dist/src/prompts/deployment-analysis-prompts.js +712 -0
- package/dist/src/prompts/deployment-analysis-prompts.js.map +1 -0
- package/dist/src/prompts/environment-analysis-prompts.d.ts +34 -0
- package/dist/src/prompts/environment-analysis-prompts.d.ts.map +1 -0
- package/dist/src/prompts/environment-analysis-prompts.js +724 -0
- package/dist/src/prompts/environment-analysis-prompts.js.map +1 -0
- package/dist/src/prompts/index.d.ts +43 -0
- package/dist/src/prompts/index.d.ts.map +1 -0
- package/dist/src/prompts/index.js +384 -0
- package/dist/src/prompts/index.js.map +1 -0
- package/dist/src/prompts/research-integration-prompts.d.ts +43 -0
- package/dist/src/prompts/research-integration-prompts.d.ts.map +1 -0
- package/dist/src/prompts/research-integration-prompts.js +398 -0
- package/dist/src/prompts/research-integration-prompts.js.map +1 -0
- package/dist/src/prompts/research-question-prompts.d.ts +75 -0
- package/dist/src/prompts/research-question-prompts.d.ts.map +1 -0
- package/dist/src/prompts/research-question-prompts.js +695 -0
- package/dist/src/prompts/research-question-prompts.js.map +1 -0
- package/dist/src/prompts/rule-generation-prompts.d.ts +63 -0
- package/dist/src/prompts/rule-generation-prompts.d.ts.map +1 -0
- package/dist/src/prompts/rule-generation-prompts.js +630 -0
- package/dist/src/prompts/rule-generation-prompts.js.map +1 -0
- package/dist/src/prompts/security-prompts.d.ts +23 -0
- package/dist/src/prompts/security-prompts.d.ts.map +1 -0
- package/dist/src/prompts/security-prompts.js +287 -0
- package/dist/src/prompts/security-prompts.js.map +1 -0
- package/dist/src/resources/index.d.ts +24 -0
- package/dist/src/resources/index.d.ts.map +1 -0
- package/dist/src/resources/index.js +458 -0
- package/dist/src/resources/index.js.map +1 -0
- package/dist/src/tools/adr-suggestion-tool.d.ts +40 -0
- package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -0
- package/dist/src/tools/adr-suggestion-tool.js +338 -0
- package/dist/src/tools/adr-suggestion-tool.js.map +1 -0
- package/dist/src/tools/content-masking-tool.d.ts +52 -0
- package/dist/src/tools/content-masking-tool.d.ts.map +1 -0
- package/dist/src/tools/content-masking-tool.js +206 -0
- package/dist/src/tools/content-masking-tool.js.map +1 -0
- package/dist/src/tools/deployment-analysis-tool.d.ts +39 -0
- package/dist/src/tools/deployment-analysis-tool.d.ts.map +1 -0
- package/dist/src/tools/deployment-analysis-tool.js +310 -0
- package/dist/src/tools/deployment-analysis-tool.js.map +1 -0
- package/dist/src/tools/environment-analysis-tool.d.ts +16 -0
- package/dist/src/tools/environment-analysis-tool.d.ts.map +1 -0
- package/dist/src/tools/environment-analysis-tool.js +298 -0
- package/dist/src/tools/environment-analysis-tool.js.map +1 -0
- package/dist/src/tools/research-integration-tool.d.ts +44 -0
- package/dist/src/tools/research-integration-tool.d.ts.map +1 -0
- package/dist/src/tools/research-integration-tool.js +429 -0
- package/dist/src/tools/research-integration-tool.js.map +1 -0
- package/dist/src/tools/research-question-tool.d.ts +55 -0
- package/dist/src/tools/research-question-tool.d.ts.map +1 -0
- package/dist/src/tools/research-question-tool.js +333 -0
- package/dist/src/tools/research-question-tool.js.map +1 -0
- package/dist/src/tools/rule-generation-tool.d.ts +49 -0
- package/dist/src/tools/rule-generation-tool.d.ts.map +1 -0
- package/dist/src/tools/rule-generation-tool.js +432 -0
- package/dist/src/tools/rule-generation-tool.js.map +1 -0
- package/dist/src/types/index.d.ts +531 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +129 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/utils/adr-suggestions.d.ts +104 -0
- package/dist/src/utils/adr-suggestions.d.ts.map +1 -0
- package/dist/src/utils/adr-suggestions.js +228 -0
- package/dist/src/utils/adr-suggestions.js.map +1 -0
- package/dist/src/utils/cache.d.ts +51 -0
- package/dist/src/utils/cache.d.ts.map +1 -0
- package/dist/src/utils/cache.js +243 -0
- package/dist/src/utils/cache.js.map +1 -0
- package/dist/src/utils/config.d.ts +65 -0
- package/dist/src/utils/config.d.ts.map +1 -0
- package/dist/src/utils/config.js +118 -0
- package/dist/src/utils/config.js.map +1 -0
- package/dist/src/utils/content-masking.d.ts +79 -0
- package/dist/src/utils/content-masking.d.ts.map +1 -0
- package/dist/src/utils/content-masking.js +203 -0
- package/dist/src/utils/content-masking.js.map +1 -0
- package/dist/src/utils/deployment-analysis.d.ts +67 -0
- package/dist/src/utils/deployment-analysis.d.ts.map +1 -0
- package/dist/src/utils/deployment-analysis.js +263 -0
- package/dist/src/utils/deployment-analysis.js.map +1 -0
- package/dist/src/utils/environment-analysis.d.ts +76 -0
- package/dist/src/utils/environment-analysis.d.ts.map +1 -0
- package/dist/src/utils/environment-analysis.js +329 -0
- package/dist/src/utils/environment-analysis.js.map +1 -0
- package/dist/src/utils/file-system.d.ts +63 -0
- package/dist/src/utils/file-system.d.ts.map +1 -0
- package/dist/src/utils/file-system.js +189 -0
- package/dist/src/utils/file-system.js.map +1 -0
- package/dist/src/utils/output-masking.d.ts +45 -0
- package/dist/src/utils/output-masking.d.ts.map +1 -0
- package/dist/src/utils/output-masking.js +200 -0
- package/dist/src/utils/output-masking.js.map +1 -0
- package/dist/src/utils/research-documentation.d.ts +58 -0
- package/dist/src/utils/research-documentation.d.ts.map +1 -0
- package/dist/src/utils/research-documentation.js +438 -0
- package/dist/src/utils/research-documentation.js.map +1 -0
- package/dist/src/utils/research-integration.d.ts +89 -0
- package/dist/src/utils/research-integration.d.ts.map +1 -0
- package/dist/src/utils/research-integration.js +432 -0
- package/dist/src/utils/research-integration.js.map +1 -0
- package/dist/src/utils/research-questions.d.ts +97 -0
- package/dist/src/utils/research-questions.d.ts.map +1 -0
- package/dist/src/utils/research-questions.js +319 -0
- package/dist/src/utils/research-questions.js.map +1 -0
- package/dist/src/utils/rule-format.d.ts +76 -0
- package/dist/src/utils/rule-format.d.ts.map +1 -0
- package/dist/src/utils/rule-format.js +257 -0
- package/dist/src/utils/rule-format.js.map +1 -0
- package/dist/src/utils/rule-generation.d.ts +86 -0
- package/dist/src/utils/rule-generation.d.ts.map +1 -0
- package/dist/src/utils/rule-generation.js +330 -0
- package/dist/src/utils/rule-generation.js.map +1 -0
- package/package.json +71 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 MCP ADR Analysis Server
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
# MCP ADR Analysis Server
|
|
2
|
+
|
|
3
|
+
[](https://github.com/tosin2013/mcp-adr-analysis-server)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://www.npmjs.com/package/mcp-adr-analysis-server)
|
|
6
|
+
[](https://nodejs.org/)
|
|
7
|
+
[](https://www.typescriptlang.org/)
|
|
8
|
+
|
|
9
|
+
A comprehensive Model Context Protocol (MCP) server for AI-powered architectural decision analysis and management. This enterprise-ready solution provides intelligent analysis of Architectural Decision Records (ADRs), project ecosystems, and development workflows through 23 specialized MCP tools.
|
|
10
|
+
|
|
11
|
+
**Author**: [Tosin Akinosho](https://github.com/tosin2013)
|
|
12
|
+
**Repository**: [https://github.com/tosin2013/mcp-adr-analysis-server.git](https://github.com/tosin2013/mcp-adr-analysis-server.git)
|
|
13
|
+
|
|
14
|
+
## 🚀 What is the Model Context Protocol (MCP)?
|
|
15
|
+
|
|
16
|
+
> The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you're building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.
|
|
17
|
+
>
|
|
18
|
+
> — [Model Context Protocol README](https://github.com/modelcontextprotocol#:~:text=The%20Model%20Context,context%20they%20need.)
|
|
19
|
+
|
|
20
|
+
This MCP server enhances AI assistants with deep architectural analysis capabilities, enabling intelligent code generation, decision tracking, and development workflow automation.
|
|
21
|
+
|
|
22
|
+
## ✨ Key Features
|
|
23
|
+
|
|
24
|
+
### 🏗️ **Architectural Analysis & Intelligence**
|
|
25
|
+
- **Technology Detection**: AI-powered identification of ANY technology stack (React, Python, Terraform, Kubernetes, etc.)
|
|
26
|
+
- **Pattern Recognition**: Intelligent detection of architectural patterns and best practices
|
|
27
|
+
- **Dependency Analysis**: Comprehensive project structure and dependency mapping
|
|
28
|
+
- **Knowledge Graph Generation**: Create interconnected architectural knowledge representations
|
|
29
|
+
|
|
30
|
+
### 📋 **ADR Management & Generation**
|
|
31
|
+
- **ADR Generation from PRD**: Convert Product Requirements Documents to structured ADRs
|
|
32
|
+
- **Intelligent ADR Suggestions**: Auto-suggest ADRs from implicit code decisions
|
|
33
|
+
- **ADR Lifecycle Management**: Complete ADR creation, analysis, and maintenance workflows
|
|
34
|
+
- **Template Support**: Multiple ADR formats (Nygard, MADR, custom templates)
|
|
35
|
+
|
|
36
|
+
### 🔍 **Research & Documentation Intelligence**
|
|
37
|
+
- **Research Integration**: Monitor and incorporate research findings into architectural decisions
|
|
38
|
+
- **Context-Aware Research Questions**: Generate targeted research questions based on project context
|
|
39
|
+
- **Documentation Analysis**: Extract insights from existing documentation and codebases
|
|
40
|
+
- **Knowledge Synthesis**: Combine multiple information sources for comprehensive analysis
|
|
41
|
+
|
|
42
|
+
### 🛡️ **Enterprise Security & Compliance**
|
|
43
|
+
- **Content Masking**: Automatic detection and masking of sensitive information
|
|
44
|
+
- **Secret Prevention**: Proactive guidance to prevent secret exposure
|
|
45
|
+
- **Security Hardening**: Built-in security best practices and validation
|
|
46
|
+
- **Compliance Tracking**: Ensure architectural decisions meet enterprise standards
|
|
47
|
+
|
|
48
|
+
### 📊 **Development Workflow Automation**
|
|
49
|
+
- **Todo Management**: Generate actionable task lists from ADRs and project analysis
|
|
50
|
+
- **Deployment Tracking**: Monitor deployment progress and completion verification
|
|
51
|
+
- **Environment Analysis**: Analyze and optimize deployment environments
|
|
52
|
+
- **Rule Generation & Validation**: Extract and validate architectural rules from decisions
|
|
53
|
+
|
|
54
|
+
## 🛠️ Available MCP Tools
|
|
55
|
+
|
|
56
|
+
### Core Analysis Tools
|
|
57
|
+
- **`analyze_project_ecosystem`** - Comprehensive technology and pattern detection
|
|
58
|
+
- **`get_architectural_context`** - Generate intelligent architectural insights
|
|
59
|
+
- **`generate_adrs_from_prd`** - Convert requirements to structured ADRs
|
|
60
|
+
- **`generate_adr_todo`** - Create actionable task lists from ADRs
|
|
61
|
+
|
|
62
|
+
### Advanced Intelligence Tools
|
|
63
|
+
- **`suggest_adrs`** - Auto-suggest ADRs from implicit decisions
|
|
64
|
+
- **`generate_adr_from_decision`** - Create ADRs from specific decisions
|
|
65
|
+
- **`discover_existing_adrs`** - Intelligent ADR discovery and analysis
|
|
66
|
+
- **`incorporate_research`** - Integrate research findings into decisions
|
|
67
|
+
- **`generate_research_questions`** - Create context-aware research questions
|
|
68
|
+
|
|
69
|
+
### Security & Compliance Tools
|
|
70
|
+
- **`analyze_sensitive_content`** - Detect sensitive information patterns
|
|
71
|
+
- **`mask_content`** - Intelligent content masking and protection
|
|
72
|
+
- **`configure_masking`** - Customize security and masking settings
|
|
73
|
+
- **`validate_content_security`** - Comprehensive security validation
|
|
74
|
+
- **`apply_security_guidance`** - Proactive security recommendations
|
|
75
|
+
|
|
76
|
+
### Workflow & Management Tools
|
|
77
|
+
- **`generate_rules`** - Extract architectural rules from ADRs
|
|
78
|
+
- **`validate_rules`** - Validate code against architectural rules
|
|
79
|
+
- **`create_rule_set`** - Create comprehensive rule management systems
|
|
80
|
+
- **`analyze_environment`** - Environment analysis and optimization
|
|
81
|
+
- **`analyze_deployment_progress`** - Deployment tracking and verification
|
|
82
|
+
|
|
83
|
+
### Utility & Integration Tools
|
|
84
|
+
- **`clear_cache`** - Cache management and optimization
|
|
85
|
+
- **`create_research_template`** - Generate research documentation templates
|
|
86
|
+
- **`request_action_confirmation`** - Interactive user confirmation workflows
|
|
87
|
+
|
|
88
|
+
## 📦 Installation
|
|
89
|
+
|
|
90
|
+
### NPM Installation (Recommended)
|
|
91
|
+
```bash
|
|
92
|
+
# Global installation
|
|
93
|
+
npm install -g mcp-adr-analysis-server
|
|
94
|
+
|
|
95
|
+
# Local installation
|
|
96
|
+
npm install mcp-adr-analysis-server
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Using with uvx (Python-style)
|
|
100
|
+
```bash
|
|
101
|
+
# Run directly with uvx
|
|
102
|
+
uvx mcp-adr-analysis-server@latest
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### From Source
|
|
106
|
+
```bash
|
|
107
|
+
git clone https://github.com/tosin2013/mcp-adr-analysis-server.git
|
|
108
|
+
cd mcp-adr-analysis-server
|
|
109
|
+
npm install
|
|
110
|
+
npm run build
|
|
111
|
+
npm start
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## ⚙️ Configuration
|
|
115
|
+
|
|
116
|
+
### Environment Variables
|
|
117
|
+
|
|
118
|
+
The MCP server supports the following environment variables:
|
|
119
|
+
|
|
120
|
+
- **`PROJECT_PATH`** (Required): Path to the project directory to analyze
|
|
121
|
+
- Use `.` for current directory in project-specific configs
|
|
122
|
+
- Use `${workspaceFolder}` in VS Code/Cline for workspace root
|
|
123
|
+
- Use absolute paths for global configurations
|
|
124
|
+
|
|
125
|
+
- **`ADR_DIRECTORY`** (Optional): Directory containing ADR files
|
|
126
|
+
- Default: `docs/adrs`
|
|
127
|
+
- Relative to PROJECT_PATH
|
|
128
|
+
|
|
129
|
+
- **`LOG_LEVEL`** (Optional): Logging level
|
|
130
|
+
- Options: `DEBUG`, `INFO`, `WARN`, `ERROR`
|
|
131
|
+
- Default: `INFO`
|
|
132
|
+
|
|
133
|
+
- **`CACHE_ENABLED`** (Optional): Enable/disable caching
|
|
134
|
+
- Options: `true`, `false`
|
|
135
|
+
- Default: `true`
|
|
136
|
+
|
|
137
|
+
### Client Configurations
|
|
138
|
+
|
|
139
|
+
### Claude Desktop
|
|
140
|
+
Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"mcpServers": {
|
|
145
|
+
"adr-analysis": {
|
|
146
|
+
"command": "mcp-adr-analysis-server",
|
|
147
|
+
"env": {
|
|
148
|
+
"PROJECT_PATH": "/path/to/your/project",
|
|
149
|
+
"ADR_DIRECTORY": "docs/adrs",
|
|
150
|
+
"LOG_LEVEL": "ERROR"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Cline (VS Code Extension)
|
|
158
|
+
Add to your `cline_mcp_settings.json`:
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"mcpServers": {
|
|
163
|
+
"mcp-adr-analysis-server": {
|
|
164
|
+
"command": "npx",
|
|
165
|
+
"args": ["mcp-adr-analysis-server"],
|
|
166
|
+
"env": {
|
|
167
|
+
"PROJECT_PATH": "${workspaceFolder}",
|
|
168
|
+
"ADR_DIRECTORY": "docs/adrs",
|
|
169
|
+
"LOG_LEVEL": "ERROR"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Cursor
|
|
177
|
+
Create `.cursor/mcp.json` in your project:
|
|
178
|
+
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"mcpServers": {
|
|
182
|
+
"adr-analysis": {
|
|
183
|
+
"command": "npx",
|
|
184
|
+
"args": ["mcp-adr-analysis-server"],
|
|
185
|
+
"env": {
|
|
186
|
+
"PROJECT_PATH": ".",
|
|
187
|
+
"ADR_DIRECTORY": "docs/adrs",
|
|
188
|
+
"LOG_LEVEL": "ERROR"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Windsurf
|
|
196
|
+
Add to `~/.codeium/windsurf/mcp_config.json`:
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"mcpServers": {
|
|
201
|
+
"adr-analysis": {
|
|
202
|
+
"command": "mcp-adr-analysis-server",
|
|
203
|
+
"args": [],
|
|
204
|
+
"env": {
|
|
205
|
+
"PROJECT_PATH": "/path/to/your/project",
|
|
206
|
+
"ADR_DIRECTORY": "docs/adrs",
|
|
207
|
+
"LOG_LEVEL": "ERROR"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Amazon Q CLI
|
|
215
|
+
Add to `~/.aws/amazonq/mcp.json`:
|
|
216
|
+
|
|
217
|
+
```json
|
|
218
|
+
{
|
|
219
|
+
"mcpServers": {
|
|
220
|
+
"adr-analysis": {
|
|
221
|
+
"command": "uvx",
|
|
222
|
+
"args": ["mcp-adr-analysis-server@latest"],
|
|
223
|
+
"env": {
|
|
224
|
+
"PROJECT_PATH": "/path/to/your/project",
|
|
225
|
+
"ADR_DIRECTORY": "docs/adrs",
|
|
226
|
+
"LOG_LEVEL": "ERROR"
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## 🚀 Usage Examples
|
|
234
|
+
|
|
235
|
+
### Basic Project Analysis
|
|
236
|
+
```typescript
|
|
237
|
+
// Analyze any project's technology stack and architecture
|
|
238
|
+
const analysis = await analyzeProjectEcosystem({
|
|
239
|
+
projectPath: "/path/to/project",
|
|
240
|
+
analysisType: "comprehensive"
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
// Get intelligent architectural insights
|
|
244
|
+
const context = await getArchitecturalContext({
|
|
245
|
+
projectPath: "/path/to/project",
|
|
246
|
+
focusAreas: ["security", "scalability", "maintainability"]
|
|
247
|
+
});
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### ADR Generation from Requirements
|
|
251
|
+
```typescript
|
|
252
|
+
// Convert PRD to structured ADRs
|
|
253
|
+
const adrs = await generateAdrsFromPrd({
|
|
254
|
+
prdPath: "docs/PRD.md",
|
|
255
|
+
outputDirectory: "docs/adrs",
|
|
256
|
+
template: "nygard"
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
// Generate actionable todos from ADRs
|
|
260
|
+
const todos = await generateAdrTodo({
|
|
261
|
+
adrDirectory: "docs/adrs",
|
|
262
|
+
outputPath: "todo.md"
|
|
263
|
+
});
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Security and Compliance
|
|
267
|
+
```typescript
|
|
268
|
+
// Analyze and mask sensitive content
|
|
269
|
+
const maskedContent = await maskContent({
|
|
270
|
+
content: "API_KEY=secret123",
|
|
271
|
+
maskingLevel: "strict"
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
// Validate architectural rules
|
|
275
|
+
const validation = await validateRules({
|
|
276
|
+
projectPath: "/path/to/project",
|
|
277
|
+
ruleSet: "enterprise-security"
|
|
278
|
+
});
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Research and Documentation
|
|
282
|
+
```typescript
|
|
283
|
+
// Generate context-aware research questions
|
|
284
|
+
const questions = await generateResearchQuestions({
|
|
285
|
+
projectContext: analysis,
|
|
286
|
+
focusArea: "microservices-migration"
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
// Incorporate research findings
|
|
290
|
+
const updatedAdrs = await incorporateResearch({
|
|
291
|
+
researchFindings: findings,
|
|
292
|
+
adrDirectory: "docs/adrs"
|
|
293
|
+
});
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
## 🎯 Use Cases
|
|
297
|
+
|
|
298
|
+
### 👨💻 **AI Coding Assistants**
|
|
299
|
+
*Enhance AI coding assistants like Cline, Cursor, and Claude Code*
|
|
300
|
+
|
|
301
|
+
- **Intelligent Code Generation**: Generate code that follows architectural patterns and best practices
|
|
302
|
+
- **Architecture-Aware Refactoring**: Refactor code while maintaining architectural integrity
|
|
303
|
+
- **Decision Documentation**: Automatically document architectural decisions as you code
|
|
304
|
+
- **Pattern Recognition**: Identify and suggest architectural patterns for new features
|
|
305
|
+
|
|
306
|
+
### 💬 **Conversational AI Assistants**
|
|
307
|
+
*Enhance chatbots and business agents with architectural intelligence*
|
|
308
|
+
|
|
309
|
+
- **Technical Documentation**: Answer questions about system architecture and design decisions
|
|
310
|
+
- **Compliance Checking**: Verify that proposed changes meet architectural standards
|
|
311
|
+
- **Knowledge Synthesis**: Combine information from multiple sources for comprehensive answers
|
|
312
|
+
- **Decision Support**: Provide data-driven recommendations for architectural choices
|
|
313
|
+
|
|
314
|
+
### 🤖 **Autonomous Development Agents**
|
|
315
|
+
*Enable autonomous agents to understand and work with complex architectures*
|
|
316
|
+
|
|
317
|
+
- **Automated Analysis**: Continuously analyze codebases for architectural drift
|
|
318
|
+
- **Rule Enforcement**: Automatically enforce architectural rules and patterns
|
|
319
|
+
- **Documentation Generation**: Generate and maintain architectural documentation
|
|
320
|
+
- **Deployment Validation**: Verify deployment readiness and compliance
|
|
321
|
+
|
|
322
|
+
### 🏢 **Enterprise Architecture Management**
|
|
323
|
+
*Support enterprise architects and development teams*
|
|
324
|
+
|
|
325
|
+
- **Portfolio Analysis**: Analyze multiple projects for consistency and compliance
|
|
326
|
+
- **Migration Planning**: Plan and track architectural migrations and modernization
|
|
327
|
+
- **Risk Assessment**: Identify architectural risks and technical debt
|
|
328
|
+
- **Standards Enforcement**: Ensure compliance with enterprise architectural standards
|
|
329
|
+
|
|
330
|
+
## 🛠️ Technology Stack
|
|
331
|
+
|
|
332
|
+
- **Runtime**: Node.js (>=18.0.0)
|
|
333
|
+
- **Language**: TypeScript with strict configuration
|
|
334
|
+
- **Core Framework**: @modelcontextprotocol/sdk
|
|
335
|
+
- **Validation**: Zod schemas for all data structures
|
|
336
|
+
- **Testing**: Jest with >80% coverage target
|
|
337
|
+
- **Linting**: ESLint with comprehensive rules
|
|
338
|
+
- **Build**: TypeScript compiler with incremental builds
|
|
339
|
+
- **CI/CD**: GitHub Actions with automated testing and publishing
|
|
340
|
+
|
|
341
|
+
## � Project Structure
|
|
342
|
+
|
|
343
|
+
```
|
|
344
|
+
mcp-adr-analysis-server/
|
|
345
|
+
├── src/
|
|
346
|
+
│ ├── index.ts # Main MCP server entry point
|
|
347
|
+
│ ├── tools/ # MCP tool implementations (23 tools)
|
|
348
|
+
│ ├── resources/ # MCP resource implementations
|
|
349
|
+
│ ├── prompts/ # MCP prompt implementations
|
|
350
|
+
│ ├── types/ # TypeScript interfaces & schemas
|
|
351
|
+
│ ├── utils/ # Utility functions and helpers
|
|
352
|
+
│ └── cache/ # Intelligent caching system
|
|
353
|
+
├── docs/
|
|
354
|
+
│ ├── adrs/ # Architectural Decision Records
|
|
355
|
+
│ ├── research/ # Research findings and templates
|
|
356
|
+
│ └── NPM_PUBLISHING.md # NPM publishing guide
|
|
357
|
+
├── tests/ # Comprehensive test suite
|
|
358
|
+
├── .github/workflows/ # CI/CD automation
|
|
359
|
+
├── scripts/ # Build and deployment scripts
|
|
360
|
+
└── dist/ # Compiled JavaScript output
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
## 🧪 Testing
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
# Run all tests
|
|
367
|
+
npm test
|
|
368
|
+
|
|
369
|
+
# Run tests with coverage
|
|
370
|
+
npm run test:coverage
|
|
371
|
+
|
|
372
|
+
# Run tests in watch mode
|
|
373
|
+
npm run test:watch
|
|
374
|
+
|
|
375
|
+
# Test MCP server functionality
|
|
376
|
+
npm run test:package
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Test Coverage
|
|
380
|
+
- **Unit Tests**: Individual component testing with >80% coverage
|
|
381
|
+
- **Integration Tests**: MCP protocol and file system testing
|
|
382
|
+
- **Custom Matchers**: ADR and schema validation helpers
|
|
383
|
+
- **Performance Tests**: Caching and optimization validation
|
|
384
|
+
|
|
385
|
+
## 🔧 Development
|
|
386
|
+
|
|
387
|
+
### Prerequisites
|
|
388
|
+
- Node.js >= 18.0.0
|
|
389
|
+
- npm or yarn
|
|
390
|
+
- Git
|
|
391
|
+
|
|
392
|
+
### Setup
|
|
393
|
+
```bash
|
|
394
|
+
# Clone the repository
|
|
395
|
+
git clone https://github.com/tosin2013/mcp-adr-analysis-server.git
|
|
396
|
+
cd mcp-adr-analysis-server
|
|
397
|
+
|
|
398
|
+
# Install dependencies
|
|
399
|
+
npm install
|
|
400
|
+
|
|
401
|
+
# Build the project
|
|
402
|
+
npm run build
|
|
403
|
+
|
|
404
|
+
# Run tests
|
|
405
|
+
npm test
|
|
406
|
+
|
|
407
|
+
# Start development server
|
|
408
|
+
npm run dev
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
### Available Scripts
|
|
412
|
+
```bash
|
|
413
|
+
npm run build # Build TypeScript to JavaScript
|
|
414
|
+
npm run dev # Start development server with hot reload
|
|
415
|
+
npm test # Run Jest tests with coverage
|
|
416
|
+
npm run lint # Run ESLint checks
|
|
417
|
+
npm run lint:fix # Fix ESLint issues automatically
|
|
418
|
+
npm run clean # Clean build artifacts and cache
|
|
419
|
+
npm run format # Format code with Prettier
|
|
420
|
+
npm run typecheck # Run TypeScript type checking
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### Code Quality Standards
|
|
424
|
+
- **TypeScript**: Strict mode with comprehensive type checking
|
|
425
|
+
- **ESLint**: Enforced code quality and security rules
|
|
426
|
+
- **Testing**: Jest with custom matchers for ADR validation
|
|
427
|
+
- **Coverage**: Minimum 80% test coverage required
|
|
428
|
+
- **Security**: Content masking and secret prevention
|
|
429
|
+
- **MCP Compliance**: Strict adherence to Model Context Protocol specification
|
|
430
|
+
|
|
431
|
+
## 🚀 Getting Started
|
|
432
|
+
|
|
433
|
+
### Quick Start with Claude Desktop
|
|
434
|
+
1. Install the MCP server:
|
|
435
|
+
```bash
|
|
436
|
+
npm install -g mcp-adr-analysis-server
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
2. Add to your Claude Desktop configuration:
|
|
440
|
+
```json
|
|
441
|
+
{
|
|
442
|
+
"mcpServers": {
|
|
443
|
+
"adr-analysis": {
|
|
444
|
+
"command": "mcp-adr-analysis-server"
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
3. Restart Claude Desktop and start analyzing your projects!
|
|
451
|
+
|
|
452
|
+
### Configuration Examples
|
|
453
|
+
|
|
454
|
+
#### Example 1: Single Project Analysis
|
|
455
|
+
```json
|
|
456
|
+
{
|
|
457
|
+
"mcpServers": {
|
|
458
|
+
"adr-analysis": {
|
|
459
|
+
"command": "mcp-adr-analysis-server",
|
|
460
|
+
"env": {
|
|
461
|
+
"PROJECT_PATH": "/Users/username/my-react-app",
|
|
462
|
+
"ADR_DIRECTORY": "docs/decisions",
|
|
463
|
+
"LOG_LEVEL": "INFO"
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
#### Example 2: Multi-Project Setup (Different configs for different projects)
|
|
471
|
+
```json
|
|
472
|
+
{
|
|
473
|
+
"mcpServers": {
|
|
474
|
+
"adr-analysis-frontend": {
|
|
475
|
+
"command": "mcp-adr-analysis-server",
|
|
476
|
+
"env": {
|
|
477
|
+
"PROJECT_PATH": "/Users/username/frontend-app",
|
|
478
|
+
"ADR_DIRECTORY": "docs/adrs",
|
|
479
|
+
"LOG_LEVEL": "ERROR"
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
"adr-analysis-backend": {
|
|
483
|
+
"command": "mcp-adr-analysis-server",
|
|
484
|
+
"env": {
|
|
485
|
+
"PROJECT_PATH": "/Users/username/backend-api",
|
|
486
|
+
"ADR_DIRECTORY": "architecture/decisions",
|
|
487
|
+
"LOG_LEVEL": "DEBUG"
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
#### Example 3: Development vs Production
|
|
495
|
+
```json
|
|
496
|
+
{
|
|
497
|
+
"mcpServers": {
|
|
498
|
+
"adr-analysis": {
|
|
499
|
+
"command": "mcp-adr-analysis-server",
|
|
500
|
+
"env": {
|
|
501
|
+
"PROJECT_PATH": "${workspaceFolder}",
|
|
502
|
+
"ADR_DIRECTORY": "docs/adrs",
|
|
503
|
+
"LOG_LEVEL": "DEBUG",
|
|
504
|
+
"CACHE_ENABLED": "true",
|
|
505
|
+
"ANALYSIS_TIMEOUT": "60000"
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
### Example Prompts for AI Assistants
|
|
513
|
+
|
|
514
|
+
**Project Analysis:**
|
|
515
|
+
```
|
|
516
|
+
Using the MCP ADR Analysis Server, analyze this React TypeScript project and generate architectural insights focusing on scalability and security.
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
**ADR Generation:**
|
|
520
|
+
```
|
|
521
|
+
Using the ADR analysis tools, convert the PRD.md file into structured ADRs and create a todo.md with actionable tasks.
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
**Security Analysis:**
|
|
525
|
+
```
|
|
526
|
+
Analyze this codebase for sensitive content and provide security recommendations using the content masking tools.
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
## 🔒 Security Features
|
|
530
|
+
|
|
531
|
+
### Content Protection
|
|
532
|
+
- **Automatic Secret Detection**: Identifies API keys, passwords, and sensitive data
|
|
533
|
+
- **Intelligent Masking**: Context-aware content masking with configurable levels
|
|
534
|
+
- **Security Validation**: Comprehensive security checks and recommendations
|
|
535
|
+
- **Compliance Tracking**: Ensure adherence to security standards and best practices
|
|
536
|
+
|
|
537
|
+
### Privacy & Data Handling
|
|
538
|
+
- **Local Processing**: All analysis performed locally, no data sent to external services
|
|
539
|
+
- **Configurable Masking**: Customize masking rules for your organization's needs
|
|
540
|
+
- **Audit Trail**: Track all security-related actions and decisions
|
|
541
|
+
- **Zero Trust**: Assume all content may contain sensitive information
|
|
542
|
+
|
|
543
|
+
## 📊 Performance & Scalability
|
|
544
|
+
|
|
545
|
+
### Intelligent Caching
|
|
546
|
+
- **Multi-level Caching**: File system, memory, and analysis result caching
|
|
547
|
+
- **Cache Invalidation**: Smart cache invalidation based on file changes
|
|
548
|
+
- **Performance Optimization**: Optimized for large codebases and complex projects
|
|
549
|
+
- **Resource Management**: Efficient memory and CPU usage
|
|
550
|
+
|
|
551
|
+
### Scalability Features
|
|
552
|
+
- **Incremental Analysis**: Only analyze changed files and dependencies
|
|
553
|
+
- **Parallel Processing**: Multi-threaded analysis for large projects
|
|
554
|
+
- **Memory Optimization**: Efficient memory usage for large codebases
|
|
555
|
+
- **Streaming Results**: Stream analysis results for real-time feedback
|
|
556
|
+
|
|
557
|
+
## 🤝 Contributing
|
|
558
|
+
|
|
559
|
+
We welcome contributions! This project follows strict development standards to ensure quality and security.
|
|
560
|
+
|
|
561
|
+
### Development Standards
|
|
562
|
+
- **TypeScript**: Strict mode with comprehensive type checking
|
|
563
|
+
- **Testing**: >80% code coverage with Jest
|
|
564
|
+
- **Linting**: ESLint with security-focused rules
|
|
565
|
+
- **Security**: All contributions must pass security validation
|
|
566
|
+
- **MCP Compliance**: Strict adherence to Model Context Protocol specification
|
|
567
|
+
|
|
568
|
+
### Getting Started
|
|
569
|
+
1. Fork the repository
|
|
570
|
+
2. Create a feature branch
|
|
571
|
+
3. Make your changes with tests
|
|
572
|
+
4. Run the full test suite
|
|
573
|
+
5. Submit a pull request
|
|
574
|
+
|
|
575
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
|
|
576
|
+
|
|
577
|
+
## 🔗 Related Resources
|
|
578
|
+
|
|
579
|
+
### Official Documentation
|
|
580
|
+
- [Model Context Protocol Specification](https://modelcontextprotocol.io/)
|
|
581
|
+
- [MCP Server Development Guide](https://modelcontextprotocol.io/docs/concepts/servers)
|
|
582
|
+
- [TypeScript MCP SDK](https://github.com/modelcontextprotocol/typescript-sdk)
|
|
583
|
+
|
|
584
|
+
### Community Resources
|
|
585
|
+
- [MCP Servers Registry](https://github.com/modelcontextprotocol/servers)
|
|
586
|
+
- [Awesome MCP Servers](https://github.com/punkpeye/awesome-mcp-servers)
|
|
587
|
+
- [MCP Community Discord](https://discord.gg/modelcontextprotocol)
|
|
588
|
+
|
|
589
|
+
### Project Documentation
|
|
590
|
+
- [Implementation Progress](./todo.md)
|
|
591
|
+
- [Architecture Decisions](./docs/adrs/)
|
|
592
|
+
- [NPM Publishing Guide](./docs/NPM_PUBLISHING.md)
|
|
593
|
+
|
|
594
|
+
## 📄 License
|
|
595
|
+
|
|
596
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
597
|
+
|
|
598
|
+
## 🙏 Acknowledgments
|
|
599
|
+
|
|
600
|
+
- **Anthropic** for creating the Model Context Protocol
|
|
601
|
+
- **The MCP Community** for inspiration and best practices
|
|
602
|
+
- **Contributors** who help make this project better
|
|
603
|
+
|
|
604
|
+
---
|
|
605
|
+
|
|
606
|
+
**Built with ❤️ by [Tosin Akinosho](https://github.com/tosin2013) for AI-driven architectural analysis**
|
|
607
|
+
|
|
608
|
+
*Empowering AI assistants with deep architectural intelligence and decision-making capabilities.*
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MCP ADR Analysis Server
|
|
4
|
+
* Main entry point for the Model Context Protocol server
|
|
5
|
+
*
|
|
6
|
+
* This server provides Tools, Resources, and Prompts for analyzing
|
|
7
|
+
* Architectural Decision Records and project architecture.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG"}
|