MCP Server
Integrate Rigour with AI agents via Model Context Protocol (MCP).
Overview
Rigour provides an MCP server that allows AI coding agents to validate their changes before finalizing a task. Unlike traditional linters, Rigour is designed to be consumed by agents to enforce engineering standards.
Installation
npx @rigour-labs/mcp
Or install globally:
npm install -g @rigour-labs/mcp
Integration Cookbook: Client Recipes
Rigour can be integrated with any MCP-compliant client. Below are optimized configuration recipes for the most popular AI agentic tools.
🤖 Claude Code
Claude Code consumes MCP servers via its internal config.
# Add Rigour to Claude Code
claude mcp add rigour npx -y @rigour-labs/mcp
🖱️ Cursor
Cursor can be configured globally or per-project.
Global setup:
- Open Cursor Settings > Features > MCP.
- Click + Add New MCP Server.
- Name:
Rigour - Type:
command - Command:
npx -y @rigour-labs/mcp
Project-specific setup:
Add this to your .cursor/mcp.json:
{
"mcpServers": {
"rigour": {
"command": "npx",
"args": ["-y", "@rigour-labs/mcp"]
}
}
}
🛠️ Cline / Roo Code
Cline uses a dedicated settings file. Add this to your cline_mcp_settings.json:
{
"mcpServers": {
"rigour": {
"command": "npx",
"args": ["-y", "@rigour-labs/mcp"]
}
}
}
🌀 Antigravity
If you are using Antigravity, Rigour is often pre-configured or can be added via the tool-call interface by pointing to the binary:
{
"command": "npx",
"args": ["-y", "@rigour-labs/mcp"]
}
🛰️ Gemini CLI / Firebase Genkit
For programmatic usage or CLI wrappers that support MCP:
import { McpClient } from '@modelcontextprotocol/sdk';
const client = new McpClient({
command: 'npx',
args: ['-y', '@rigour-labs/mcp']
});
Available Tools
The MCP server exposes tools for validation and project reasoning.
rigour_check
Runs the full suite of Rigour quality gates on the current project state.
Arguments:
cwd(optional): Absolute path to the project root.
rigour_explain
Provides a human-readable explanation of why the last quality gate check failed.
Arguments:
cwd(optional): Absolute path to the project root.
rigour_status
A lightweight PASS/FAIL check that returns structured JSON. Ideal for agent polling.
Arguments:
cwd(optional): Absolute path to the project root.
rigour_get_fix_packet
Retrieves the prioritized Fix Packet (Diagnostic) containing actionable instructions for the agent to resolve quality gate violations.
rigour_list_gates & rigour_get_config
Utility tools that allow the agent to inspect active gates and the project's rigour.yml configuration.
The Stateless Workflow
Rigour's MCP tools operate on the current filesystem state. Agents should follow this loop:
- Work: Apply changes to the codebase.
- Audit: Call
rigour_checkorrigour_status. - Refine: If failures occur, call
rigour_get_fix_packetorrigour_explainonce to get instructions. - Repeat: Resolve the issues and audit again until
PASS.
Best Practices
- Audit Before Done: Never claim a task is complete without a
PASSstatus from Rigour. - Read the Packet: Use
rigour_get_fix_packetto understand how to refactor (e.g., extracting functions to reduce complexity). - Reason about Rules: Use
rigour_get_configto understand project-specific constraints like protected paths or forbidden dependencies.