cpfs-mcp
v1.1.47CPFS Runner as an MCP server — deterministic AI coding guardrails via a compiled WASM core.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
cpfs_status
Return CPFS Runner MCP status: package version, native core version, free-tier cap, active feature, entitlement.
cpfs_work_queue
List jobs that need work: IDLE (NEW) and FAILED (KEEP WORKING), with the recommended next slug. Same queue model as the extension. Does not invent tasks from chat — only existing feature logs.
cpfs_list_features
List every feature log in the active history (All-logs/<active>/) with its derived lifecycle status (IN_PROGRESS / PASSED / FAILED / SUSPENDED / CLOSED / unknown) and the active marker. Use this to choose which feature to resume with cpfs_continue_feature — the MCP server does not auto-pick an active feature by file mtime. Use cpfs_list_histories / cpfs_use_history to switch which history is active.
cpfs_check_heuristics
Scan a file or folder for CPFS §13 heuristic signals (numeric thresholds, path literals, semantic regex, workaround comments). Returns findings with file/line/signal/detail.
| Parameter | Type | Description |
|---|---|---|
path * | string | Relative path (from workspace root) of a file or folder to scan. |
cpfs_retest_task
Re-run a prior task's frozen RETEST / RETEST-COMPLETE recipe and store the still-passing verdict in .cpfs/retest_results.json (extension retestTask parity).
| Parameter | Type | Description |
|---|---|---|
feature * | string | Feature slug to retest. |
cpfs_acknowledge_escalation
Acknowledge a pending ### AI EXHAUSTED escalation so Pass can proceed. Pick/choose the next path (required for owner gate).
| Parameter | Type | Description |
|---|---|---|
chosen_path | string | What to try next (defaults to Option A from the exhaustion block). |
feature | string | Feature slug; omit for active. |
cpfs_heuristic_review
Validate-equivalent heuristic exposure: scan the feature TARGET FILES (or a workspace sample), write .cpfs/heuristic_last_review.json, and stamp the project log.
| Parameter | Type | Description |
|---|---|---|
feature | string | Feature slug; omit for active. |
cpfs_check_scope
Check whether files the AI touched (or staged git files) are inside the active feature's TARGET FILES. Returns in-scope vs out-of-scope. In MCP there is no editor to block edits, so scope is enforced at commit time by the git pre-commit hook — this tool is the in-conversation check.
| Parameter | Type | Description |
|---|---|---|
feature | string | Feature slug; omit for the active feature. |
files | array | Files to check. Omit to read staged git files (git diff --cached --name-only). |
cpfs_check_claims
Scan the project log for pass-claim stamps (e.g. STATUS: SUCCESS) in the current attempt that are NOT backed by REAL TEST EVIDENCE with an on-disk artifact. Same WASM logic as the Cursor stop-hook chat-claim guard.
| Parameter | Type | Description |
|---|---|---|
feature | string | Feature slug; omit for the active feature. |
cpfs_start_feature
Start a CPFS feature: name it, set TARGET FILES, and define success criteria. Creates a feature log in the active history (All-logs/<active>/).
| Parameter | Type | Description |
|---|---|---|
name * | string | Plain-language feature name, e.g. 'Fix the leak'. |
success_criteria * | array | At least one success criterion. |
target_files * | array | Files the AI may edit (TARGET FILES). |
cpfs_get_feature_log
Return the active feature log (or a named one) as text.
| Parameter | Type | Description |
|---|---|---|
feature | string | Feature slug; omit for the active (most-recent) feature. |
cpfs_add_target_files
Append workspace-relative paths to the feature log TARGET FILES line (no duplicates). Refreshes AI context on success. Parity with the Runner Manage target files panel and Add File to TARGET FILES.
| Parameter | Type | Description |
|---|---|---|
paths * | array | Paths to add (workspace-relative, globs allowed). |
feature | string | Feature slug; omit for MCP active session slug. |
cpfs_remove_target_files
Remove paths from the feature log TARGET FILES line. Refreshes AI context on success. Parity with Runner Manage target files → Remove selected.
| Parameter | Type | Description |
|---|---|---|
paths * | array | Paths to remove (must match log entries). |
feature | string | Feature slug; omit for MCP active session slug. |
cpfs_refresh_ai_context
Regenerate the active CPFS rule (FEATURE / TARGET FILES / DO NOT REPEAT / REAL TEST BEFORE PASS / NO FALSE COMPLETION / checksum) and write it to the connected AI client's auto-read rules file (e.g. .cursor/rules/cpfs-active.mdc in Cursor, CLAUDE.md+AGENTS.md in Claude, .windsurfrules in Windsurf). Only the current client's file(s) are written — set CPFS_CLIENTS env to override. Call this after starting a feature or ending an attempt so the AI sees fresh context on every turn.
| Parameter | Type | Description |
|---|---|---|
feature | string | Feature slug; omit for the active feature. |
cpfs_continue_feature
Open a new attempt on an existing feature (e.g. after a failed attempt or owner reopen). Appends a new ATTEMPT #N block to the feature log.
| Parameter | Type | Description |
|---|---|---|
feature | string | Feature slug; omit for the active feature. |
cpfs_record_evidence
Record a real-test-evidence line for the current attempt (e.g. 'ran the endpoint, got 200 + dashboard loaded | artifact: logs/verify/x.txt'). This is what the gated Pass later looks for — record it as you verify, so cpfs_end_attempt_success can pass.
| Parameter | Type | Description |
|---|---|---|
evidence_file | string | Path to the captured proof artifact (screenshot/log/output file). |
evidence_summary | string | One-line summary of the real test you ran and observed. |
feature | string | Feature slug; omit for the active feature. |
cpfs_agree_verify
Agree the VERIFY BY section of the active feature log (flip Status: pending → agreed, set the Method). This is the MCP equivalent of the owner confirming the verify method in chat. Once agreed, the gated Pass can succeed. Call this once per feature after you and the AI agree how success will be tested.
| Parameter | Type | Description |
|---|---|---|
feature | string | Feature slug; omit for the active feature. |
method | string | The agreed verify method text (e.g. 'run node scripts/smoke.cjs → 20 passed'). If omitted, existing methods are kept and only Status is flipped. |
cpfs_add_do_not_repeat
Add a line to the DO NOT REPEAT section of the active feature log, so the AI never retries a known-failed approach. Refreshes the injected rule immediately.
| Parameter | Type | Description |
|---|---|---|
line * | string | The failed approach to record (e.g. 'retrying the 0.27 threshold (failed)'). |
feature | string | Feature slug; omit for the active feature. |
cpfs_fail_attempt
Close the current attempt as FAILED (owner reject). action: 'retry' opens a new attempt, 'suspend' pauses the feature, 'close' ends it. Refreshes the injected rule.
| Parameter | Type | Description |
|---|---|---|
action | string | What to do after failing. Default 'retry'. |
feature | string | Feature slug; omit for the active feature. |
reason | string | Why the attempt failed. |
cpfs_end_attempt_success
Close the active attempt as PASSED. GATED by the real engine: refuses if (a) free-tier is exhausted, (b) VERIFY BY is not agreed, or (c) there is no real-test evidence. Returns the gate verdict — do not claim 'done' to the user until this tool returns allowed=true.
| Parameter | Type | Description |
|---|---|---|
evidence_file | string | Path to a real-test evidence artifact (e.g. a screenshot/log) proving the change works end-to-end. |
evidence_summary | string | One-line summary of the real test you ran and what you observed. |
feature | string | Feature slug; omit for the active feature. |
cpfs_enter_license
Enter a CPFS Pro license key. Verified offline by the compiled WASM core (ed25519). Removes the free-tier limit.
| Parameter | Type | Description |
|---|---|---|
key * | string | The license token string. |
cpfs_set_telemetry
Opt in to or out of anonymous CPFS telemetry. Default is OFF. Reversible at any time. When ON, sends only an anonymous startup ping (feature count, native core version, free-tier usage) — never source code, file paths, or prompts.
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | true to opt in, false to opt out. |
cpfs_list_histories
List all CPFS job-history files registered in repo-root historys.json, with which one is active for MCP and which for the extension. On startup with no active history chosen, call this to pick one.
cpfs_use_history
Switch the active job-history for the MCP server. All subsequent task reads/writes go to All-logs/<name>/. Does not affect the extension's chosen history.
| Parameter | Type | Description |
|---|---|---|
name * | string | History name (must exist — see cpfs_list_histories). |
cpfs_create_history
Create a new job-history (a new All-logs/<name>/ folder + empty materialized index) and optionally set it as the active history for MCP and/or the extension. Does not copy existing logs — use the migration script for that.
| Parameter | Type | Description |
|---|---|---|
name * | string | New history name (slug-friendly). |
set_extension_active | boolean | Set this as the extension's active history (default false). |
set_mcp_active | boolean | Set this as MCP's active history (default true). |
cpfs_current_history
Report which job-history is active for MCP and the extension, and where its logs/index live.
cpfs_fan_out_rules
Write the CPFS protocol block into every supported IDE's native rules file (.windsurfrules, CLAUDE.md, AGENTS.md, GEMINI.md, .github/copilot-instructions.md) so an MCP-connected AI in any IDE follows CPFS from rules + MCP tools even without agent-lifecycle hooks. Idempotent — call when a rules file is missing or after CPFS is enabled. Returns per-IDE status.
cpfs_enable_workspace
Enable CPFS for this workspace: scaffold .cpfs/, config, onboarding, zone map, git hook, and the mandatory .cursor/rules/cpfs-mandatory.mdc rule. Idempotent. Parity with the extension's enableWorkspace command.
cpfs_install_mandatory_rule
Write the mandatory CPFS policy rule to .cursor/rules/cpfs-mandatory.mdc (always-applied). Returns true if freshly created. Idempotent.
cpfs_dismiss_pending_scope_edits
Dismiss ALL pending out-of-scope edits for a feature so the gated Pass is no longer soft-blocked by them. Clears the MCP scope-watcher pending store for that slug AND marks the extension edit-history entries skipped (extension dismissPendingScopeEdits parity). Use after the owner decides the out-of-scope writes are acceptable but does not want to Keep/Revert each one.
| Parameter | Type | Description |
|---|---|---|
feature | string | Feature slug; omit for the active feature. |
cpfs_dev_set_free_counter
DEV ONLY: set the free-tier completion counter in .cpfs/config-mcp.json (0..cap). Useful for testing free-tier exhaustion/restore behavior. No effect when a Pro license is installed.
| Parameter | Type | Description |
|---|---|---|
value * | integer | New freeCounter value (0..free_tier_cap). |
cpfs_remove_license
Remove the stored CPFS Pro license key. The workspace falls back to free-tier rules. Reversible by re-entering a key via cpfs_enter_license.
cpfs_show_license_status
Show the current license/entitlement status: mode (full/free-enforced/free-exhausted), licensed flag, license payload (seat/email/exp) if any, and free-tier usage. Parity with the extension's showLicenseStatus.
cpfs_refresh_license
Re-fetch the latest valid CPFS Pro license key for an email from the CPFS license server and store it (renewal that feels like the same key got extended). The server always returns a freshly-signed key for that email; it is verified locally before storing. Default server: https://ragbox.llc.
| Parameter | Type | Description |
|---|---|---|
email * | string | The email used to purchase CPFS Pro. |
server | string | Override license server base URL (default https://ragbox.llc). |
cpfs_set_reference_images_dir
Set the reference-images directory (relative path from workspace root) used for verify captures and owner context screenshots. Stored in .cpfs/config-mcp.json as referenceImagesPath.
| Parameter | Type | Description |
|---|---|---|
path * | string | Relative directory path (e.g. 'images' or 'docs/screenshots'). |
cpfs_open_reference_images_dir
Report the reference-images directory: resolved path, whether it exists, image count, and the newest images. The extension opens the folder in the OS; the MCP server has no OS opener, so it returns the listing instead.
cpfs_toggle_lint_enabled
Enable or disable the post-edit lint hook. When enabled, the configured lint command runs after AI edits and surfaces hints. Stored in .cpfs/config-mcp.json as lintEnabled.
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | true to enable lint, false to disable. |
cpfs_set_lint_command
Set the lint command run after AI edits (e.g. 'npx eslint --fix {file}'). The {file} token is replaced with the edited file path. Stored in .cpfs/config-mcp.json as lintCommand.
| Parameter | Type | Description |
|---|---|---|
command * | string | Lint command string (use {file} as a placeholder for the edited file). |
cpfs_toggle_checkpoint_enabled
Enable or disable attempt checkpoints (git snapshots taken at attempt start). When disabled, no checkpoint is created on attempt open. Stored in .cpfs/config-mcp.json as checkpointEnabled.
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | true to enable checkpoints, false to disable. |
cpfs_toggle_checkpoint_auto_restore
Enable or disable auto-restoring the attempt checkpoint when a test fails. When enabled, a failed validateAttempt restores files to the checkpoint before retrying. Stored in .cpfs/config-mcp.json as checkpointAutoRestoreOnTestFail.
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | true to auto-restore on test fail, false to disable. |
cpfs_open_dashboard
Return the URL of the CPFS MCP localhost dashboard (human review surface for scope Keep/Revert, Pass, Fail, escalation acknowledge, and reports). Open it in a browser.
cpfs_toggle_cpfs
Enable or disable CPFS enforcement for this workspace (writes the 'enabled' flag in .cpfs/config-mcp.json). When disabled, the MCP tools still run but report CPFS as off. Reversible.
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | true to enable CPFS, false to disable. |
cpfs_owner_pass
Director/owner Pass: confirm a feature attempt as PASSED without requiring AI real-test evidence (the owner tested and confirmed). Parity with the dashboard's ownerPass / ownerPassNoArtifact. Still respects free-tier exhaustion and escalation gates.
| Parameter | Type | Description |
|---|---|---|
feature | string | Feature slug; omit for the active feature. |
no_artifact | boolean | true to stamp OWNER PASS (NO AI ARTIFACT); false (default) to stamp OWNER CONFIRM PASS. |
cpfs_validate_attempt
Run the configured test command (testCommand in .cpfs/config-mcp.json) for the active feature attempt and append a VALIDATION block to the log. Returns pass/fail, exit code, and output tail. Respects the soft-block (pending out-of-scope edits) gate. Parity with the extension's validateAttempt command (the vscode modal is replaced by a structured block reason).
| Parameter | Type | Description |
|---|---|---|
feature | string | Feature slug; omit for the active feature. |
cpfs_run_all_checks
Run every agreed command/file outcome row from the active feature's VERIFY BY section, append an OUTCOME RESULTS block to the log, and return the rollup summary. Matches the extension's runAllChecks (automated outcome checks only — heuristic and scope are separate tools). Respects the acceptance gate and soft-block.
| Parameter | Type | Description |
|---|---|---|
feature | string | Feature slug; omit for the active feature. |
cpfs_restore_attempt_checkpoint
Restore files to the active attempt's checkpoint (a git stash ref captured at attempt start). With no files arg, restores every file changed since the checkpoint. Returns restored/failed lists. Parity with the extension's restoreAttemptCheckpoint command.
| Parameter | Type | Description |
|---|---|---|
feature | string | Feature slug; omit for the active feature. |
files | array | Specific relative paths to restore. Omit to restore all files changed since the checkpoint. |
ref | string | Override git ref to restore from (defaults to the stored attempt checkpoint). |
cpfs_export_report
Write a self-contained HTML development report for a feature (summary, attempt timeline, success criteria, verify-by, DO NOT REPEAT, weekly activity) to <logs-dir>/<slug>-report.html and return the path. Parity with the extension's exportReport command (the save dialog is replaced by a deterministic path).
| Parameter | Type | Description |
|---|---|---|
feature | string | Feature slug; omit for the active feature. |
cpfs_manage_active_zones
Set which development zone IDs are active for this workspace (stored as activeZones in .cpfs/config-mcp.json). The active zones determine the default TARGET FILES for new features. Returns the zone summary. Parity with the extension's manageActiveZones command (quick-pick → MCP args).
| Parameter | Type | Description |
|---|---|---|
zone_ids * | array | Zone IDs to activate (must exist in the zone map). |
cpfs_add_file_to_zone
Add an explicit file path to one or more development zones in the zone map. Persists the updated zone map. Parity with the extension's addFileToZone command.
| Parameter | Type | Description |
|---|---|---|
file * | string | Relative file path to add. |
zone_ids * | array | Zone ID(s) to add the file to. |
cpfs_remove_file_from_zone
Remove an explicit file path from a development zone in the zone map. Persists the updated zone map. Parity with the extension's removeFileFromZone command.
| Parameter | Type | Description |
|---|---|---|
file * | string | Relative file path to remove. |
zone_id * | string | Zone ID to remove the file from. |
cpfs_lint_file
Run the configured lint command on a single file and return pass/fail + output tail. Respects the lintEnabled flag and lintCommand in .cpfs/config-mcp.json. Parity with the extension's post-edit lint hook (exposed here as an on-demand tool).
| Parameter | Type | Description |
|---|---|---|
file * | string | Relative file path to lint (the {file} token in lintCommand is replaced with this). |
cpfs_set_test_command
Set the test command run by cpfs_validate_attempt (e.g. 'npm test' or 'node scripts/smoke.cjs'). Stored in .cpfs/config-mcp.json as testCommand. Parity with the extension's testCommand setting.
| Parameter | Type | Description |
|---|---|---|
command * | string | Test command string (run from the workspace root). |
cpfs_accept_outcomes
Mark outcome rows in ### OUTCOME ACCEPTANCE as ✓ accepted (or ✗ rejected with a note). The WASM acceptance gate blocks cpfs_run_all_checks until every row is ✓ accepted, so this is the gate's key. Parity with the extension's dashboard ✓ accept button. Default: accept all pending rows.
| Parameter | Type | Description |
|---|---|---|
accept | array | Specific outcome labels (e.g. ['A','B']) to accept. Omit to accept all pending rows. |
feature | string | Feature slug; omit for the active feature. |
reject | object | Map of outcome label → note to mark ✗ not understood instead of ✓. |
cpfs_generate_onboarding
Generate (or regenerate) an ONBOARDING.md onboarding document for the workspace by scanning the repo structure, services, handoffs, and CPFS zones. Writes the file and returns the report + an AI fill prompt. Parity with the extension's generateOnboarding command.
| Parameter | Type | Description |
|---|---|---|
rel_path | string | Target relative path for the onboarding file (default ONBOARDING.md). |
cpfs_verify_onboarding
Verify the onboarding document (checks required sections, handoff coverage, dir mentions) and return a formatted report. Does not modify the file. Parity with the extension's verifyOnboarding command.
| Parameter | Type | Description |
|---|---|---|
rel_path | string | Onboarding file relative path. Omit to resolve from config (onboardingPath / config.onboarding.path). |
cpfs_approve_onboarding
Approve the onboarding document: stamp the approved frontmatter (approved: true, approved_at: today), write it back, then verify and report onboarding status. Parity with the extension's approveOnboarding command.
| Parameter | Type | Description |
|---|---|---|
rel_path | string | Onboarding file relative path. Omit to resolve from config. |
cpfs_reaudit_onboarding
Re-audit the onboarding document: run auditOnboarding (updates frontmatter audited_at/audited_commit/watch_paths) and assess staleness. Scaffolds a minimal onboarding file if none exists. Returns the audit report + staleness assessment. Parity with the extension's reauditOnboarding command.
| Parameter | Type | Description |
|---|---|---|
rel_path | string | Onboarding file relative path. Omit to resolve from config (scaffolds a minimal file if missing). |
cpfs_attach_onboarding
Attach an existing onboarding file (relative path) as the workspace's onboarding document. Stores it in .cpfs/config-mcp.json (onboarding.path + legacy onboardingPath). Parity with the extension's attachOnboarding command (file picker → MCP arg).
| Parameter | Type | Description |
|---|---|---|
rel_path * | string | Relative path to the onboarding file (e.g. 'docs/ONBOARDING.md'). |
cpfs_mark_onboarding_ai_audit
Mark the onboarding document's source as 'ai_audit' (created by AI audit) in .cpfs/config-mcp.json. Used after cpfs_generate_onboarding / cpfs_reaudit_onboarding so the dashboard shows the correct source label. Reversible by attaching a user file.
cpfs_open_onboarding
Return the onboarding document path and its contents (the extension opens the file in the editor; the MCP server has no editor, so it returns the content instead). Reports missing-file when no onboarding is configured.
cpfs_start_formal_feature
Start a CPFS formal feature (Type 3): write a structured-test draft to .cpfs/formal_feature_draft.md and return the AI review prompt + the dashboard Formal Feature form URL. The draft is the shared workspace between the AI (chat) and the human (dashboard form). Optional tests JSON pre-fills structured tests (AI-draft fast path); the human reviews/edits in the dashboard before the feature log is created. Parity with the extension's formal feature form (webview → dashboard page).
| Parameter | Type | Description |
|---|---|---|
name * | string | Feature name. |
problem | string | Problem statement (what needs to be done). |
target_files | string | Comma-separated target files (TARGET FILES). |
tests | array | Optional pre-filled structured tests (AI-draft fast path). Human reviews in the dashboard. |
cpfs_upgrade_to_type3
Upgrade an existing Type 2 (non-formal) feature to Type 3 (formal): read its log, build a pre-filled formal-feature draft from it (feature name, target files, problem reconstructed from the opening request + success criteria), write the draft, and return the review prompt + dashboard form URL. The developer then fills in the structured tests / reference image in the dashboard. Parity with the extension's 'Upgrade to Type 3' button.
| Parameter | Type | Description |
|---|---|---|
feature * | string | Existing feature slug to upgrade. |
cpfs_edit_criteria
Open the dashboard Formal Feature form to edit the structured-test criteria of the current formal feature draft (.cpfs/formal_feature_draft.md). Returns the dashboard form URL. If no draft exists, instruct to call cpfs_start_formal_feature or cpfs_upgrade_to_type3 first. Parity with the extension's formal feature form (the webview is replaced by the dashboard page).
cpfs_analyze_legacy_crossings
Analyze legacy crossings (blast radius) for a passed CPFS task: detect pre-existing symbols the task modified, resolve their non-CPFS callers via a standalone language server (C-LSP — selected by file extension, auto-installed for npm-based servers), and scaffold one coverage task log. Falls back to symbol-existence-only ('basic blast-radius detection') when no language server is available. Returns the report + the dashboard blast-radius URL. Parity with the extension's analyzeLegacyCrossings command (vscode-coupled LSP → standalone-server LSP).
| Parameter | Type | Description |
|---|---|---|
feature | string | Feature slug to analyze; omit for the active feature. |
write_coverage | boolean | Scaffold a coverage task log from the crossings (default true, parity with the extension). Set false for a read-only report. |