mcp-adr-analysis-server 2.1.28 → 2.3.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/README.md +133 -27
- package/dist/.tsbuildinfo +1 -1
- package/dist/src/utils/aggregator-endpoint-map.d.ts +36 -0
- package/dist/src/utils/aggregator-endpoint-map.d.ts.map +1 -0
- package/dist/src/utils/aggregator-endpoint-map.js +129 -0
- package/dist/src/utils/aggregator-endpoint-map.js.map +1 -0
- package/dist/src/utils/directory-compat.d.ts +4 -2
- package/dist/src/utils/directory-compat.d.ts.map +1 -1
- package/dist/src/utils/directory-compat.js +9 -4
- package/dist/src/utils/directory-compat.js.map +1 -1
- package/dist/src/utils/interactive-approval.d.ts.map +1 -1
- package/dist/src/utils/interactive-approval.js +2 -3
- package/dist/src/utils/interactive-approval.js.map +1 -1
- package/dist/src/utils/pattern-loader.d.ts.map +1 -1
- package/dist/src/utils/pattern-loader.js +3 -5
- package/dist/src/utils/pattern-loader.js.map +1 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# MCP ADR Analysis Server
|
|
1
|
+
# MCP (Model Context Protocol) ADR (Architectural Decision Record) Analysis Server
|
|
2
2
|
|
|
3
3
|
[](https://github.com/tosin2013/mcp-adr-analysis-server)
|
|
4
4
|
[](LICENSE)
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
> **AI-powered architectural analysis for intelligent development workflows.** Returns actual analysis results, not prompts to submit elsewhere.
|
|
11
11
|
|
|
12
|
+
## What is MCP?
|
|
13
|
+
|
|
14
|
+
The **Model Context Protocol (MCP)** is an open standard that enables seamless integration between AI assistants and external tools and data sources. Think of it as a universal adapter that lets AI assistants like Claude, Cline, and Cursor connect to specialized analysis servers. This server enhances AI assistants with deep architectural analysis capabilities, enabling intelligent code generation, decision tracking, and development workflow automation.
|
|
15
|
+
|
|
12
16
|
## TL;DR
|
|
13
17
|
|
|
14
18
|
**What:** MCP server that provides AI-powered architectural decision analysis and ADR management
|
|
@@ -18,13 +22,22 @@
|
|
|
18
22
|
|
|
19
23
|
**Key Features:** Tree-sitter AST analysis • Security content masking • Test-driven development • Deployment readiness validation
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
<details>
|
|
26
|
+
<summary><b>Key Terms</b></summary>
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
| Term | Definition |
|
|
29
|
+
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
30
|
+
| **ADR** | **Architectural Decision Record** — A document that captures an important architectural decision along with its context, alternatives considered, and consequences. |
|
|
31
|
+
| **MCP** | **Model Context Protocol** — An open standard enabling AI assistants to connect to external tools and data sources. |
|
|
32
|
+
| **Tree-sitter** | An incremental parsing library that provides AST (Abstract Syntax Tree) analysis for 50+ languages. Used for semantic code understanding, extracting function signatures, and identifying architectural patterns. |
|
|
33
|
+
| **Knowledge Graph** | A graph database maintained by the server that tracks relationships between ADRs, code implementations, and architectural decisions. Enables intelligent code linking and impact analysis. |
|
|
34
|
+
| **Smart Code Linking** | AI-powered discovery of code files related to ADRs and architectural decisions, using keyword extraction and semantic search. |
|
|
24
35
|
|
|
25
|
-
|
|
36
|
+
</details>
|
|
37
|
+
|
|
38
|
+
---
|
|
26
39
|
|
|
27
|
-
|
|
40
|
+
**Author**: [Tosin Akinosho](https://github.com/tosin2013) | **Repository**: [GitHub](https://github.com/tosin2013/mcp-adr-analysis-server.git)
|
|
28
41
|
|
|
29
42
|
## ✨ Core Capabilities
|
|
30
43
|
|
|
@@ -38,6 +51,27 @@ The Model Context Protocol enables seamless integration between AI assistants an
|
|
|
38
51
|
|
|
39
52
|
📖 **[View Full Capabilities →](docs/explanation/)**
|
|
40
53
|
|
|
54
|
+
## Prerequisites
|
|
55
|
+
|
|
56
|
+
Before installing, verify you have:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
node --version # Should show v20.0.0 or higher
|
|
60
|
+
npm --version # Should show 9.0.0 or higher (included with Node.js 20+)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Required:**
|
|
64
|
+
|
|
65
|
+
- **Node.js 20.0.0 or higher** — [Download](https://nodejs.org/) or use [nvm](https://github.com/nvm-sh/nvm)/[fnm](https://github.com/Schniz/fnm)
|
|
66
|
+
- **npm 9.0.0 or higher** (included with Node.js 20+)
|
|
67
|
+
- **An MCP-compatible client** — [Claude Desktop](https://claude.ai/download), [Cline](https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev), [Cursor](https://cursor.sh/), or [Windsurf](https://codeium.com/windsurf)
|
|
68
|
+
|
|
69
|
+
### Network Requirements
|
|
70
|
+
|
|
71
|
+
- **Internet access required** during `npm install` for native module compilation ([tree-sitter](https://tree-sitter.github.io/tree-sitter/) incremental code parsers for YAML and TypeScript)
|
|
72
|
+
- If behind a corporate proxy, set `HTTP_PROXY` and `HTTPS_PROXY` environment variables
|
|
73
|
+
- **Offline fallback**: If native builds fail, the server operates in reduced mode without tree-sitter code analysis
|
|
74
|
+
|
|
41
75
|
## 📦 Quick Installation
|
|
42
76
|
|
|
43
77
|
```bash
|
|
@@ -47,15 +81,21 @@ npm install -g mcp-adr-analysis-server
|
|
|
47
81
|
# Option 2: Use npx (no installation required)
|
|
48
82
|
npx mcp-adr-analysis-server
|
|
49
83
|
|
|
50
|
-
# Option 3:
|
|
84
|
+
# Option 3: From source (for development or customization)
|
|
85
|
+
git clone https://github.com/tosin2013/mcp-adr-analysis-server.git
|
|
86
|
+
cd mcp-adr-analysis-server && npm install && npm run build
|
|
87
|
+
|
|
88
|
+
# Option 4: RHEL 9/10 systems (special installer)
|
|
51
89
|
curl -sSL https://raw.githubusercontent.com/tosin2013/mcp-adr-analysis-server/main/scripts/install-rhel.sh | bash
|
|
52
90
|
```
|
|
53
91
|
|
|
92
|
+
> **Note:** When installing from source, `npm run build` is required before running the server since the `bin` entry points to `./dist/src/index.js`.
|
|
93
|
+
|
|
54
94
|
📖 **[Detailed Installation Guide →](docs/tutorials/01-first-steps.md)** | **[RHEL Setup →](scripts/install-rhel.sh)**
|
|
55
95
|
|
|
56
96
|
## ⚡ Quick Setup (3 Steps)
|
|
57
97
|
|
|
58
|
-
1. **Get API Key**: [OpenRouter.ai/keys](https://openrouter.ai/keys)
|
|
98
|
+
1. **Get API Key**: Sign up at [OpenRouter.ai/keys](https://openrouter.ai/keys) — OpenRouter is an API gateway that provides access to multiple AI models (Claude, GPT, etc.) through a single key. _No API key? The server still works in prompt-only mode — see [Execution Modes](#execution-modes) below._
|
|
59
99
|
2. **Set Environment**: `OPENROUTER_API_KEY=your_key` + `EXECUTION_MODE=full`
|
|
60
100
|
3. **Configure Client**: Add to Claude Desktop, Cline, Cursor, or Windsurf
|
|
61
101
|
|
|
@@ -74,6 +114,20 @@ curl -sSL https://raw.githubusercontent.com/tosin2013/mcp-adr-analysis-server/ma
|
|
|
74
114
|
}
|
|
75
115
|
```
|
|
76
116
|
|
|
117
|
+
> **Claude Desktop users:** Save this JSON to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows).
|
|
118
|
+
|
|
119
|
+
<details>
|
|
120
|
+
<summary><b>Config locations for other clients</b></summary>
|
|
121
|
+
|
|
122
|
+
| Client | Config file location |
|
|
123
|
+
| ---------------------------- | ----------------------------------------------------------------------------- |
|
|
124
|
+
| **Claude Desktop (macOS)** | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
125
|
+
| **Claude Desktop (Windows)** | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
126
|
+
| **Cline (VS Code)** | VS Code Settings → Cline → MCP Servers (or `.vscode/cline_mcp_settings.json`) |
|
|
127
|
+
| **Cursor** | Cursor Settings → MCP → Add Server |
|
|
128
|
+
|
|
129
|
+
</details>
|
|
130
|
+
|
|
77
131
|
<details>
|
|
78
132
|
<summary><b>With ADR Aggregator (Optional)</b></summary>
|
|
79
133
|
|
|
@@ -99,9 +153,22 @@ Get your API key at [adraggregator.com](https://adraggregator.com)
|
|
|
99
153
|
|
|
100
154
|
📖 **[Full Configuration Guide →](docs/reference/mcp-client-config.md)** | **[Client Setup →](docs/reference/environment-config.md)**
|
|
101
155
|
|
|
156
|
+
### Execution Modes
|
|
157
|
+
|
|
158
|
+
| | **Full Mode** | **Prompt-Only Mode** |
|
|
159
|
+
| ------------------------ | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
160
|
+
| **Requires API key?** | Yes (`OPENROUTER_API_KEY`) | No |
|
|
161
|
+
| **Returns** | Actual analysis results with confidence scores | Prompts you can paste into any AI chat |
|
|
162
|
+
| **Set via** | `EXECUTION_MODE=full` | `EXECUTION_MODE=prompt-only` (default) |
|
|
163
|
+
| **Best for** | Production use, automation | Trying it out, no-cost exploration |
|
|
164
|
+
| **Available Features** | All 73 tools, AI analysis, confidence scoring, Smart Code Linking, Knowledge Graph | Analysis prompts, templates, local file operations, ADR discovery |
|
|
165
|
+
| **Unavailable Features** | — | AI execution, confidence scores, Smart Code Linking, web research |
|
|
166
|
+
|
|
167
|
+
**Tip:** Start with prompt-only mode to explore the tool catalog — you can analyze projects, discover ADRs, and generate templates without an API key. Add an API key when you're ready for AI-powered analysis with confidence scoring.
|
|
168
|
+
|
|
102
169
|
## 🚀 Usage Examples
|
|
103
170
|
|
|
104
|
-
|
|
171
|
+
Just ask your MCP client in natural language — no code required:
|
|
105
172
|
|
|
106
173
|
> "Analyze this React project's architecture and suggest ADRs for any implicit decisions"
|
|
107
174
|
|
|
@@ -111,6 +178,11 @@ Get your API key at [adraggregator.com](https://adraggregator.com)
|
|
|
111
178
|
|
|
112
179
|
**The server returns actual analysis results** instead of prompts to submit elsewhere!
|
|
113
180
|
|
|
181
|
+
<details>
|
|
182
|
+
<summary><b>Programmatic Usage (Advanced)</b></summary>
|
|
183
|
+
|
|
184
|
+
If you're integrating the server into your own tooling via the MCP SDK:
|
|
185
|
+
|
|
114
186
|
```typescript
|
|
115
187
|
// Basic project analysis
|
|
116
188
|
const analysis = await analyzeProjectEcosystem({
|
|
@@ -138,8 +210,14 @@ const relatedCode = await findRelatedCode(
|
|
|
138
210
|
);
|
|
139
211
|
```
|
|
140
212
|
|
|
213
|
+
</details>
|
|
214
|
+
|
|
141
215
|
📖 **[Complete Usage Guide →](docs/tutorials/)** | **[API Reference →](docs/reference/)**
|
|
142
216
|
|
|
217
|
+
> **Try it out:** This repo includes a [`sample-project/`](sample-project/) directory with example ADRs and source code. Point `PROJECT_PATH` at it to experiment without affecting your own codebase.
|
|
218
|
+
>
|
|
219
|
+
> **Note:** The sample project is only available when **cloning from source** (Option 3 above). If you installed via npm (Option 1 or 2), create your own test project or clone the repo separately to access the sample: `git clone --depth 1 https://github.com/tosin2013/mcp-adr-analysis-server.git sample-test`
|
|
220
|
+
|
|
143
221
|
## 🎯 Use Cases
|
|
144
222
|
|
|
145
223
|
👨💻 **AI Coding Assistants** - Enhance Claude, Cline, Cursor with architectural intelligence
|
|
@@ -152,20 +230,20 @@ const relatedCode = await findRelatedCode(
|
|
|
152
230
|
## 🛠️ Technology Stack
|
|
153
231
|
|
|
154
232
|
**Runtime:** Node.js 20+ • **Language:** TypeScript • **Framework:** MCP SDK • **Testing:** Jest (>80% coverage)
|
|
155
|
-
**Search:** ripgrep + fast-glob • **AI Integration:** OpenRouter.ai • **Web Research:** Firecrawl • **Code Analysis:** Smart Code Linking
|
|
233
|
+
**Search:** [ripgrep](https://github.com/BurntSushi/ripgrep) (fast recursive text search) + fast-glob (file matching) • **AI Integration:** OpenRouter.ai • **Web Research:** [Firecrawl](https://firecrawl.dev/) (web page extraction API) • **Code Analysis:** [tree-sitter](https://tree-sitter.github.io/tree-sitter/) (incremental code parser) + Smart Code Linking
|
|
156
234
|
|
|
157
235
|
📖 **[Technical Details →](docs/explanation/server-architecture.md)**
|
|
158
236
|
|
|
159
237
|
## 📁 Project Structure
|
|
160
238
|
|
|
161
239
|
```
|
|
162
|
-
src/tools/ #
|
|
240
|
+
src/tools/ # 73 MCP tools for analysis
|
|
163
241
|
docs/adrs/ # Architectural Decision Records
|
|
164
242
|
tests/ # >80% test coverage
|
|
165
243
|
.github/ # CI/CD automation
|
|
166
244
|
```
|
|
167
245
|
|
|
168
|
-
📖 **[Full Structure →](docs/
|
|
246
|
+
📖 **[Full Structure →](docs/tutorials/)**
|
|
169
247
|
|
|
170
248
|
## 🧪 Testing
|
|
171
249
|
|
|
@@ -176,10 +254,22 @@ npm run test:coverage # Coverage report
|
|
|
176
254
|
|
|
177
255
|
📖 **[Testing Guide →](docs/how-to-guides/troubleshooting.md)**
|
|
178
256
|
|
|
179
|
-
## 🔥 Firecrawl Integration (Optional)
|
|
257
|
+
## 🔥 Firecrawl Integration (Optional — Skip for Getting Started)
|
|
180
258
|
|
|
181
259
|
**Enhanced web research capabilities for comprehensive architectural analysis.**
|
|
182
260
|
|
|
261
|
+
> **Note:** You don't need Firecrawl for basic ADR analysis. The server works fully without it. Only configure Firecrawl if you need web research features like the `perform_research` tool with external sources.
|
|
262
|
+
|
|
263
|
+
<details>
|
|
264
|
+
<summary><b>When is Firecrawl useful?</b></summary>
|
|
265
|
+
|
|
266
|
+
- **ADR research** — automatically pull best practices from official docs when generating ADRs
|
|
267
|
+
- **Technology evaluation** — compare frameworks by crawling their documentation and changelogs
|
|
268
|
+
- **Security audits** — check CVE databases and security advisories for your dependencies
|
|
269
|
+
- **Migration planning** — gather migration guides and breaking-change notes from upstream projects
|
|
270
|
+
|
|
271
|
+
</details>
|
|
272
|
+
|
|
183
273
|
```bash
|
|
184
274
|
# Option 1: Cloud service (recommended)
|
|
185
275
|
export FIRECRAWL_ENABLED="true"
|
|
@@ -192,13 +282,18 @@ export FIRECRAWL_BASE_URL="http://localhost:3000"
|
|
|
192
282
|
# Option 3: Disabled (default - server works without web search)
|
|
193
283
|
```
|
|
194
284
|
|
|
195
|
-
**Benefits:** Real-time research • Enhanced ADRs • Best practices discovery • Intelligent web scraping
|
|
196
|
-
|
|
197
285
|
📖 **[Firecrawl Setup Guide →](docs/reference/environment-config.md#firecrawl-configuration)**
|
|
198
286
|
|
|
199
287
|
## 🌐 ADR Aggregator Integration (Optional)
|
|
200
288
|
|
|
201
|
-
|
|
289
|
+
[ADR Aggregator](https://adraggregator.com) is a platform for cross-team ADR visibility and governance. It provides:
|
|
290
|
+
|
|
291
|
+
- **Cross-repository knowledge graphs** — See how architectural decisions relate across projects
|
|
292
|
+
- **Governance dashboards** — Track ADR compliance, staleness, and review cycles
|
|
293
|
+
- **Template library** — Access domain-specific ADR templates (security, API, database, etc.)
|
|
294
|
+
- **Team collaboration** — Share architectural decisions organization-wide
|
|
295
|
+
|
|
296
|
+
> **Note:** ADR Aggregator is optional. All core analysis features work without it.
|
|
202
297
|
|
|
203
298
|
```bash
|
|
204
299
|
# Set your API key (get one at adraggregator.com)
|
|
@@ -207,15 +302,15 @@ export ADR_AGGREGATOR_API_KEY="agg_your_key_here"
|
|
|
207
302
|
|
|
208
303
|
### Available Tools
|
|
209
304
|
|
|
210
|
-
| Tool | Description |
|
|
211
|
-
| ------------------------- | ---------------------------------- | ---- |
|
|
212
|
-
| `sync_to_aggregator` | Push local ADRs to platform |
|
|
213
|
-
| `get_adr_context` | Pull ADR context from platform |
|
|
214
|
-
| `get_staleness_report` | Get ADR governance/health reports |
|
|
215
|
-
| `get_adr_templates` | Retrieve domain-specific templates |
|
|
216
|
-
| `get_adr_diagrams` | Get Mermaid diagrams for ADRs |
|
|
217
|
-
| `validate_adr_compliance` | Validate ADR implementation |
|
|
218
|
-
| `get_knowledge_graph` | Cross-repository knowledge graph |
|
|
305
|
+
| Tool | Description | Free | Pro+ | Team |
|
|
306
|
+
| ------------------------- | ---------------------------------- | ---- | ---- | ---- |
|
|
307
|
+
| `sync_to_aggregator` | Push local ADRs to platform | ✅ | ✅ | ✅ |
|
|
308
|
+
| `get_adr_context` | Pull ADR context from platform | ✅ | ✅ | ✅ |
|
|
309
|
+
| `get_staleness_report` | Get ADR governance/health reports | ✅ | ✅ | ✅ |
|
|
310
|
+
| `get_adr_templates` | Retrieve domain-specific templates | ✅ | ✅ | ✅ |
|
|
311
|
+
| `get_adr_diagrams` | Get Mermaid diagrams for ADRs | — | ✅ | ✅ |
|
|
312
|
+
| `validate_adr_compliance` | Validate ADR implementation | — | ✅ | ✅ |
|
|
313
|
+
| `get_knowledge_graph` | Cross-repository knowledge graph | — | — | ✅ |
|
|
219
314
|
|
|
220
315
|
### Workflow for New Repos
|
|
221
316
|
|
|
@@ -234,7 +329,7 @@ sync_to_aggregator(full_sync: true)
|
|
|
234
329
|
|
|
235
330
|
**Benefits:** Cross-team visibility • Staleness alerts • Compliance tracking • Organization-wide knowledge graph
|
|
236
331
|
|
|
237
|
-
📖 **[ADR Aggregator Guide →](https://adraggregator.com/docs)**
|
|
332
|
+
📖 **[ADR Aggregator Guide →](https://adraggregator.com/docs)** | 📖 **[MCP Integration Guide →](https://adraggregator.com/mcp-guide)**
|
|
238
333
|
|
|
239
334
|
## 🔧 Development
|
|
240
335
|
|
|
@@ -246,6 +341,17 @@ npm install && npm run build && npm test
|
|
|
246
341
|
|
|
247
342
|
**Quality Standards:** TypeScript strict mode • ESLint • >80% test coverage • Pre-commit hooks
|
|
248
343
|
|
|
344
|
+
### Viewing Documentation Locally
|
|
345
|
+
|
|
346
|
+
API documentation is generated with [TypeDoc](https://typedoc.org/):
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
npm run docs:build # Generate API docs into docs/api/
|
|
350
|
+
npm run docs:serve # Serve locally via Python HTTP server
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Then open `http://localhost:8080` in your browser. Markdown documentation lives in `docs/` and can be browsed directly on GitHub.
|
|
354
|
+
|
|
249
355
|
📖 **[Development Guide →](docs/how-to-guides/getting-started-workflow-guidance.md)** | **[Contributing →](CONTRIBUTING.md)**
|
|
250
356
|
|
|
251
357
|
## 🔧 Troubleshooting
|
|
@@ -257,7 +363,7 @@ npm install && npm run build && npm test
|
|
|
257
363
|
- **Module not found**: Run `npm install && npm run build`
|
|
258
364
|
- **Permission denied**: Check file permissions and project path
|
|
259
365
|
|
|
260
|
-
📖 **[Complete Troubleshooting Guide →](docs/troubleshooting.md)**
|
|
366
|
+
📖 **[Complete Troubleshooting Guide →](docs/how-to-guides/troubleshooting.md)**
|
|
261
367
|
|
|
262
368
|
## 🔒 Security & Performance
|
|
263
369
|
|
|
@@ -301,7 +407,7 @@ Use our [**issue templates**](https://github.com/tosin2013/mcp-adr-analysis-serv
|
|
|
301
407
|
|
|
302
408
|
**Official:** [MCP Specification](https://modelcontextprotocol.io/) • [MCP SDK](https://github.com/modelcontextprotocol/typescript-sdk)
|
|
303
409
|
**Community:** [MCP Registry](https://github.com/modelcontextprotocol/servers) • [Discord](https://discord.gg/modelcontextprotocol)
|
|
304
|
-
**Project:** [ADRs](./docs/adrs/) • [Progress](./docs/release-dashboard.md) • [Publishing Guide](./docs/how-to-guides/
|
|
410
|
+
**Project:** [ADRs](./docs/adrs/) • [Progress](./docs/release-dashboard.md) • [Publishing Guide](./docs/how-to-guides/push-tags-to-npm.md)
|
|
305
411
|
|
|
306
412
|
## 📄 License
|
|
307
413
|
|