@mkrlbs/mcp-adonisjs 1.0.2 → 1.1.1
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 +64 -98
- package/build/index.js +298 -130
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +406 -190
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# AdonisJS MCP Server
|
|
2
2
|
|
|
3
|
+
[](DOCUMENTATION.md)
|
|
4
|
+
|
|
3
5
|
A secure [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server
|
|
4
6
|
for executing AdonisJS Ace commands. This server allows AI assistants to
|
|
5
7
|
interact with AdonisJS projects through a controlled, secure interface.
|
|
@@ -8,7 +10,10 @@ interact with AdonisJS projects through a controlled, secure interface.
|
|
|
8
10
|
|
|
9
11
|
- 🔒 **Secure by default**: Blacklists dangerous commands and prevents shell
|
|
10
12
|
injection
|
|
11
|
-
- 🛠️ **
|
|
13
|
+
- 🛠️ **21 dedicated tools**: Pre-configured tools for all common AdonisJS
|
|
14
|
+
operations
|
|
15
|
+
- ⏱️ **Timeout protection**: 30s timeout prevents infinite hangs on interactive
|
|
16
|
+
prompts
|
|
12
17
|
- ✅ **Validation**: Strict argument validation using Zod schemas
|
|
13
18
|
- 📦 **TypeScript**: Fully typed with TypeScript for better DX
|
|
14
19
|
|
|
@@ -20,57 +25,60 @@ npm install @mkrlbs/mcp-adonisjs
|
|
|
20
25
|
|
|
21
26
|
## Available Tools
|
|
22
27
|
|
|
23
|
-
###
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
### Scaffolding
|
|
29
|
+
|
|
30
|
+
| Tool | Command | Extra args |
|
|
31
|
+
| :---------------- | :------------------------- | :-------------------------------- |
|
|
32
|
+
| `make_controller` | `node ace make:controller` | `resource` (boolean) |
|
|
33
|
+
| `make_service` | `node ace make:service` | — |
|
|
34
|
+
| `make_migration` | `node ace make:migration` | `withModel` (boolean, `-m` flag) |
|
|
35
|
+
| `make_model` | `node ace make:model` | — |
|
|
36
|
+
| `make_validator` | `node ace make:validator` | — |
|
|
37
|
+
| `make_seeder` | `node ace make:seeder` | — |
|
|
38
|
+
| `make_exception` | `node ace make:exception` | — |
|
|
39
|
+
| `make_middleware` | `node ace make:middleware` | — |
|
|
40
|
+
| `make_test` | `node ace make:test` | `suite` (unit/functional/browser) |
|
|
41
|
+
| `make_factory` | `node ace make:factory` | — |
|
|
42
|
+
| `make_policy` | `node ace make:policy` | — |
|
|
43
|
+
| `make_event` | `node ace make:event` | — |
|
|
44
|
+
| `make_listener` | `node ace make:listener` | — |
|
|
45
|
+
| `make_mailer` | `node ace make:mailer` | — |
|
|
46
|
+
| `make_command` | `node ace make:command` | — |
|
|
47
|
+
|
|
48
|
+
### Database & Routing
|
|
49
|
+
|
|
50
|
+
| Tool | Command | Extra args |
|
|
51
|
+
| :------------------- | :---------------------------- | :---------------- |
|
|
52
|
+
| `migration_run` | `node ace migration:run` | `force` (boolean) |
|
|
53
|
+
| `migration_rollback` | `node ace migration:rollback` | `batch` (number) |
|
|
54
|
+
| `migration_status` | `node ace migration:status` | — |
|
|
55
|
+
| `db_seed` | `node ace db:seed` | `files` (string) |
|
|
56
|
+
| `list_routes` | `node ace list:routes` | — |
|
|
57
|
+
|
|
58
|
+
### Catch-all
|
|
59
|
+
|
|
60
|
+
| Tool | Command | Extra args |
|
|
61
|
+
| :---------------- | :-------------- | :------------------------------------ |
|
|
62
|
+
| `run_ace_command` | Any Ace command | `command` (string), `args` (string[]) |
|
|
63
|
+
|
|
64
|
+
All scaffolding tools accept a `name` (string, required) argument.
|
|
65
|
+
|
|
66
|
+
### Examples
|
|
34
67
|
|
|
35
68
|
```json
|
|
36
|
-
{
|
|
37
|
-
"name": "UserController",
|
|
38
|
-
"resource": true
|
|
39
|
-
}
|
|
69
|
+
{ "name": "UserController", "resource": true }
|
|
40
70
|
```
|
|
41
71
|
|
|
42
|
-
### 2. `make_service`
|
|
43
|
-
|
|
44
|
-
Creates an AdonisJS service using `node ace make:service`.
|
|
45
|
-
|
|
46
|
-
**Arguments:**
|
|
47
|
-
|
|
48
|
-
- `name` (string, required): Name of the service to create
|
|
49
|
-
|
|
50
|
-
**Example:**
|
|
51
|
-
|
|
52
72
|
```json
|
|
53
|
-
{
|
|
54
|
-
"name": "AuthService"
|
|
55
|
-
}
|
|
73
|
+
{ "name": "create_projects_table", "withModel": true }
|
|
56
74
|
```
|
|
57
75
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
**Arguments:**
|
|
63
|
-
|
|
64
|
-
- `command` (string, required): The Ace command to run (e.g., 'make:model')
|
|
65
|
-
- `args` (array of strings, optional): Arguments to pass to the command
|
|
66
|
-
|
|
67
|
-
**Example:**
|
|
76
|
+
```json
|
|
77
|
+
{ "name": "users/list", "suite": "functional" }
|
|
78
|
+
```
|
|
68
79
|
|
|
69
80
|
```json
|
|
70
|
-
{
|
|
71
|
-
"command": "make:model",
|
|
72
|
-
"args": ["User", "--migration"]
|
|
73
|
-
}
|
|
81
|
+
{ "command": "make:provider", "args": ["AppProvider"] }
|
|
74
82
|
```
|
|
75
83
|
|
|
76
84
|
## Security
|
|
@@ -79,10 +87,7 @@ Executes any AdonisJS Ace command with security checks.
|
|
|
79
87
|
|
|
80
88
|
The following commands are blacklisted for security reasons:
|
|
81
89
|
|
|
82
|
-
- `db:wipe`
|
|
83
90
|
- `migration:fresh`
|
|
84
|
-
- `migration:refresh`
|
|
85
|
-
- `migration:reset`
|
|
86
91
|
|
|
87
92
|
Attempting to run these commands will result in an error.
|
|
88
93
|
|
|
@@ -96,63 +101,18 @@ following characters are not allowed:
|
|
|
96
101
|
- `|` (pipe)
|
|
97
102
|
- `` ` `` (backtick)
|
|
98
103
|
- `$` (dollar sign)
|
|
99
|
-
- `()` (parentheses)
|
|
100
|
-
- `{}` (curly braces)
|
|
101
|
-
- `[]` (square brackets)
|
|
102
104
|
- `<>` (angle brackets)
|
|
103
105
|
- `\` (backslash)
|
|
104
106
|
|
|
105
|
-
|
|
107
|
+
### Timeout
|
|
106
108
|
|
|
107
|
-
|
|
109
|
+
All commands have a 30 second timeout to prevent infinite hangs on interactive
|
|
110
|
+
prompts.
|
|
108
111
|
|
|
109
|
-
|
|
112
|
+
## Documentation
|
|
110
113
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"servers": {
|
|
114
|
-
"adonisjs": {
|
|
115
|
-
"command": "npx",
|
|
116
|
-
"args": ["-y", "@mkrlbs/mcp-adonisjs"]
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### VS Code
|
|
123
|
-
|
|
124
|
-
1. Create a `.vscode/mcp.json` file in your project root.
|
|
125
|
-
2. Add the configuration below:
|
|
126
|
-
|
|
127
|
-
```json
|
|
128
|
-
{
|
|
129
|
-
"servers": {
|
|
130
|
-
"adonisjs": {
|
|
131
|
-
"command": "npx",
|
|
132
|
-
"args": ["-y", "@mkrlbs/mcp-adonisjs"]
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
**Local Development:**
|
|
139
|
-
|
|
140
|
-
If you are developing this package and want to test it locally within your VS
|
|
141
|
-
Code workspace:
|
|
142
|
-
|
|
143
|
-
```json
|
|
144
|
-
{
|
|
145
|
-
"servers": {
|
|
146
|
-
"adonisjs-local": {
|
|
147
|
-
"command": "node",
|
|
148
|
-
"args": ["${workspaceFolder}/build/index.js"],
|
|
149
|
-
"env": {
|
|
150
|
-
"cwd": "${workspaceFolder}"
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
```
|
|
114
|
+
For configuration instructions (Claude Desktop, VS Code, Google Antigravity,
|
|
115
|
+
OpenAI Codex), see the [documentation](DOCUMENTATION.md).
|
|
156
116
|
|
|
157
117
|
### Other MCP Clients
|
|
158
118
|
|
|
@@ -171,6 +131,12 @@ npx @mkrlbs/mcp-adonisjs
|
|
|
171
131
|
npm run build
|
|
172
132
|
```
|
|
173
133
|
|
|
134
|
+
### Testing
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
npm run test
|
|
138
|
+
```
|
|
139
|
+
|
|
174
140
|
### Watch Mode
|
|
175
141
|
|
|
176
142
|
```bash
|
|
@@ -179,7 +145,7 @@ npm run watch
|
|
|
179
145
|
|
|
180
146
|
## Requirements
|
|
181
147
|
|
|
182
|
-
- Node.js
|
|
148
|
+
- Node.js 24+
|
|
183
149
|
- An AdonisJS project in the current working directory
|
|
184
150
|
|
|
185
151
|
## License
|