@leonardocrdso/modular-monolith-mcp 1.0.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.
Files changed (3) hide show
  1. package/README.md +163 -0
  2. package/build/index.js +23425 -0
  3. package/package.json +32 -0
package/README.md ADDED
@@ -0,0 +1,163 @@
1
+ # @leonardocrdso/modular-monolith-mcp
2
+
3
+ An MCP (Model Context Protocol) server that provides 35 architecture rules, 16 anti-patterns, 3 decision trees, and 8 code templates for building Modular Monolith applications. Search, validate, and scaffold modules following best practices.
4
+
5
+ ## Installation
6
+
7
+ ### Using npx (recommended)
8
+
9
+ ```bash
10
+ npx @leonardocrdso/modular-monolith-mcp
11
+ ```
12
+
13
+ ### Adding to Claude Code
14
+
15
+ ```bash
16
+ claude mcp add modular-monolith-mcp -- npx @leonardocrdso/modular-monolith-mcp
17
+ ```
18
+
19
+ ### Manual configuration
20
+
21
+ Add to your MCP client settings:
22
+
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "modular-monolith-mcp": {
27
+ "command": "npx",
28
+ "args": ["@leonardocrdso/modular-monolith-mcp"]
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ ## Tools
35
+
36
+ ### `search-rule`
37
+
38
+ Search architecture rules by name, keyword, or ID. Also searches anti-patterns.
39
+
40
+ ```
41
+ query: "thin-routes"
42
+ query: "boundary"
43
+ query: "data-isolation"
44
+ ```
45
+
46
+ ### `search-by-context`
47
+
48
+ Find relevant rules for a given situation. Describe your problem in natural language.
49
+
50
+ ```
51
+ context: "my modules are importing internal files from each other"
52
+ context: "I need to decide between sync and async communication"
53
+ ```
54
+
55
+ ### `list-rules`
56
+
57
+ List all rules or filter by category.
58
+
59
+ ```
60
+ category: "module-boundaries"
61
+ category: "module-communication"
62
+ ```
63
+
64
+ ### `validate-module`
65
+
66
+ Validate a module directory structure against Modular Monolith conventions. Checks for required files (service, types, index.ts) and recommended files (repository, validation, routes).
67
+
68
+ ```
69
+ path: "/project/src/modules/orders"
70
+ ```
71
+
72
+ ### `check-imports`
73
+
74
+ Analyze imports across modules to detect boundary violations. Finds direct imports that bypass public APIs (index.ts).
75
+
76
+ ```
77
+ path: "/project/src/modules"
78
+ ```
79
+
80
+ ### `get-template`
81
+
82
+ Generate code templates for scaffolding module files. Returns ready-to-use TypeScript with architecture rule references.
83
+
84
+ ```
85
+ template: "service" moduleName: "orders"
86
+ template: "module-scaffold" moduleName: "user-management"
87
+ template: "repository" moduleName: "payments"
88
+ ```
89
+
90
+ Available templates: `module-scaffold`, `service`, `repository`, `types`, `validation`, `public-api`, `route-handler`, `integration-client`
91
+
92
+ ## Resources
93
+
94
+ - **`modular://catalog`** — Full catalog of all 35 rules grouped by category
95
+ - **`modular://rule/{id}`** — Individual architecture rule by ID
96
+ - **`modular://anti-pattern/{id}`** — Individual anti-pattern by ID
97
+ - **`modular://decision-tree/{id}`** — Architectural decision tree by ID
98
+
99
+ ## Prompts
100
+
101
+ ### `architecture-review`
102
+
103
+ Generates a structured architecture review prompt with relevant Modular Monolith rules embedded as context.
104
+
105
+ Parameters:
106
+ - `code` (required) — The source code to review
107
+ - `language` (optional) — Programming language (e.g. `typescript`, `python`)
108
+ - `focus_categories` (optional) — Comma-separated categories to focus on
109
+
110
+ ### `module-design`
111
+
112
+ Generates a prompt to help design a new module with proper structure, boundaries, and communication patterns.
113
+
114
+ Parameters:
115
+ - `module_name` (required) — Name of the module to design
116
+ - `description` (required) — Brief description of what this module does
117
+ - `responsibilities` (required) — Comma-separated list of responsibilities
118
+
119
+ ## Categories
120
+
121
+ 10 categories covering 35 rules and 16 anti-patterns:
122
+
123
+ | Category | Description |
124
+ |---|---|
125
+ | `module-structure` | Module Structure |
126
+ | `module-boundaries` | Module Boundaries |
127
+ | `module-communication` | Module Communication |
128
+ | `data-isolation` | Data Isolation |
129
+ | `dependency-management` | Dependency Management |
130
+ | `routes-and-controllers` | Routes & Controllers |
131
+ | `shared-kernel` | Shared Kernel |
132
+ | `testing-strategy` | Testing Strategy |
133
+ | `external-integrations` | External Integrations |
134
+ | `migration` | Migration & Evolution |
135
+
136
+ ## Decision Trees
137
+
138
+ 3 interactive decision trees for common architectural choices:
139
+
140
+ - **`create-vs-expand-module`** — Create a new module vs expand an existing one
141
+ - **`sync-vs-async-communication`** — Sync service calls vs async events
142
+ - **`when-to-extract-microservice`** — When to extract a module into a microservice
143
+
144
+ ## Ecosystem
145
+
146
+ Use together with [@leonardocrdso/clean-code-mcp](https://www.npmjs.com/package/@leonardocrdso/clean-code-mcp) for complete code quality coverage — architecture rules (this server) + Clean Code principles (clean-code-mcp).
147
+
148
+ ## Development
149
+
150
+ ```bash
151
+ # Install dependencies
152
+ bun install
153
+
154
+ # Run in development mode
155
+ bun run dev
156
+
157
+ # Build
158
+ bun run build
159
+ ```
160
+
161
+ ## License
162
+
163
+ MIT