@leonardocrdso/clean-code-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.
- package/LICENSE +21 -0
- package/README.md +115 -0
- package/build/index.js +21867 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 leonardocrdso
|
|
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,115 @@
|
|
|
1
|
+
# @leonardocrdso/clean-code-mcp
|
|
2
|
+
|
|
3
|
+
An MCP (Model Context Protocol) server that provides 63 Clean Code principles for AI-assisted code review and development. Search, browse, and review code against best practices from Robert C. Martin's Clean Code.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Using npx (recommended)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @leonardocrdso/clean-code-mcp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Adding to Claude Code
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
claude mcp add clean-code-mcp -- npx @leonardocrdso/clean-code-mcp
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Manual configuration
|
|
20
|
+
|
|
21
|
+
Add to your MCP client settings:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"clean-code-mcp": {
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": ["@leonardocrdso/clean-code-mcp"]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Tools
|
|
35
|
+
|
|
36
|
+
### `search-principle`
|
|
37
|
+
|
|
38
|
+
Search principles by name, keyword, or ID. Returns detailed results for top matches and a summary for additional matches.
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
query: "srp"
|
|
42
|
+
query: "naming"
|
|
43
|
+
query: "keep-functions-small"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### `search-by-context`
|
|
47
|
+
|
|
48
|
+
Find relevant principles for a given situation. Describe your problem in natural language.
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
context: "my function has too many parameters and is hard to test"
|
|
52
|
+
context: "I have deeply nested if statements"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### `list-principles`
|
|
56
|
+
|
|
57
|
+
List all principles or filter by category.
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
category: "solid"
|
|
61
|
+
category: "error-handling"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Resources
|
|
65
|
+
|
|
66
|
+
- **`cleancode://catalog`** — Full catalog of all 63 principles grouped by category
|
|
67
|
+
- **`cleancode://principle/{id}`** — Individual principle by ID
|
|
68
|
+
|
|
69
|
+
## Prompts
|
|
70
|
+
|
|
71
|
+
### `clean-code-review`
|
|
72
|
+
|
|
73
|
+
Generates a structured code review prompt with relevant Clean Code principles embedded as context.
|
|
74
|
+
|
|
75
|
+
Parameters:
|
|
76
|
+
- `code` (required) — The source code to review
|
|
77
|
+
- `language` (optional) — Programming language (e.g. `typescript`, `python`)
|
|
78
|
+
- `focus_categories` (optional) — Comma-separated categories to focus on
|
|
79
|
+
|
|
80
|
+
## Categories
|
|
81
|
+
|
|
82
|
+
13 categories covering 63 principles:
|
|
83
|
+
|
|
84
|
+
| Category | Description |
|
|
85
|
+
|---|---|
|
|
86
|
+
| `naming` | Meaningful Names |
|
|
87
|
+
| `functions` | Functions |
|
|
88
|
+
| `comments` | Comments |
|
|
89
|
+
| `formatting` | Formatting |
|
|
90
|
+
| `error-handling` | Error Handling |
|
|
91
|
+
| `unit-testing` | Unit Testing |
|
|
92
|
+
| `classes` | Classes |
|
|
93
|
+
| `solid` | SOLID Principles |
|
|
94
|
+
| `code-smells` | Code Smells |
|
|
95
|
+
| `objects-and-data-structures` | Objects and Data Structures |
|
|
96
|
+
| `concurrency` | Concurrency |
|
|
97
|
+
| `systems` | Systems |
|
|
98
|
+
| `emergence` | Emergence |
|
|
99
|
+
|
|
100
|
+
## Development
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Install dependencies
|
|
104
|
+
bun install
|
|
105
|
+
|
|
106
|
+
# Run in development mode
|
|
107
|
+
bun run dev
|
|
108
|
+
|
|
109
|
+
# Build
|
|
110
|
+
bun run build
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
MIT
|