@rigour-labs/mcp 5.1.1 → 5.2.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.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);
@@ -27,7 +27,7 @@ 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. Deep modes: off (fast deterministic gates only), quick (deep enabled with lite local model unless cloud provider is configured), full (deep enabled, optional pro flag for full deep model).",
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: {
@@ -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 unique key for this memory (e.g., 'user_preferences', 'coding_style')." },
181
- value: { type: "string", description: "The instruction or context to remember." },
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: "Retrieve stored instructions or context. Call this at the start of each session to restore memory. Returns all stored memories if no key specified.",
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: "Checks if a proposed code pattern (function, component, etc.) already exists, is stale, or has security vulnerabilities (CVEs). CALL THIS BEFORE CREATING NEW CODE.",
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: {
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigour-labs/mcp",
3
- "version": "5.1.1",
3
+ "version": "5.2.0",
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.1"
51
+ "@rigour-labs/core": "5.2.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/node": "^25.0.3",