@rigour-labs/mcp 5.1.0 → 5.1.2
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.js
CHANGED
|
@@ -29,8 +29,21 @@ import { handleMcpGetSettings, handleMcpSetSettings } from './tools/mcp-settings
|
|
|
29
29
|
// ─── Server Setup ─────────────────────────────────────────────────
|
|
30
30
|
const server = new Server({ name: "rigour-mcp", version: "3.0.1" }, { capabilities: { tools: {}, prompts: {} } });
|
|
31
31
|
// ─── Tool Listing ─────────────────────────────────────────────────
|
|
32
|
+
// Only expose essential tools by default to improve agent tool selection.
|
|
33
|
+
// Research shows agents degrade at 30+ tools (wrong picks, hallucinated args).
|
|
34
|
+
// Power-user tools are still callable — they just aren't advertised in the tool list.
|
|
35
|
+
const ESSENTIAL_TOOLS = new Set([
|
|
36
|
+
'rigour_check', // Run quality gates (BEFORE declaring done)
|
|
37
|
+
'rigour_check_pattern', // Check if code exists (BEFORE creating new code)
|
|
38
|
+
'rigour_recall', // Load project memory (START of every task)
|
|
39
|
+
'rigour_remember', // Store conventions/decisions
|
|
40
|
+
'rigour_explain', // Explain gate failures
|
|
41
|
+
'rigour_review', // Review diffs
|
|
42
|
+
'rigour_security_audit', // CVE check
|
|
43
|
+
'rigour_forget', // Remove stored memory
|
|
44
|
+
]);
|
|
32
45
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
33
|
-
tools: TOOL_DEFINITIONS,
|
|
46
|
+
tools: TOOL_DEFINITIONS.filter(t => ESSENTIAL_TOOLS.has(t.name)),
|
|
34
47
|
}));
|
|
35
48
|
// ─── Tool Dispatch ────────────────────────────────────────────────
|
|
36
49
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
@@ -81,7 +94,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
81
94
|
break;
|
|
82
95
|
// Memory
|
|
83
96
|
case "rigour_remember":
|
|
84
|
-
result = await handleRemember(cwd, args.key, args.value);
|
|
97
|
+
result = await handleRemember(cwd, args.key, args.value || args.content);
|
|
85
98
|
break;
|
|
86
99
|
case "rigour_recall":
|
|
87
100
|
result = await handleRecall(cwd, args.key);
|
|
@@ -10,7 +10,7 @@ describe('handleCheckDeep privacy routing', () => {
|
|
|
10
10
|
score: 100,
|
|
11
11
|
ai_health_score: 100,
|
|
12
12
|
structural_score: 100,
|
|
13
|
-
deep: { enabled: true, tier: 'lite', model: '
|
|
13
|
+
deep: { enabled: true, tier: 'lite', model: 'Qwen2.5-Coder-0.5B', total_ms: 1000 },
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
16
|
it('reports local execution by default', async () => {
|
|
@@ -27,14 +27,14 @@ export const TOOL_DEFINITIONS = [
|
|
|
27
27
|
// ─── Core Quality Gates ───────────────────────────────
|
|
28
28
|
{
|
|
29
29
|
name: "rigour_check",
|
|
30
|
-
description: "Run quality gate checks on the project.
|
|
30
|
+
description: "Run quality gate checks on the project. MUST be called before declaring any coding task complete. Checks code complexity, file size, required docs, security patterns, and more. Returns PASS or FAIL with details.",
|
|
31
31
|
inputSchema: {
|
|
32
32
|
type: "object",
|
|
33
33
|
properties: {
|
|
34
34
|
...cwdParam(),
|
|
35
35
|
files: { type: "array", items: { type: "string" }, description: "Optional file paths (relative to cwd) to limit scan scope for both deterministic and deep checks." },
|
|
36
36
|
deep: { type: "string", enum: ["off", "quick", "full"], description: "Deep mode: 'off' (default), 'quick' (deep enabled with lite model), 'full' (deep enabled, combine with pro=true for full deep model)." },
|
|
37
|
-
pro: { type: "boolean", description: "Use full deep model (Qwen2.5-Coder-1.5B) instead of lite (
|
|
37
|
+
pro: { type: "boolean", description: "Use full deep model (Qwen2.5-Coder-1.5B) instead of lite (Qwen2.5-Coder-0.5B) when deep is enabled." },
|
|
38
38
|
apiKey: { type: "string", description: "Optional cloud API key for deep analysis." },
|
|
39
39
|
provider: { type: "string", description: "Cloud provider for deep analysis (claude, openai, gemini, groq, mistral, together, deepseek, ollama, etc.)." },
|
|
40
40
|
apiBaseUrl: { type: "string", description: "Custom API base URL for self-hosted/proxy deep endpoints." },
|
|
@@ -172,13 +172,13 @@ export const TOOL_DEFINITIONS = [
|
|
|
172
172
|
// ─── Memory Persistence ───────────────────────────────
|
|
173
173
|
{
|
|
174
174
|
name: "rigour_remember",
|
|
175
|
-
description: "Store a persistent instruction or context that the AI should remember across sessions. Use this to persist user preferences, project conventions, or critical instructions.",
|
|
175
|
+
description: "Store a persistent instruction or context that the AI should remember across sessions. Use this to persist user preferences, project conventions, or critical instructions. IMPORTANT: You must provide both 'key' (a short snake_case identifier) and 'value' (the full text to remember).",
|
|
176
176
|
inputSchema: {
|
|
177
177
|
type: "object",
|
|
178
178
|
properties: {
|
|
179
179
|
...cwdParam(),
|
|
180
|
-
key: { type: "string", description: "A
|
|
181
|
-
value: { type: "string", description: "The instruction or
|
|
180
|
+
key: { type: "string", description: "A short snake_case identifier for this memory, e.g. 'api_response_format', 'naming_convention', 'testing_strategy'. This is used to retrieve the memory later." },
|
|
181
|
+
value: { type: "string", description: "The full instruction or convention text to persist. This is the content that will be recalled in future sessions." },
|
|
182
182
|
},
|
|
183
183
|
required: ["cwd", "key", "value"],
|
|
184
184
|
},
|
|
@@ -192,7 +192,7 @@ export const TOOL_DEFINITIONS = [
|
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
194
|
name: "rigour_recall",
|
|
195
|
-
description: "
|
|
195
|
+
description: "Load project memory and stored conventions. CALL THIS at the start of every coding task to restore team decisions, naming conventions, and architectural preferences stored from previous sessions.",
|
|
196
196
|
inputSchema: {
|
|
197
197
|
type: "object",
|
|
198
198
|
properties: {
|
|
@@ -231,7 +231,7 @@ export const TOOL_DEFINITIONS = [
|
|
|
231
231
|
// ─── Pattern Intelligence ─────────────────────────────
|
|
232
232
|
{
|
|
233
233
|
name: "rigour_check_pattern",
|
|
234
|
-
description: "
|
|
234
|
+
description: "CALL THIS BEFORE creating any new function, component, hook, or class. Checks if it already exists in the codebase (prevents duplication), and checks for known security vulnerabilities. Pass the name and type of what you plan to create.",
|
|
235
235
|
inputSchema: {
|
|
236
236
|
type: "object",
|
|
237
237
|
properties: {
|
|
@@ -461,12 +461,12 @@ export const TOOL_DEFINITIONS = [
|
|
|
461
461
|
// ─── Deep Analysis (v4.0+) ──────────────────────────────
|
|
462
462
|
{
|
|
463
463
|
name: "rigour_check_deep",
|
|
464
|
-
description: "Run quality gates WITH deep LLM-powered analysis. Three-step pipeline: AST extracts facts → LLM interprets → AST verifies. Local-first by default (
|
|
464
|
+
description: "Run quality gates WITH deep LLM-powered analysis. Three-step pipeline: AST extracts facts → LLM interprets → AST verifies. Local-first by default (Qwen2.5-Coder-0.5B lite sidecar), or bring your own API key for any cloud provider.",
|
|
465
465
|
inputSchema: {
|
|
466
466
|
type: "object",
|
|
467
467
|
properties: {
|
|
468
468
|
...cwdParam(),
|
|
469
|
-
pro: { type: "boolean", description: "Use full deep model (Qwen2.5-Coder-1.5B) instead of default lite model (
|
|
469
|
+
pro: { type: "boolean", description: "Use full deep model (Qwen2.5-Coder-1.5B) instead of default lite model (Qwen2.5-Coder-0.5B)." },
|
|
470
470
|
apiKey: { type: "string", description: "API key for cloud LLM provider. If provided, uses cloud instead of local sidecar." },
|
|
471
471
|
provider: { type: "string", description: "Cloud provider name (e.g., 'claude', 'openai', 'gemini', 'groq', 'mistral', 'together', 'fireworks', 'deepseek', 'perplexity', 'ollama', 'lmstudio'). Default: 'claude' when apiKey is provided." },
|
|
472
472
|
apiBaseUrl: { type: "string", description: "Custom API base URL for self-hosted or proxy endpoints." },
|
|
@@ -50,6 +50,19 @@ function extractStrings(obj, out) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
export async function handleRemember(cwd, key, value) {
|
|
53
|
+
// Fallback: if key is missing but value exists, auto-generate a key
|
|
54
|
+
if (!key && value) {
|
|
55
|
+
key = value.slice(0, 40).toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/^_|_$/g, '') || 'convention';
|
|
56
|
+
}
|
|
57
|
+
// If value is missing but key exists, something is wrong
|
|
58
|
+
if (!value) {
|
|
59
|
+
return {
|
|
60
|
+
content: [{
|
|
61
|
+
type: "text",
|
|
62
|
+
text: `ERROR: Missing 'value' parameter. Call rigour_remember with both 'key' (short identifier) and 'value' (the instruction text to persist).`,
|
|
63
|
+
}],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
53
66
|
// ── DLP Gate: deep-scan key + value (including JSON interiors) ──
|
|
54
67
|
const textToScan = deepScanValue(key, value);
|
|
55
68
|
const dlpResult = scanInputForCredentials(textToScan);
|
|
@@ -23,7 +23,7 @@ describe('handleCheck deep routing', () => {
|
|
|
23
23
|
...baseReport,
|
|
24
24
|
stats: {
|
|
25
25
|
...baseReport.stats,
|
|
26
|
-
deep: { enabled: true, tier: 'lite', model: '
|
|
26
|
+
deep: { enabled: true, tier: 'lite', model: 'Qwen2.5-Coder-0.5B' },
|
|
27
27
|
},
|
|
28
28
|
});
|
|
29
29
|
const runner = { run };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rigour-labs/mcp",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.2",
|
|
4
4
|
"description": "MCP server for AI code governance — OWASP LLM Top 10 (10/10), real-time hooks, 25+ security patterns, hallucinated import detection, multi-agent governance. Works with Claude, Cursor, Cline, Windsurf, Gemini. Industry presets for HIPAA, SOC2, FedRAMP.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://rigour.run",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"execa": "^8.0.1",
|
|
49
49
|
"fs-extra": "^11.2.0",
|
|
50
50
|
"yaml": "^2.8.2",
|
|
51
|
-
"@rigour-labs/core": "5.1.
|
|
51
|
+
"@rigour-labs/core": "5.1.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "^25.0.3",
|