@rigour-labs/mcp 1.6.0 → 2.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/dist/index.d.ts +1 -0
- package/dist/index.js +129 -6
- package/package.json +5 -2
- package/src/index.ts +135 -6
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
"use strict";
|
|
2
3
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -30,8 +31,36 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
|
|
|
30
31
|
return {
|
|
31
32
|
tools: [
|
|
32
33
|
{
|
|
33
|
-
name: "
|
|
34
|
-
description: "
|
|
34
|
+
name: "rigour_check",
|
|
35
|
+
description: "Run quality gate checks on the project. Matches the CLI 'check' command.",
|
|
36
|
+
inputSchema: {
|
|
37
|
+
type: "object",
|
|
38
|
+
properties: {
|
|
39
|
+
cwd: {
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "Absolute path to the project root.",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
required: ["cwd"],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "rigour_explain",
|
|
49
|
+
description: "Explain the last quality gate failures with actionable bullets. Matches the CLI 'explain' command.",
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: {
|
|
53
|
+
cwd: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "Absolute path to the project root.",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
required: ["cwd"],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "rigour_status",
|
|
63
|
+
description: "Quick PASS/FAIL check with JSON-friendly output for polling current project state.",
|
|
35
64
|
inputSchema: {
|
|
36
65
|
type: "object",
|
|
37
66
|
properties: {
|
|
@@ -45,7 +74,35 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
|
|
|
45
74
|
},
|
|
46
75
|
{
|
|
47
76
|
name: "rigour_get_fix_packet",
|
|
48
|
-
description: "Retrieves a prioritized 'Fix Packet'
|
|
77
|
+
description: "Retrieves a prioritized 'Fix Packet' (v2 schema) containing detailed machine-readable diagnostic data.",
|
|
78
|
+
inputSchema: {
|
|
79
|
+
type: "object",
|
|
80
|
+
properties: {
|
|
81
|
+
cwd: {
|
|
82
|
+
type: "string",
|
|
83
|
+
description: "Absolute path to the project root.",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
required: ["cwd"],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "rigour_list_gates",
|
|
91
|
+
description: "Lists all configured quality gates and their thresholds for the current project.",
|
|
92
|
+
inputSchema: {
|
|
93
|
+
type: "object",
|
|
94
|
+
properties: {
|
|
95
|
+
cwd: {
|
|
96
|
+
type: "string",
|
|
97
|
+
description: "Absolute path to the project root.",
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
required: ["cwd"],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "rigour_get_config",
|
|
105
|
+
description: "Returns the current Rigour configuration (rigour.yml) for agent reasoning.",
|
|
49
106
|
inputSchema: {
|
|
50
107
|
type: "object",
|
|
51
108
|
properties: {
|
|
@@ -66,9 +123,9 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
|
66
123
|
try {
|
|
67
124
|
const config = await loadConfig(cwd);
|
|
68
125
|
const runner = new core_1.GateRunner(config);
|
|
69
|
-
const report = await runner.run(cwd);
|
|
70
126
|
switch (name) {
|
|
71
|
-
case "
|
|
127
|
+
case "rigour_check": {
|
|
128
|
+
const report = await runner.run(cwd);
|
|
72
129
|
return {
|
|
73
130
|
content: [
|
|
74
131
|
{
|
|
@@ -77,7 +134,49 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
|
77
134
|
},
|
|
78
135
|
],
|
|
79
136
|
};
|
|
80
|
-
|
|
137
|
+
}
|
|
138
|
+
case "rigour_explain": {
|
|
139
|
+
const report = await runner.run(cwd);
|
|
140
|
+
if (report.status === "PASS") {
|
|
141
|
+
return {
|
|
142
|
+
content: [
|
|
143
|
+
{
|
|
144
|
+
type: "text",
|
|
145
|
+
text: "ALL QUALITY GATES PASSED. No failures to explain.",
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
const bullets = report.failures.map((f, i) => {
|
|
151
|
+
return `${i + 1}. [${f.id.toUpperCase()}] ${f.title}: ${f.details}${f.hint ? ` (Hint: ${f.hint})` : ''}`;
|
|
152
|
+
}).join("\n");
|
|
153
|
+
return {
|
|
154
|
+
content: [
|
|
155
|
+
{
|
|
156
|
+
type: "text",
|
|
157
|
+
text: `RIGOUR EXPLAIN:\n\n${bullets}`,
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
case "rigour_status": {
|
|
163
|
+
const report = await runner.run(cwd);
|
|
164
|
+
return {
|
|
165
|
+
content: [
|
|
166
|
+
{
|
|
167
|
+
type: "text",
|
|
168
|
+
text: JSON.stringify({
|
|
169
|
+
status: report.status,
|
|
170
|
+
summary: report.summary,
|
|
171
|
+
failureCount: report.failures.length,
|
|
172
|
+
durationMs: report.stats.duration_ms
|
|
173
|
+
}, null, 2),
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
case "rigour_get_fix_packet": {
|
|
179
|
+
const report = await runner.run(cwd);
|
|
81
180
|
if (report.status === "PASS") {
|
|
82
181
|
return {
|
|
83
182
|
content: [
|
|
@@ -107,6 +206,30 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
|
107
206
|
},
|
|
108
207
|
],
|
|
109
208
|
};
|
|
209
|
+
}
|
|
210
|
+
case "rigour_list_gates":
|
|
211
|
+
return {
|
|
212
|
+
content: [
|
|
213
|
+
{
|
|
214
|
+
type: "text",
|
|
215
|
+
text: `ACTIVE QUALITY GATES:\n\n${Object.entries(config.gates).map(([k, v]) => {
|
|
216
|
+
if (typeof v === 'object' && v !== null) {
|
|
217
|
+
return `- ${k}: ${JSON.stringify(v)}`;
|
|
218
|
+
}
|
|
219
|
+
return `- ${k}: ${v}`;
|
|
220
|
+
}).join("\n")}`,
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
};
|
|
224
|
+
case "rigour_get_config":
|
|
225
|
+
return {
|
|
226
|
+
content: [
|
|
227
|
+
{
|
|
228
|
+
type: "text",
|
|
229
|
+
text: JSON.stringify(config, null, 2),
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
};
|
|
110
233
|
default:
|
|
111
234
|
throw new Error(`Unknown tool: ${name}`);
|
|
112
235
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rigour-labs/mcp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"bin": {
|
|
5
|
+
"rigour-mcp": "dist/index.js"
|
|
6
|
+
},
|
|
4
7
|
"repository": {
|
|
5
8
|
"type": "git",
|
|
6
9
|
"url": "https://github.com/rigour-labs/rigour"
|
|
@@ -13,7 +16,7 @@
|
|
|
13
16
|
"@modelcontextprotocol/sdk": "^0.6.0",
|
|
14
17
|
"fs-extra": "^11.2.0",
|
|
15
18
|
"yaml": "^2.8.2",
|
|
16
|
-
"@rigour-labs/core": "
|
|
19
|
+
"@rigour-labs/core": "2.0.0"
|
|
17
20
|
},
|
|
18
21
|
"devDependencies": {
|
|
19
22
|
"@types/node": "^25.0.3"
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
4
|
import {
|
|
@@ -34,8 +35,36 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
34
35
|
return {
|
|
35
36
|
tools: [
|
|
36
37
|
{
|
|
37
|
-
name: "
|
|
38
|
-
description: "
|
|
38
|
+
name: "rigour_check",
|
|
39
|
+
description: "Run quality gate checks on the project. Matches the CLI 'check' command.",
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: "object",
|
|
42
|
+
properties: {
|
|
43
|
+
cwd: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "Absolute path to the project root.",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
required: ["cwd"],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "rigour_explain",
|
|
53
|
+
description: "Explain the last quality gate failures with actionable bullets. Matches the CLI 'explain' command.",
|
|
54
|
+
inputSchema: {
|
|
55
|
+
type: "object",
|
|
56
|
+
properties: {
|
|
57
|
+
cwd: {
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "Absolute path to the project root.",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
required: ["cwd"],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "rigour_status",
|
|
67
|
+
description: "Quick PASS/FAIL check with JSON-friendly output for polling current project state.",
|
|
39
68
|
inputSchema: {
|
|
40
69
|
type: "object",
|
|
41
70
|
properties: {
|
|
@@ -49,7 +78,35 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
49
78
|
},
|
|
50
79
|
{
|
|
51
80
|
name: "rigour_get_fix_packet",
|
|
52
|
-
description: "Retrieves a prioritized 'Fix Packet'
|
|
81
|
+
description: "Retrieves a prioritized 'Fix Packet' (v2 schema) containing detailed machine-readable diagnostic data.",
|
|
82
|
+
inputSchema: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: {
|
|
85
|
+
cwd: {
|
|
86
|
+
type: "string",
|
|
87
|
+
description: "Absolute path to the project root.",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
required: ["cwd"],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "rigour_list_gates",
|
|
95
|
+
description: "Lists all configured quality gates and their thresholds for the current project.",
|
|
96
|
+
inputSchema: {
|
|
97
|
+
type: "object",
|
|
98
|
+
properties: {
|
|
99
|
+
cwd: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "Absolute path to the project root.",
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
required: ["cwd"],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "rigour_get_config",
|
|
109
|
+
description: "Returns the current Rigour configuration (rigour.yml) for agent reasoning.",
|
|
53
110
|
inputSchema: {
|
|
54
111
|
type: "object",
|
|
55
112
|
properties: {
|
|
@@ -72,10 +129,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
72
129
|
try {
|
|
73
130
|
const config = await loadConfig(cwd);
|
|
74
131
|
const runner = new GateRunner(config);
|
|
75
|
-
const report = await runner.run(cwd);
|
|
76
132
|
|
|
77
133
|
switch (name) {
|
|
78
|
-
case "
|
|
134
|
+
case "rigour_check": {
|
|
135
|
+
const report = await runner.run(cwd);
|
|
79
136
|
return {
|
|
80
137
|
content: [
|
|
81
138
|
{
|
|
@@ -84,8 +141,54 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
84
141
|
},
|
|
85
142
|
],
|
|
86
143
|
};
|
|
144
|
+
}
|
|
87
145
|
|
|
88
|
-
case "
|
|
146
|
+
case "rigour_explain": {
|
|
147
|
+
const report = await runner.run(cwd);
|
|
148
|
+
if (report.status === "PASS") {
|
|
149
|
+
return {
|
|
150
|
+
content: [
|
|
151
|
+
{
|
|
152
|
+
type: "text",
|
|
153
|
+
text: "ALL QUALITY GATES PASSED. No failures to explain.",
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const bullets = report.failures.map((f, i) => {
|
|
160
|
+
return `${i + 1}. [${f.id.toUpperCase()}] ${f.title}: ${f.details}${f.hint ? ` (Hint: ${f.hint})` : ''}`;
|
|
161
|
+
}).join("\n");
|
|
162
|
+
|
|
163
|
+
return {
|
|
164
|
+
content: [
|
|
165
|
+
{
|
|
166
|
+
type: "text",
|
|
167
|
+
text: `RIGOUR EXPLAIN:\n\n${bullets}`,
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
case "rigour_status": {
|
|
174
|
+
const report = await runner.run(cwd);
|
|
175
|
+
return {
|
|
176
|
+
content: [
|
|
177
|
+
{
|
|
178
|
+
type: "text",
|
|
179
|
+
text: JSON.stringify({
|
|
180
|
+
status: report.status,
|
|
181
|
+
summary: report.summary,
|
|
182
|
+
failureCount: report.failures.length,
|
|
183
|
+
durationMs: report.stats.duration_ms
|
|
184
|
+
}, null, 2),
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
case "rigour_get_fix_packet": {
|
|
191
|
+
const report = await runner.run(cwd);
|
|
89
192
|
if (report.status === "PASS") {
|
|
90
193
|
return {
|
|
91
194
|
content: [
|
|
@@ -117,6 +220,32 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
117
220
|
},
|
|
118
221
|
],
|
|
119
222
|
};
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
case "rigour_list_gates":
|
|
226
|
+
return {
|
|
227
|
+
content: [
|
|
228
|
+
{
|
|
229
|
+
type: "text",
|
|
230
|
+
text: `ACTIVE QUALITY GATES:\n\n${Object.entries(config.gates).map(([k, v]) => {
|
|
231
|
+
if (typeof v === 'object' && v !== null) {
|
|
232
|
+
return `- ${k}: ${JSON.stringify(v)}`;
|
|
233
|
+
}
|
|
234
|
+
return `- ${k}: ${v}`;
|
|
235
|
+
}).join("\n")}`,
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
case "rigour_get_config":
|
|
241
|
+
return {
|
|
242
|
+
content: [
|
|
243
|
+
{
|
|
244
|
+
type: "text",
|
|
245
|
+
text: JSON.stringify(config, null, 2),
|
|
246
|
+
},
|
|
247
|
+
],
|
|
248
|
+
};
|
|
120
249
|
|
|
121
250
|
default:
|
|
122
251
|
throw new Error(`Unknown tool: ${name}`);
|