What the MCP server provides
The server registers four tools that the AI agent can call during a coding session:aislop_scan
Runs
aislop scan on a path and returns structured findings. The agent sees rule IDs, messages, severity, and the overall score.aislop_fix
Applies mechanical auto-fixes — unused imports, narrative comments, dead code, formatting — and reports what was changed.
aislop_why
Explains why a specific rule exists, what pattern it catches, and how to resolve a finding, giving the agent full context for non-mechanical fixes.
aislop_baseline
Captures the current score as a baseline. Subsequent hook runs or scans compare against this baseline to detect regressions.
Quick start (no install)
The fastest way to add the MCP server is withnpx -y aislop-mcp, which downloads and runs the server on demand without a global install.
Configuration by environment
- Claude Desktop
- Cursor
- Codex CLI
Open your Claude Desktop configuration file and add the Restart Claude Desktop after saving. The aislop tools appear automatically in the tools panel.
aislop entry under mcpServers:Using a globally installed binary
If you have installedaislop-mcp globally (npm i -g aislop-mcp), reference the binary directly instead of using npx. This avoids the package resolution step on every server start.
How agents use the tools
Once the server is running, the AI agent can call the tools during a session. A typical workflow looks like this:Agent generates or edits code
The agent writes a function, refactors a module, or makes changes across several files.
Agent calls aislop_scan
The agent scans the modified path and receives structured findings: rule IDs, line numbers, messages, and the overall score.
Agent calls aislop_fix
For mechanical issues (unused imports, narrative comments, dead code), the agent applies auto-fixes directly.
Agent calls aislop_why (if needed)
For findings that require context-specific judgment, the agent calls
aislop_why to understand the rule before deciding how to resolve it.The MCP server shells out to the
aislop CLI. Make sure aislop is installed and available on the PATH used by your environment, or install it globally with npm i -g aislop before starting the server.