MCP server
RuleFix runs a remote MCP server your AI coding agent calls to check code before and after it writes it, fix findings, verify the fix and record evidence in your workspace. No install: add one URL and an API key.
Haven't got a key yet? Start with the quickstart. For the product overview, see RuleFix for AI agents.
On this page
Endpoint and transport
| Property | Value |
|---|---|
| Endpoint | https://rulefix.in/mcp |
| Transport | Streamable HTTP, stateless: JSON-RPC over POST, JSON responses, no sessions or SSE stream |
| Auth | API key as a Bearer token (see below) |
| Server | rulefix 1.0.0 |
| Capabilities | 10 tools and 1 prompt (compliance_review) |
- Value
https://rulefix.in/mcp
- Value
- Streamable HTTP, stateless: JSON-RPC over POST, JSON responses, no sessions or SSE stream
- Value
- API key as a Bearer token (see below)
- Value
rulefix 1.0.0
- Value
- 10 tools and 1 prompt (compliance_review)
RuleFix can't read your disk. Your agent sends file contents with repository-relative paths (for example src/api/users.ts); the extension picks the language rules. Opening the endpoint in a browser (GET) returns 405 with a short description of the server.
Authentication
Every request needs a RuleFix API key in the Authorization header. Workspace owners and admins create keys under Settings → API keys. A key belongs to one workspace: tools that read or write projects and issues only ever see that workspace.
Authorization: Bearer rf_live_your_api_key- Keys are
rf_live_plus 32 letters and digits. They can expire (30, 90 or 365 days) and can be revoked at any time. - Missing, malformed, unknown, revoked and expired keys all get the same 401, so a response never reveals whether a key exists.
- Keep keys out of source control. Use your client's secret prompt (VS Code) or an environment variable for shared configs.
Connect your client
Pick your client, paste the snippet in the file shown, and replace the placeholder key.
claude mcp add --transport http rulefix https://rulefix.in/mcp --header "Authorization: Bearer rf_live_your_api_key"| Client | Where | Notes |
|---|---|---|
| Claude Code | Terminal | Add --scope project to share it with your team via .mcp.json (keep the key in an env var). |
| Cursor | .cursor/mcp.json | — |
| VS Code | .vscode/mcp.json | VS Code prompts for the key once and stores it securely. |
| Windsurf | ~/.codeium/windsurf/mcp_config.json | — |
- Where
Terminal- Notes
- Add --scope project to share it with your team via .mcp.json (keep the key in an env var).
- Where
.cursor/mcp.json- Notes
- —
- Where
.vscode/mcp.json- Notes
- VS Code prompts for the key once and stores it securely.
- Where
~/.codeium/windsurf/mcp_config.json- Notes
- —
Any other MCP client that supports remote Streamable HTTP servers with custom headers works the same way: URL https://rulefix.in/mcp, header Authorization: Bearer ….
Tools
The first six tools only analyse what you send and store nothing. The last four use your workspace: two read it, two write to it. Inputs below are generated from the server's own schemas.
| Tool | What it does | Workspace |
|---|---|---|
| rulefix_scan_files | Check file contents against DPDP, GDPR, SOC 2, HIPAA, PCI DSS and more. Returns findings with exact lines and fixes. | — |
| rulefix_check_snippet | Check code before writing it to a file, so the agent never introduces a violation. | — |
| rulefix_suggest_fix | Get a compliant rewrite for a finding: AI-generated when enabled, otherwise the rule's reference fix. | — |
| rulefix_verify_fix | Re-scan the edited file and confirm the finding is gone and nothing new was introduced. | — |
| rulefix_explain_rule | What a rule checks, why the regulation cares, and how to comply. | — |
| rulefix_list_rules | The rule catalogue, filtered by framework. | — |
| rulefix_list_projects | Projects in your RuleFix workspace, with their frameworks and latest score. | Reads |
| rulefix_get_issues | Open findings from your dashboard (repository and website scans, earlier reports) so the agent can fix them in your codebase. | Reads |
| rulefix_report_scan | Scan files and record the results in a project, so your team and auditors see them in the dashboard. | Writes |
| rulefix_resolve_issue | Mark an issue fixed — only after RuleFix re-scans the submitted file and confirms the finding is gone. | Writes |
- What it does
- Check file contents against DPDP, GDPR, SOC 2, HIPAA, PCI DSS and more. Returns findings with exact lines and fixes.
- Workspace
- —
- What it does
- Check code before writing it to a file, so the agent never introduces a violation.
- Workspace
- —
- What it does
- Get a compliant rewrite for a finding: AI-generated when enabled, otherwise the rule's reference fix.
- Workspace
- —
- What it does
- Re-scan the edited file and confirm the finding is gone and nothing new was introduced.
- Workspace
- —
- What it does
- What a rule checks, why the regulation cares, and how to comply.
- Workspace
- —
- What it does
- The rule catalogue, filtered by framework.
- Workspace
- —
- What it does
- Projects in your RuleFix workspace, with their frameworks and latest score.
- Workspace
- Reads
- What it does
- Open findings from your dashboard (repository and website scans, earlier reports) so the agent can fix them in your codebase.
- Workspace
- Reads
- What it does
- Scan files and record the results in a project, so your team and auditors see them in the dashboard.
- Workspace
- Writes
- What it does
- Mark an issue fixed — only after RuleFix re-scans the submitted file and confirms the finding is gone.
- Workspace
- Writes
rulefix_scan_filesScan files
Check file contents against DPDP, GDPR, SOC 2, HIPAA, PCI DSS and more. Returns findings with exact lines and fixes.
Use after editing: send every changed file (full contents). Paths must be repository-relative.
files{ path, content }[] (1–200)requiredFiles to scan, each {path, content}. At most 200 files per call; send changed files, not the whole repo.
frameworksstring[] (1–8)optionalOnly run rules for these frameworks (any of: dpdp, gdpr, soc-2, hipaa, pci-dss, iso-27001, ccpa, lgpd). Omit to run every rule.
Returns: summary (high/medium/low counts) and score 0–100; findings grouped by file with line, severity, rule id, message and a stable fingerprint; one "how to fix" entry per rule; files that were not scanned and why. Nothing is stored — use rulefix_report_scan to record results in a project.
rulefix_check_snippetCheck a snippet
Check code before writing it to a file, so the agent never introduces a violation.
Call BEFORE writing code to a file: send the code you are about to write (a whole file or the new block) so violations never land in the repo.
pathstringrequiredRepository-relative path with forward slashes, e.g. src/api/users.ts. The extension selects the language rules.
contentstringrequiredFull UTF-8 text of the file (max 512 KiB).
frameworksstring[] (1–8)optionalOnly run rules for these frameworks (any of: dpdp, gdpr, soc-2, hipaa, pci-dss, iso-27001, ccpa, lgpd). Omit to run every rule.
Returns: "No issues" when clean, otherwise each finding with line (relative to the snippet), severity, rule id, message and how to fix it.
rulefix_suggest_fixSuggest a fix
Get a compliant rewrite for a finding: AI-generated when enabled, otherwise the rule's reference fix.
pathstringrequiredRepository-relative path with forward slashes, e.g. src/api/users.ts. The extension selects the language rules.
contentstringrequiredFull UTF-8 text of the file (max 512 KiB).
ruleIdstringrequiredRule id, e.g. "dpdp.pii-in-logs" (from a finding or
rulefix_list_rules).lineinteger (≥ 1)optionalLine of the finding to fix, when the rule fires more than once.
Returns: when AI fixes are enabled on the server, an exact edit — "replace lines X–Y with …" — that RuleFix has already re-scanned and verified (the finding is gone and no new high-severity finding appeared). Otherwise, or if the AI edit fails verification, the rule's reference fix: remediation steps, a before/after example and the exact location, for you to apply. The output says which mode was used. Secret values are redacted before any code is sent to the AI model.
rulefix_verify_fixVerify a fix
Re-scan the edited file and confirm the finding is gone and nothing new was introduced.
Call after applying a fix. Send the full edited file. Pass previousFingerprint (from the original finding) and/or ruleId to check that specific finding.
pathstringrequiredRepository-relative path with forward slashes, e.g. src/api/users.ts. The extension selects the language rules.
contentstringrequiredFull UTF-8 text of the file (max 512 KiB).
ruleIdstringoptionalRule id, e.g. "dpdp.pii-in-logs" (from a finding or
rulefix_list_rules).previousFingerprintstringoptionalThe fingerprint of the finding you fixed (from scan_files / check_snippet / get_issues).
Returns: status — resolved (finding gone), not-resolved (still present, with the line), unclear (the fingerprint is gone but the same rule still fires in this file — check whether that is the same code), or rescanned (no target given) — plus every finding still in the file.
rulefix_explain_ruleExplain a rule
What a rule checks, why the regulation cares, and how to comply.
ruleIdstringrequiredRule id, e.g. "dpdp.pii-in-logs" (from a finding or
rulefix_list_rules).
Returns: the rule's full text — what it detects, why the regulation cares, how to comply, a before/after example and references. Unknown ids return an error listing the closest matches.
rulefix_list_rulesList rules
The rule catalogue, filtered by framework.
frameworkstringoptionalOnly rules for this framework.
Returns: a table of rule id, severity and title (high severity first). Use rulefix_explain_rule for details.
rulefix_list_projectsList projectsreads workspace
Projects in your RuleFix workspace, with their frameworks and latest score.
No parameters.
Returns: projects in the workspace that owns this API key — id, name, repository, frameworks and latest score. Use the id with rulefix_get_issues and rulefix_report_scan.
rulefix_get_issuesGet open issuesreads workspace
Open findings from your dashboard (repository and website scans, earlier reports) so the agent can fix them in your codebase.
projectIdstring (UUID)requiredProject id from
rulefix_list_projects(UUID).status"open" | "fixed" | "ignored" | "all"optionalIssue status filter (default open).
severity"high" | "medium" | "low"optionalOnly this severity.
limitinteger (1–100)optionalMaximum issues to return (1–100, default 50).
Returns: the project's issues, newest first — issue id, file path and line, rule id, title, message, code excerpt when available — plus how to fix each rule. Fix them in the codebase, then call rulefix_resolve_issue with the edited file to close each one.
rulefix_report_scanReport a scanwrites workspace
Scan files and record the results in a project, so your team and auditors see them in the dashboard.
Records evidence in the dashboard. Scans the files with the project's frameworks and stores the scan and its findings in the project (new issues are created; fixed issues that reappear are reopened). A partial scan never closes issues — use rulefix_resolve_issue for that.
projectIdstring (UUID)requiredProject id from
rulefix_list_projects(UUID).files{ path, content }[] (1–200)requiredFiles to scan, each {path, content}. At most 200 files per call; send changed files, not the whole repo.
refstringoptionalBranch or tag the files come from, e.g. main.
commitShastringoptionalCommit the files were taken from.
Returns: score, counts, new/reopened issue counts and a dashboard link.
rulefix_resolve_issueResolve an issuewrites workspace
Mark an issue fixed — only after RuleFix re-scans the submitted file and confirms the finding is gone.
Evidence-backed resolution. Send the COMPLETE current content of the issue's file; RuleFix re-scans it and marks the issue fixed only if the finding is gone (its fingerprint no longer matches and the same rule no longer fires anywhere in the file except at other tracked issues). Otherwise nothing changes and the output shows what still fails.
issueIdstring (UUID)requiredIssue id from
rulefix_get_issues(UUID).pathstringrequiredRepository-relative path with forward slashes, e.g. src/api/users.ts. The extension selects the language rules.
contentstringrequiredFull UTF-8 text of the file (max 512 KiB).
Returns: resolved with the evidence (rule, file, content hash, time), or refused with the blocking findings and how to fix them.
Structured output
Every tool returns readable Markdown for the agent plus structuredContent JSON with the same data (findings with ruleId, severity, path, line, snippet, fingerprint and remediation).
The recommended loop
The server sends these instructions to every agent when it connects, so you rarely need to spell them out:
- Before writing code that touches personal data, auth, logging, payments, health data or secrets, call
rulefix_check_snippetwith the code you are about to write. Fix anything it reports first. - After editing, call
rulefix_scan_fileswith every changed file (full contents). - For each finding, call
rulefix_suggest_fix(verified rewrite or reference fix), apply it, thenrulefix_verify_fixwith the edited file and the finding's fingerprint. - When the user wants the results on their dashboard, call
rulefix_report_scanwith the project id (rulefix_list_projects). - To work through existing dashboard findings:
rulefix_get_issues, fix each in code, thenrulefix_resolve_issuewith the complete file — RuleFix only marks an issue fixed after its own re-scan confirms it.
The compliance_review prompt packages this loop: it finds changed files with git, scans them in batches of at most 200, fixes and verifies each finding (highest severity first), summarises, and asks before recording anything. In Claude Code run it as /mcp__rulefix__compliance_review; it takes an optional comma-separated list of frameworks.
Evidence-backed resolution
An agent can't close a dashboard issue by saying it fixed it. rulefix_resolve_issue takes the complete current file, re-scans it and marks the issue fixed only if:
- no finding in the file still carries the issue's fingerprint, and
- the same rule no longer fires anywhere in the file, except at places already tracked as other issues.
Otherwise nothing changes and the response lists the findings that block resolution. On success it returns the evidence: rule, file, SHA-256 of the content and time, and the change shows up in your dashboard.
rulefix_report_scan records findings as issues (new ones are created, fixed ones that reappear are reopened). Because it only sees the files you send, it never closes issues; only rulefix_resolve_issue, a complete dashboard scan or a person in the dashboard can.
rulefix_verify_fix is the stateless equivalent while you work: it answers resolved, not-resolved, unclear (the fingerprint is gone but the rule still fires in the file) or rescanned (no target given).
AI fixes
rulefix_suggest_fix works in two modes, and the response says which one it used:
- Reference fix (always available): the rule's remediation steps, a before/after example and the exact location, for your agent to apply.
- AI rewrite (optional, when AI fixes are enabled on the server): an exact “replace lines X–Y with …” edit generated by an Anthropic Claude model.
Before an AI rewrite is returned, RuleFix:
- sends only a window of about 60 lines either side of the finding, with secret values (API keys, tokens, private keys, passwords, credentials in URLs and
.envvalues) replaced by placeholders; - restores the placeholders in the model's answer and applies the edit to your file in memory;
- re-scans the patched file and accepts the edit only if the finding is gone and no new high-severity finding appeared — otherwise it falls back to the reference fix and says why.
A request is bounded to 30 seconds with no retries. Code and model output are never logged. See Security & data for what is stored.
Limits
| Limit | Value |
|---|---|
| Request body | 2 MB |
| Files per tool call | 200 |
| Size per file | 512 KiB (UTF-8) |
| Path length | 500 characters, repository-relative, no ".." segments |
| Requests per API key | 60 JSON-RPC requests per minute (a batch counts each request) |
| Failed authentications | 30 per client address per minute |
- Value
- 2 MB
- Value
- 200
- Value
- 512 KiB (UTF-8)
- Value
- 500 characters, repository-relative, no ".." segments
- Value
- 60 JSON-RPC requests per minute (a batch counts each request)
- Value
- 30 per client address per minute
Oversized files, bad paths and duplicates in a batch are reported as not scanned with a reason while the rest of the batch is still checked. The engine also skips vendored and generated code (node_modules, dist, build, .next, vendor…), lockfiles, minified files and binary content.
Errors
HTTP-level errors use a JSON-RPC error envelope; clients show its message.
| Status | When | What to do |
|---|---|---|
| 400 | The body isn't valid JSON. | Fix the client request. |
| 401 | Missing, malformed, unknown, revoked or expired API key. | Check the key; create a new one under Settings → API keys. |
| 413 | Body larger than 2 MB. | Send fewer or smaller files per call. |
| 429 | More than 60 requests a minute for this key, or too many failed sign-ins from one address. | Wait for the Retry-After seconds. |
| 503 | The server is not configured, or its authentication backend is briefly unavailable. | Retry after Retry-After (30 s). |
- When
- The body isn't valid JSON.
- What to do
- Fix the client request.
- When
- Missing, malformed, unknown, revoked or expired API key.
- What to do
- Check the key; create a new one under Settings → API keys.
- When
- Body larger than 2 MB.
- What to do
- Send fewer or smaller files per call.
- When
- More than 60 requests a minute for this key, or too many failed sign-ins from one address.
- What to do
- Wait for the
Retry-Afterseconds.
- When
- The server is not configured, or its authentication backend is briefly unavailable.
- What to do
- Retry after
Retry-After(30 s).
Problems inside a tool — too many files, an unknown rule id, a project or issue not in this workspace — come back as a tool result with isError: true and a message the agent can act on, such as “Call rulefix_list_projects to see the project ids this API key can use.”
