mcp-adr 0.1.0__tar.gz
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.
- mcp_adr-0.1.0/.github/workflows/publish.yml +20 -0
- mcp_adr-0.1.0/.gitignore +10 -0
- mcp_adr-0.1.0/CLAUDE.md +83 -0
- mcp_adr-0.1.0/PKG-INFO +366 -0
- mcp_adr-0.1.0/README.md +339 -0
- mcp_adr-0.1.0/docs/plans/2026-04-11-mcp-adr.md +967 -0
- mcp_adr-0.1.0/docs/specs/2026-04-11-mcp-adr-design.md +350 -0
- mcp_adr-0.1.0/pyproject.toml +58 -0
- mcp_adr-0.1.0/skills/adr/SKILL.md +224 -0
- mcp_adr-0.1.0/src/mcp_adr/__init__.py +3 -0
- mcp_adr-0.1.0/src/mcp_adr/analysis.py +109 -0
- mcp_adr-0.1.0/src/mcp_adr/diagrams/__init__.py +20 -0
- mcp_adr-0.1.0/src/mcp_adr/diagrams/drawio.py +114 -0
- mcp_adr-0.1.0/src/mcp_adr/diagrams/mermaid.py +51 -0
- mcp_adr-0.1.0/src/mcp_adr/diagrams/plantuml.py +30 -0
- mcp_adr-0.1.0/src/mcp_adr/export.py +194 -0
- mcp_adr-0.1.0/src/mcp_adr/export_templates/adr.html.j2 +107 -0
- mcp_adr-0.1.0/src/mcp_adr/export_templates/index.html.j2 +53 -0
- mcp_adr-0.1.0/src/mcp_adr/index.py +44 -0
- mcp_adr-0.1.0/src/mcp_adr/models.py +77 -0
- mcp_adr-0.1.0/src/mcp_adr/parser.py +308 -0
- mcp_adr-0.1.0/src/mcp_adr/server.py +400 -0
- mcp_adr-0.1.0/src/mcp_adr/storage.py +104 -0
- mcp_adr-0.1.0/src/mcp_adr/templates.py +99 -0
- mcp_adr-0.1.0/tests/__init__.py +0 -0
- mcp_adr-0.1.0/tests/conftest.py +125 -0
- mcp_adr-0.1.0/tests/test_analysis.py +127 -0
- mcp_adr-0.1.0/tests/test_diagrams.py +282 -0
- mcp_adr-0.1.0/tests/test_export.py +172 -0
- mcp_adr-0.1.0/tests/test_index.py +129 -0
- mcp_adr-0.1.0/tests/test_models.py +55 -0
- mcp_adr-0.1.0/tests/test_parser.py +222 -0
- mcp_adr-0.1.0/tests/test_server.py +299 -0
- mcp_adr-0.1.0/tests/test_storage.py +172 -0
- mcp_adr-0.1.0/tests/test_templates.py +155 -0
- mcp_adr-0.1.0/uv.lock +1697 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.12"
|
|
18
|
+
- run: pip install build
|
|
19
|
+
- run: python -m build
|
|
20
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
mcp_adr-0.1.0/.gitignore
ADDED
mcp_adr-0.1.0/CLAUDE.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# CLAUDE.md — mcp-adr
|
|
2
|
+
|
|
3
|
+
MCP server for Architecture Decision Records: create, manage, diagram, and export ADRs from Markdown files on disk.
|
|
4
|
+
|
|
5
|
+
## Quick Reference
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install dependencies (dev + runtime)
|
|
9
|
+
uv sync
|
|
10
|
+
|
|
11
|
+
# Run tests
|
|
12
|
+
uv run pytest
|
|
13
|
+
uv run pytest tests/test_models.py -v
|
|
14
|
+
|
|
15
|
+
# Lint / format
|
|
16
|
+
uv run ruff check .
|
|
17
|
+
uv run ruff format .
|
|
18
|
+
|
|
19
|
+
# Run the MCP server locally
|
|
20
|
+
uv run mcp-adr
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Architecture
|
|
24
|
+
|
|
25
|
+
The project follows a single-package layout under `src/mcp_adr/`. Each module has one clear responsibility so tools compose without circular imports.
|
|
26
|
+
|
|
27
|
+
- `models.py` — Pydantic models and enums (`Status`, `ADRType`, `DiagramFormat`, `DiagramType`, `ADRMetadata`, `ADRContent`).
|
|
28
|
+
- `storage.py` — Filesystem access: locate ADR directory, read/write files, compute next ADR number.
|
|
29
|
+
- `parser.py` — Parse Markdown ADR files into `ADRContent`; render `ADRContent` back to Markdown.
|
|
30
|
+
- `templates.py` — Jinja2 templates for new ADRs, including `TYPE_EXTRA_SECTIONS` keyed by `ADRType`.
|
|
31
|
+
- `diagrams/` — One submodule per diagram format (mermaid, plantuml, drawio). Dispatched via `get_diagram_generator()`.
|
|
32
|
+
- `analysis.py` — Dependency graphs, supersession chains, status rollups across ADRs.
|
|
33
|
+
- `export.py` — Bundle ADRs into HTML / PDF / single-file Markdown.
|
|
34
|
+
- `index.py` — Build and refresh the ADR index (README-style table of contents).
|
|
35
|
+
- `server.py` — FastMCP entrypoint. Registers every tool with `@mcp.tool()` and delegates to the modules above.
|
|
36
|
+
|
|
37
|
+
## Agent Rules
|
|
38
|
+
|
|
39
|
+
- **Understand before implementing.** Read the spec and plan in `docs/` before touching code.
|
|
40
|
+
- **Verify before asserting.** Test assumptions against the actual code or documentation; never guess APIs.
|
|
41
|
+
- **English only.** All code, identifiers, comments, docstrings, and commit messages in English.
|
|
42
|
+
- **No emoji** in code, commits, or documentation.
|
|
43
|
+
- **Follow existing patterns.** Do not refactor unrelated code; keep diffs scoped to the task.
|
|
44
|
+
- **Scope discipline.** Do not add files or features outside the task plan.
|
|
45
|
+
|
|
46
|
+
## Git Commit Conventions
|
|
47
|
+
|
|
48
|
+
Use Conventional Commits:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
<type>(<optional scope>): <imperative summary>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Types: `feat`, `fix`, `docs`, `chore`, `refactor`, `test`, `perf`, `build`, `ci`.
|
|
55
|
+
|
|
56
|
+
Rules:
|
|
57
|
+
- Imperative mood ("add", not "added").
|
|
58
|
+
- Keep the subject under ~72 chars.
|
|
59
|
+
- One logical change per commit.
|
|
60
|
+
- Reference plan tasks in the body when relevant.
|
|
61
|
+
|
|
62
|
+
Examples:
|
|
63
|
+
- `feat(parser): parse ADR metadata from Markdown header`
|
|
64
|
+
- `fix(storage): handle missing ADR directory`
|
|
65
|
+
- `test(models): cover ADRMetadata defaults`
|
|
66
|
+
|
|
67
|
+
## Conventions
|
|
68
|
+
|
|
69
|
+
### Adding a new MCP tool
|
|
70
|
+
1. Implement the logic in the appropriate module (e.g. `analysis.py`).
|
|
71
|
+
2. Register it in `server.py` with `@mcp.tool()`, keeping the function body a thin delegate.
|
|
72
|
+
3. Add unit tests in `tests/test_<module>.py` and, if needed, an end-to-end test in `tests/test_server.py`.
|
|
73
|
+
|
|
74
|
+
### Adding a new ADR template section
|
|
75
|
+
- Edit `TYPE_EXTRA_SECTIONS` in `templates.py`, keyed by `ADRType`.
|
|
76
|
+
- Update `parser.py` if the new section must round-trip into `ADRContent.extra_sections`.
|
|
77
|
+
- Add a test in `tests/test_templates.py`.
|
|
78
|
+
|
|
79
|
+
### Adding a new diagram format
|
|
80
|
+
1. Add the value to the `DiagramFormat` enum in `models.py`.
|
|
81
|
+
2. Create a module under `src/mcp_adr/diagrams/` implementing the generator interface.
|
|
82
|
+
3. Register it in `get_diagram_generator()`.
|
|
83
|
+
4. Add tests in `tests/test_diagrams.py`.
|
mcp_adr-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mcp-adr
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for Architecture Decision Records — create, manage, diagram, and export ADRs
|
|
5
|
+
Project-URL: Homepage, https://github.com/mauriziomocci/mcp-adr
|
|
6
|
+
Project-URL: Repository, https://github.com/mauriziomocci/mcp-adr
|
|
7
|
+
Project-URL: Issues, https://github.com/mauriziomocci/mcp-adr/issues
|
|
8
|
+
Author-email: Maurizio Mocci <mauriziomocci@gmail.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
Keywords: adr,architecture,decision-records,diagrams,mcp
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Requires-Dist: fastmcp<4.0.0,>=3.0.0
|
|
20
|
+
Requires-Dist: jinja2>=3.1.0
|
|
21
|
+
Requires-Dist: pydantic>=2.0.0
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
|
|
24
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: ruff>=0.4.0; extra == 'dev'
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# mcp-adr
|
|
29
|
+
|
|
30
|
+
[](https://pypi.org/project/mcp-adr/)
|
|
31
|
+
[](https://opensource.org/licenses/MIT)
|
|
32
|
+
[](https://pypi.org/project/mcp-adr/)
|
|
33
|
+
|
|
34
|
+
An [MCP](https://modelcontextprotocol.io) server that lets AI assistants create, manage, diagram, and export **Architecture Decision Records** (ADRs) directly from your conversation.
|
|
35
|
+
|
|
36
|
+
## What are ADRs?
|
|
37
|
+
|
|
38
|
+
Architecture Decision Records are lightweight documents that capture the context, rationale, and consequences of significant architectural choices made during software development. They provide a searchable, version-controlled audit trail that helps teams understand why the system is built the way it is — not just how. Keeping ADRs close to the code prevents institutional knowledge from walking out the door when team members change.
|
|
39
|
+
|
|
40
|
+
## Features
|
|
41
|
+
|
|
42
|
+
- **Six typed templates** — architecture, technology, integration, data, security, infrastructure — each with domain-specific sections generated automatically
|
|
43
|
+
- **Full lifecycle management** — propose, accept, deprecate, or supersede ADRs with a single tool call; bidirectional links are maintained automatically
|
|
44
|
+
- **Diagram generation** — Mermaid, PlantUML, and Draw.io output formats with per-ADR and project-wide overview diagrams
|
|
45
|
+
- **Impact analysis** — find every ADR that mentions a component, build a full transitive dependency graph
|
|
46
|
+
- **Full-text search** — query across all ADR content in the project
|
|
47
|
+
- **HTML export** — render every ADR to standalone HTML pages with navigation
|
|
48
|
+
- **Companion skill** — a Claude Code skill that gives the assistant deep ADR workflow knowledge without tool calls
|
|
49
|
+
|
|
50
|
+
## Installation
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install mcp-adr
|
|
54
|
+
# or
|
|
55
|
+
uv add mcp-adr
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Configuration
|
|
59
|
+
|
|
60
|
+
### Claude Code (`settings.json`)
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"mcpServers": {
|
|
65
|
+
"mcp-adr": {
|
|
66
|
+
"command": "mcp-adr"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Environment variables
|
|
73
|
+
|
|
74
|
+
| Variable | Default | Description |
|
|
75
|
+
|-----------|------------|------------------------------------------|
|
|
76
|
+
| `ADR_DIR` | `docs/adr` | Directory where ADR markdown files live |
|
|
77
|
+
|
|
78
|
+
Every tool also accepts an optional `project_path` parameter to override the working directory at call time.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Tools Reference
|
|
83
|
+
|
|
84
|
+
### CRUD
|
|
85
|
+
|
|
86
|
+
| Tool | Key parameters | Description |
|
|
87
|
+
|--------------|------------------------------------------------------|-----------------------------------------------------|
|
|
88
|
+
| `adr_create` | `title`, `type`, `context`, `decision`, `deciders` | Create a new ADR from a typed template |
|
|
89
|
+
| `adr_read` | `query` | Read an ADR by number or title substring |
|
|
90
|
+
| `adr_update` | `number`, `content` | Overwrite an ADR with new markdown content |
|
|
91
|
+
| `adr_list` | `status`, `type` | List all ADRs, optionally filtered |
|
|
92
|
+
| `adr_search` | `query` | Full-text search across all ADR content |
|
|
93
|
+
|
|
94
|
+
### Lifecycle
|
|
95
|
+
|
|
96
|
+
| Tool | Key parameters | Description |
|
|
97
|
+
|--------------------|---------------------------------------|------------------------------------------------------|
|
|
98
|
+
| `adr_update_status`| `number`, `status`, `reason` | Change status (Proposed/Accepted/Deprecated/Superseded) |
|
|
99
|
+
| `adr_supersede` | `old_number`, `new_number` | Mark an ADR as superseded, linking both documents |
|
|
100
|
+
| `adr_deprecate` | `number`, `reason` | Deprecate an ADR with a recorded reason |
|
|
101
|
+
| `adr_link` | `from_number`, `to_number` | Add a bidirectional related link between two ADRs |
|
|
102
|
+
| `adr_history` | `query` | Return matching ADRs as a timeline sorted by date |
|
|
103
|
+
|
|
104
|
+
### Diagrams
|
|
105
|
+
|
|
106
|
+
| Tool | Key parameters | Description |
|
|
107
|
+
|---------------|---------------------------------------------|---------------------------------------------------|
|
|
108
|
+
| `adr_diagram` | `number`, `format`, `diagram_type` | Generate a diagram for a single ADR |
|
|
109
|
+
| `adr_overview`| `format`, `status_filter` | Generate an overview diagram of all ADRs |
|
|
110
|
+
|
|
111
|
+
### Analysis
|
|
112
|
+
|
|
113
|
+
| Tool | Key parameters | Description |
|
|
114
|
+
|--------------------|---------------------------|------------------------------------------------------|
|
|
115
|
+
| `adr_impact` | `component` | Find all ADRs that mention a given component |
|
|
116
|
+
| `adr_dependencies` | `number`, `format` | Build or filter the ADR dependency graph |
|
|
117
|
+
|
|
118
|
+
### Export
|
|
119
|
+
|
|
120
|
+
| Tool | Key parameters | Description |
|
|
121
|
+
|--------------|------------------|------------------------------------|
|
|
122
|
+
| `adr_export` | `output_dir` | Export all ADRs to HTML files |
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Example Workflow
|
|
127
|
+
|
|
128
|
+
The following example walks through capturing a major API migration decision.
|
|
129
|
+
|
|
130
|
+
**1. Create the ADR**
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
adr_create(
|
|
134
|
+
title="Migrate from REST to GraphQL",
|
|
135
|
+
type="architecture",
|
|
136
|
+
context="The mobile team reports over-fetching on every screen. REST endpoints return 40+ fields; clients use 5.",
|
|
137
|
+
decision="Adopt GraphQL via Apollo Server. REST endpoints remain for external partners.",
|
|
138
|
+
deciders="platform-team"
|
|
139
|
+
)
|
|
140
|
+
# → {"number": 1, "title": "Migrate from REST to GraphQL", "status": "Proposed", ...}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**2. Generate a diagram**
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
adr_diagram(number=1, format="mermaid")
|
|
147
|
+
# → {"number": 1, "format": "mermaid", "result": "<Mermaid context for LLM to render>"}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**3. Accept the decision**
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
adr_update_status(number=1, status="Accepted", reason="Approved in architecture review 2026-04-11")
|
|
154
|
+
# → {"number": 1, "old_status": "Proposed", "new_status": "Accepted"}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**4. Check impact before changing the API layer**
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
adr_impact(component="REST")
|
|
161
|
+
# → {"component": "REST", "count": 1, "results": [...]}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**5. Export to HTML for sharing**
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
adr_export(output_dir="site/adrs")
|
|
168
|
+
# → {"output_dir": "site/adrs", "files_count": 1, "files": ["site/adrs/ADR-0001.html"]}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Template Types
|
|
174
|
+
|
|
175
|
+
Each `type` value activates a set of domain-specific extra sections inserted between **Consequences** and **Diagram**.
|
|
176
|
+
|
|
177
|
+
| Type | Extra sections |
|
|
178
|
+
|------------------|----------------------------------------------------|
|
|
179
|
+
| `architecture` | Components, Interactions, Constraints |
|
|
180
|
+
| `technology` | Evaluation Criteria, Comparison Matrix |
|
|
181
|
+
| `integration` | Interface Contract, Data Flow, Failure Modes |
|
|
182
|
+
| `data` | Schema Changes, Migration Strategy, Rollback Plan |
|
|
183
|
+
| `security` | Threat Model, Controls, Compliance |
|
|
184
|
+
| `infrastructure` | Topology, Scaling Strategy, DR Plan |
|
|
185
|
+
|
|
186
|
+
All types share the common sections: **Context**, **Decision**, **Alternatives Considered**, **Consequences** (Positive / Negative / Risks), **Diagram**, **Notes**.
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Diagram Formats
|
|
191
|
+
|
|
192
|
+
| Format | Output | Rendering | Best for |
|
|
193
|
+
|-----------|-----------|------------------------------|--------------------------------------------|
|
|
194
|
+
| `mermaid` | Text | GitHub, GitLab, Notion, etc. | Quick inline diagrams in markdown |
|
|
195
|
+
| `plantuml`| Text | PlantUML server or plugin | Richer UML notation, sequence diagrams |
|
|
196
|
+
| `drawio` | XML file | draw.io / diagrams.net | Editable, polished architecture diagrams |
|
|
197
|
+
|
|
198
|
+
For `mermaid` and `plantuml`, the tool returns a context block that the LLM uses to render or display the diagram. For `drawio`, the tool writes a `.drawio` file alongside the ADR and records a link in the ADR's **Diagram** section.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Export
|
|
203
|
+
|
|
204
|
+
`adr_export` renders every ADR in the project to a self-contained HTML file using a built-in Jinja2 template. Files are written to `output_dir` (default: `docs/adr/html`). An `index.html` is also generated.
|
|
205
|
+
|
|
206
|
+
```python
|
|
207
|
+
adr_export(output_dir="docs/adr/html")
|
|
208
|
+
# Produces:
|
|
209
|
+
# docs/adr/html/index.html
|
|
210
|
+
# docs/adr/html/ADR-0001-migrate-from-rest-to-graphql.html
|
|
211
|
+
# ...
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Companion Skill
|
|
217
|
+
|
|
218
|
+
A Claude Code skill is included that gives the assistant deep ADR workflow knowledge — it understands naming conventions, when to propose vs accept, how to chain tools, and how to produce complete ADRs in one pass.
|
|
219
|
+
|
|
220
|
+
**Install**
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
cp skills/adr/SKILL.md ~/.claude/skills/adr/SKILL.md
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
After installation, Claude Code will automatically load the skill when working with ADRs.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Development
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
git clone https://github.com/mauriziomocci/mcp-adr.git
|
|
234
|
+
cd mcp-adr
|
|
235
|
+
uv sync
|
|
236
|
+
uv run pytest -v
|
|
237
|
+
uv run ruff check src/mcp_adr/
|
|
238
|
+
uv run ruff format --check src/mcp_adr/
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
# mcp-adr (Italiano)
|
|
246
|
+
|
|
247
|
+
Un server [MCP](https://modelcontextprotocol.io) che permette agli assistenti AI di creare, gestire, visualizzare ed esportare **Architecture Decision Records** (ADR) direttamente dalla conversazione.
|
|
248
|
+
|
|
249
|
+
## Cosa sono gli ADR?
|
|
250
|
+
|
|
251
|
+
Gli Architecture Decision Records sono documenti leggeri che catturano il contesto, la motivazione e le conseguenze delle scelte architetturali significative prese durante lo sviluppo software. Forniscono una traccia verificabile e versionata che aiuta i team a capire *perché* il sistema e costruito in un certo modo — non solo *come*. Mantenere gli ADR vicino al codice evita la perdita di conoscenza istituzionale quando i membri del team cambiano.
|
|
252
|
+
|
|
253
|
+
## Installazione
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
pip install mcp-adr
|
|
257
|
+
# oppure
|
|
258
|
+
uv add mcp-adr
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Configurazione
|
|
262
|
+
|
|
263
|
+
### Claude Code (`settings.json`)
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"mcpServers": {
|
|
268
|
+
"mcp-adr": {
|
|
269
|
+
"command": "mcp-adr"
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Variabili d'ambiente
|
|
276
|
+
|
|
277
|
+
| Variabile | Predefinito | Descrizione |
|
|
278
|
+
|-----------|-------------|------------------------------------------------|
|
|
279
|
+
| `ADR_DIR` | `docs/adr` | Directory in cui risiedono i file markdown ADR |
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Riferimento strumenti
|
|
284
|
+
|
|
285
|
+
### CRUD
|
|
286
|
+
|
|
287
|
+
| Strumento | Parametri principali | Descrizione |
|
|
288
|
+
|--------------|----------------------------------------------------|---------------------------------------------------|
|
|
289
|
+
| `adr_create` | `title`, `type`, `context`, `decision`, `deciders` | Crea un nuovo ADR da un template tipizzato |
|
|
290
|
+
| `adr_read` | `query` | Legge un ADR per numero o sottostringa del titolo |
|
|
291
|
+
| `adr_update` | `number`, `content` | Sovrascrive un ADR con nuovo contenuto markdown |
|
|
292
|
+
| `adr_list` | `status`, `type` | Elenca tutti gli ADR, con filtri opzionali |
|
|
293
|
+
| `adr_search` | `query` | Ricerca full-text su tutto il contenuto ADR |
|
|
294
|
+
|
|
295
|
+
### Ciclo di vita
|
|
296
|
+
|
|
297
|
+
| Strumento | Parametri principali | Descrizione |
|
|
298
|
+
|---------------------|-----------------------------------|-----------------------------------------------------------|
|
|
299
|
+
| `adr_update_status` | `number`, `status`, `reason` | Cambia lo stato (Proposed/Accepted/Deprecated/Superseded) |
|
|
300
|
+
| `adr_supersede` | `old_number`, `new_number` | Marca un ADR come sostituito, collegando entrambi |
|
|
301
|
+
| `adr_deprecate` | `number`, `reason` | Depreca un ADR con una motivazione registrata |
|
|
302
|
+
| `adr_link` | `from_number`, `to_number` | Aggiunge un collegamento bidirezionale tra due ADR |
|
|
303
|
+
| `adr_history` | `query` | Restituisce gli ADR corrispondenti come timeline |
|
|
304
|
+
|
|
305
|
+
### Diagrammi
|
|
306
|
+
|
|
307
|
+
| Strumento | Parametri principali | Descrizione |
|
|
308
|
+
|----------------|-----------------------------------------|--------------------------------------------------|
|
|
309
|
+
| `adr_diagram` | `number`, `format`, `diagram_type` | Genera un diagramma per un singolo ADR |
|
|
310
|
+
| `adr_overview` | `format`, `status_filter` | Genera un diagramma panoramico di tutti gli ADR |
|
|
311
|
+
|
|
312
|
+
### Analisi
|
|
313
|
+
|
|
314
|
+
| Strumento | Parametri principali | Descrizione |
|
|
315
|
+
|--------------------|-----------------------|-----------------------------------------------------|
|
|
316
|
+
| `adr_impact` | `component` | Trova tutti gli ADR che menzionano un componente |
|
|
317
|
+
| `adr_dependencies` | `number`, `format` | Costruisce o filtra il grafo delle dipendenze ADR |
|
|
318
|
+
|
|
319
|
+
### Esportazione
|
|
320
|
+
|
|
321
|
+
| Strumento | Parametri principali | Descrizione |
|
|
322
|
+
|--------------|----------------------|-----------------------------------|
|
|
323
|
+
| `adr_export` | `output_dir` | Esporta tutti gli ADR in HTML |
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## Esempio di workflow
|
|
328
|
+
|
|
329
|
+
```python
|
|
330
|
+
# 1. Crea l'ADR
|
|
331
|
+
adr_create(
|
|
332
|
+
title="Migrazione da REST a GraphQL",
|
|
333
|
+
type="architecture",
|
|
334
|
+
context="Il team mobile segnala over-fetching su ogni schermata.",
|
|
335
|
+
decision="Adottare GraphQL via Apollo Server. Gli endpoint REST rimangono per i partner esterni.",
|
|
336
|
+
)
|
|
337
|
+
# → ADR-0001 creato con stato Proposed
|
|
338
|
+
|
|
339
|
+
# 2. Genera il diagramma
|
|
340
|
+
adr_diagram(number=1, format="mermaid")
|
|
341
|
+
# → Contesto Mermaid restituito all'LLM
|
|
342
|
+
|
|
343
|
+
# 3. Accetta la decisione
|
|
344
|
+
adr_update_status(number=1, status="Accepted")
|
|
345
|
+
# → Stato cambiato: Proposed → Accepted
|
|
346
|
+
|
|
347
|
+
# 4. Analizza l'impatto
|
|
348
|
+
adr_impact(component="REST")
|
|
349
|
+
# → Lista degli ADR che menzionano REST
|
|
350
|
+
|
|
351
|
+
# 5. Esporta in HTML
|
|
352
|
+
adr_export(output_dir="docs/adr/html")
|
|
353
|
+
# → File HTML generati
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## Sviluppo
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
git clone https://github.com/mauriziomocci/mcp-adr.git
|
|
362
|
+
cd mcp-adr
|
|
363
|
+
uv sync
|
|
364
|
+
uv run pytest -v
|
|
365
|
+
uv run ruff check src/mcp_adr/
|
|
366
|
+
```
|