MCP server
Register the fallow MCP server in Claude Code, Cursor, Codex or another MCP client, with its tools, resources, limits and variables.
Your coding agent asks if it can delete cancelOrder from src/services/orders.ts. With the fallow MCP server, the agent does not build a shell command for that question. It calls the trace_export tool with two typed parameters:
{ "file": "src/services/orders.ts", "export_name": "cancelOrder" }
The tool runs fallow dead-code --trace and returns its JSON, with "is_used": false and the reason No references found, export is unused. Each fallow analysis is a tool of this kind, and a JSON schema describes the parameters of each tool.
The server runs on your machine, and the client starts it as a child process that talks over stdio:
Diagram source
flowchart LR
client["Agent client"]
server["fallow-mcp"]
project["Your project"]
cloud["Fallow Cloud"]
client -->|stdio| server
server -->|reads| project
server -.->|"cloud tools only"| cloudOnly the get_cloud_* tools, and inspect_target with cloud: true, contact Fallow Cloud. Errors and limits says what they send.
An agent with a shell can also run the CLI with --format json. Use the MCP server for a client without a shell, or when you want structured tool calls. Fallow for coding agents compares the parts.
Before you start
- Install fallow in the project:
npm install --save-dev fallow. Thefallownpm package contains thefallow-mcplauncher.cargo install fallow-mcpand the archives of the GitHub release also contain it. - The recommended setup is
npx fallow agent install, as Fallow for coding agents shows. It finds a launcher that works, and writes the entry for Claude Code, Codex and Cursor. Use the steps below to register the server by hand.
Steps
-
Add the server to the config of your client. For Claude Code, create
.mcp.jsonin the project root:{ "mcpServers": { "fallow": { "type": "stdio", "command": "npx", "args": ["--no", "fallow-mcp"] } } }npx --no fallow-mcpstarts the launcher fromnode_modules/.binand downloads nothing. When fallow is a global install, use"command": "fallow-mcp"with noargs. -
Start the agent from the project root, and approve the server when the client asks.
Each other client starts the same command, but it reads the entry from its own file and format:
To register the server for all projects on your machine:
claude mcp add --scope user fallow -- fallow-mcpCreate .cursor/mcp.json in the project, or ~/.cursor/mcp.json for all projects:
{
"mcpServers": {
"fallow": {
"command": "npx",
"args": ["--no", "fallow-mcp"]
}
}
}Add the server to .codex/config.toml in the project, or to ~/.codex/config.toml. Codex reads the project file after you trust the project.
[mcp_servers.fallow]
command = "npx"
args = ["--no", "fallow-mcp"]Configure the client to start fallow-mcp as a stdio process in the project root.
Check the result
First check that the launcher starts. Run it with --version, and the output names the server version:
./node_modules/.bin/fallow-mcp --version
fallow-mcp 3.51.0
Then, in the agent, ask for the tools of the fallow server. The list has audit, analyze, trace_export and the other tools in the Tools table.
If it fails
- The server does not start, with
ENOENT. The client cannot findfallow-mcp. With a project install, usenpx --no fallow-mcp, and start the agent from the project root. - A call times out on a large project. Set
FALLOW_TIMEOUT_SECSin the environment of the server. The default is 120 seconds. A client that supports tasks gets 30 minutes for the long tools. - A call returns
FALLOW_MCP_SUBPROCESS_OUTPUT_LIMIT. The result is larger than the response cap. See Errors and limits.
The hosted MCP server of Fallow Cloud is a separate product. It reads production data and needs no local install. See Hosted MCP.
Reference
Errors and limits
- A tool returns the same JSON as the matching CLI command with
--format json. An exit code 1 of the CLI, for example a failed gate, is a normal result. - An error returns JSON with
error,messageandexit_code, and often acode, for exampleFALLOW_MCP_API_TIMEOUTorFALLOW_MCP_SUBPROCESS_TIMEOUT. - The response cap is 1,000,000 bytes. A larger result returns
isError: truewith the codeFALLOW_MCP_SUBPROCESS_OUTPUT_LIMIT. Itsnarrowarray lists the parameters that make the result smaller, for exampleissue_typesortop. Call the tool again with one of them. - The
max_output_bytesparameter of a call can only lower the cap.FALLOW_MCP_MAX_OUTPUT_BYTESsets it for the server, up to 16 MiB. - Claude Code saves a text result over 50,000 characters to a file, and the agent reads that file. The tools with large results (
analyze,audit,check_architecture,check_changed,check_health,check_runtime_coverage,code_execute,find_dupes,fix_preview,get_blast_radius,get_cleanup_candidates,get_hot_paths,get_importance,get_token_blast_radius,impact_all,project_info,security_candidatesandtrace_file) raise this limit to 200,000 characters with_meta["anthropic/maxResultSizeChars"]. A larger result still goes to a file. To keep a result small, pass a filter such asissue_typesortop. - Only
fix_applychanges source files. Callfix_previewfirst. Theworkspaceparameter of both tools narrows the fixes as--workspacedoes. A workspace that does not exist is an error. A client with form elicitation asks the user to confirm before the write. See Fix confirmation. - A
code_executesnippet ends at most 4 seconds after itstimeout_ms, also inside one long call of a JavaScript built-in, or when the client cancels the call. The error iscode mode execution timed out. - An error of
code_executethat ends withrestart the MCP servermeans that the server cannot start the process that runs the snippets, for example after an update of the fallow binary. Restart the MCP server in your client. - The
get_cloud_*tools, andinspect_targetwithcloud: true, read production data from Fallow Cloud. They send the repository name, and for some tools the file paths and function names that you select. All other tools work only on the local project.
Run-level warnings
A tool that the CLI handles runs fallow with --quiet, so the caller does not get the lines that the CLI writes to stderr. The server writes the same facts as plain sentences into the root warnings[] array of the response:
| Sentence | Source in the response |
|---|---|
| A baseline that matched fewer entries than it holds, or that the run did not judge because the scope was only part of the project. | baseline_staleness |
| A baseline file that the command cannot read as its own format. When the file names the command that saved it, the sentence names that command. Pass a different path, and do not save the baseline again. | baseline_staleness.unrecognised_format, baseline_staleness.saved_by |
Each gate that reported fail or warn, with the values that the gate compared. | gate_outcomes |
| All diagnostics that made the analysis less complete, in one sentence. | workspace_diagnostics |
| All requested rules that are off, in one sentence. A zero count for these rules does not mean that the check passed. | workspace_diagnostics |
client-server-leak with no "use client" file to start from. A zero leak count then does not mean that no secret reaches client code. | workspace_diagnostics |
| The requests that the run did not apply. A request that changes the scope makes the report wider than you asked for. An output file that the run did not write gets its own sentence, and the report stays complete. | request_outcomes |
| A request that the run applied to an empty scope. The report has no findings because the run analyzed nothing, not because the code is clean. | request_outcomes |
Read the sentence about an unrecognised baseline format first, because such a file suppresses nothing. The staleness sentence also says that the run would fail the --fail-on-stale-baseline gate. audit leaves this part out, because its stale-baseline gate does not apply to the baselines that it loads.
- The tools that the server runs in its own process add the same sentences, so a tool gives the same answer on both routes.
- The sentences do not move or remove a field.
gate_outcomes,baseline_staleness,workspace_diagnosticsandrequest_outcomesstay in their places. - A sentence is added to a
warningsarray that the command wrote. A run with nothing to report adds no sentence. - A warning never makes the call an error, and an error stays an error.
get_hot_paths,get_blast_radius,get_importance,get_cleanup_candidatesandget_token_blast_radiusalways return awarningsarray, also when it is empty.
Scope from the environment
FALLOW_DIFF_FILE (a path to a unified diff) and FALLOW_CHANGED_SINCE (a git ref) in the environment of the server scope the analysis tools to the change. When the server cannot use one of them, the call does not fail. The tool then reports on the full project, and its request_outcomes has a not-applied entry with the reason. audit and decision_surface read FALLOW_CHANGED_SINCE as their base ref, so a ref that does not resolve fails these calls.
Environment variables
The server reads these variables. Set them in the env object of the server entry of your client:
| Variable | Default | Description |
|---|---|---|
FALLOW_BIN | Path to the fallow binary that the fallow-mcp server runs. When it is unset, the server runs the fallow file next to its own executable, else fallow on PATH. | |
FALLOW_TIMEOUT_SECS | 120 | MCP server: per-tool-call CLI subprocess timeout in seconds (default 120, or 1800 for a call that runs as an MCP task). Raise for long runs like production coverage on large dumps. |
FALLOW_MCP_MAX_OUTPUT_BYTES | 1000000 | MCP server: response cap in bytes for each tool call (default 1000000, highest 16777216). A larger response is refused with FALLOW_MCP_SUBPROCESS_OUTPUT_LIMIT and a narrow list of parameters. The max_output_bytes parameter of a call can only lower this cap. |
FALLOW_DIFF_FILE | MCP server: path to a unified diff that scopes all findings by changed line. | |
FALLOW_CHANGED_SINCE | MCP server: git ref that scopes file discovery for analysis tools. | |
FALLOW_MCP_WARM_SESSION | on | MCP server: set to 0, false, off or no to stop typed tool calls from keeping parsed modules in memory between calls (default on). |
FALLOW_MCP_SKILLS | on | MCP server: set to 0, false, off or no to stop serving the fallow and fallow-setup skills through the MCP skills extension (default on). fallow agent install writes off into the MCP entry when it also installs the skills on disk. |
Environment variables lists the variables of the other parts of fallow.
Tools
The server has these tools. The fallow://tools resource gives the same list with the key parameters of each tool.
Each CLI equivalent runs with --format json --quiet.
| Tool | Description | CLI equivalent |
|---|---|---|
code_execute | Run a bounded read-only JavaScript snippet that composes fallow's analysis tools inside a sandbox (Code Mode meta-tool, not a plain analysis call). | none |
analyze | Full dead-code analysis: unused files, exports, types, dependencies, circular dependencies, and boundary violations, each with a stable finding_id. | fallow dead-code |
check_changed | Incremental dead-code analysis scoped to files changed since a git ref (ideal for PR review); findings keep their finding_id. | fallow dead-code --changed-since <ref> |
check_architecture | Architecture check: import cycles, boundary violations, and rule-pack policy violations in the architecture envelope, each with a stable finding_id. | fallow architecture |
security_candidates | Unverified local security candidates (tainted sinks) for downstream agent verification. | fallow security |
find_similar_code | Find unverified semantically similar function candidates with the exact pinned local model. | fallow similar-code |
inspect_similar_code | Inspect one exact candidate snapshot without rerunning retrieval or global ranking. | fallow similar-code inspect <candidate-id> --candidates <report.json> |
mutation_plan | Static mutation plan for changed code: mutant ids, operators, dispositions, and static test files; runs no tests. | fallow mutation --plan |
mutation_inspect | Inspect one mutant of a saved mutation report (default: the last run report), with a stale status when its source changed; runs no tests. | fallow mutation inspect <mutant-id> [--report <report.json>] |
mutation_tasks | The open tasks of a saved mutation report (default: the last run report) as one batch: each survived or uncovered mutant with its source lines before and after the change; runs no tests. | fallow mutation tasks [--report <report.json>] |
inspect_target | One evidence bundle for a file or exported symbol: trace, dead-code actions, duplication, complexity, and security candidates. | fallow inspect |
guard | Report the architecture rules that apply to given files before editing them: boundary zone, allowed import zones, forbidden calls, and rule-pack policies. | fallow guard <file> |
find_dupes | Code duplication detection with clone groups and refactoring suggestions. | fallow dupes |
check_health | Complexity, styling health, hotspots, ownership, refactoring targets, coverage gaps, and CSS/CSS-in-JS candidates. | fallow health |
check_runtime_coverage | Merge V8 or Istanbul runtime coverage into the health report (hot paths, cold paths, verdicts). | fallow health --runtime-coverage <path> |
get_hot_paths | Production hot paths from runtime coverage, sorted by invocation volume. | fallow health --runtime-coverage <path> |
get_blast_radius | Blast-radius context (caller counts, risk bands) from runtime coverage; augments review only, never gates safe_to_delete (three-state tracking issues that verdict). | fallow health --runtime-coverage <path> |
get_importance | Production-importance scores (0-100) combining invocations, complexity, and ownership; augments review only, never gates safe_to_delete (three-state tracking issues that verdict). | fallow health --runtime-coverage <path> |
get_cleanup_candidates | Cleanup candidates with safe_to_delete, review_required, and low_traffic verdicts from runtime coverage. | fallow health --runtime-coverage <path> |
get_cloud_runtime_context | Runtime coverage pulled from Fallow Cloud for a repository, merged into the same runtime_coverage block the local runtime-coverage tools return. | fallow coverage analyze --cloud --repo <owner/repo> |
get_cloud_review_packet | Production facts of a few changed files or functions, read from fallow cloud without the full runtime-context pull. | fallow coverage review-packet --repo <owner/repo> --file <path> |
get_cloud_deployment_changes | How production behavior changed between two deployments, read from the fallow cloud change report. | fallow coverage deployment-changes --repo <owner/repo> --sha <sha> |
get_token_blast_radius | Design-token blast radius for Tailwind v4 @theme tokens and CSS-in-JS defineVars/createTheme-family token definitions: per token, a consumer_count (static lower bound) and a capped located consumers[] sample tagged theme-var/css-var/utility/apply (Tailwind), js-member (CSS-in-JS member access), or js-call (StyleX theme-group and Panda token calls); descriptive context for sizing a token change, never a deletion gate. | fallow health --css |
audit | Combined dead-code, complexity, duplication, styling, and diff-risk audit for changed files with a pass/warn/fail verdict. The diff-risk rules are weakened-tests, added-suppression, test-only-branch, diverged-clone-sibling, and added-dependency. | fallow audit |
decision_surface | Surface the few consequential structural decisions a change embeds (coupling, public API, dependency), each as a judgment question with the routed expert; ranked, capped, and signal_id-anchored. | fallow decision-surface |
fallow_explain | Explain one issue type (rationale, examples, fix guidance) without running an analysis. | fallow explain <issue-type> |
submit_feedback | File feedback about Fallow as a public GitHub issue; previews by default, creates it only with submit and the preview digest. | fallow feedback <message> |
fix_preview | Dry-run auto-fix preview; shows what would change without modifying files. | fallow fix --dry-run |
fix_apply | Apply auto-fixes: removes unused exports, dependencies, and enum members (mutates files). | fallow fix --yes |
project_info | Project metadata: active framework plugins, discovered files, entry points, and boundary zones. | fallow list --files --entry-points --plugins |
recommend | Recommend a project-tailored config from framework/workspace/tooling detection: a loader-validated proposed_config and three-valued auto/default/taste decisions for cold-start onboarding. | fallow recommend |
list_boundaries | List architecture boundary zones and access rules. | fallow list --boundaries |
feature_flags | Detect feature flag patterns (environment variables, SDK calls, config objects). | fallow flags |
list_suppressions | List active fallow-ignore suppression markers grouped per file (line, kind, level, reason, and a stale cross-reference); a read-only governance inventory that always exits 0. | fallow suppressions |
impact | Read the local Fallow Impact value-tracking report (per-project history in the user config dir, never in the repo; local-dev only). | fallow impact |
impact_all | Roll every tracked fallow project on this machine into one cross-repo value report (hashed keys plus basename labels, never paths; local-dev only). | fallow impact --all |
trace_export | Trace why an export is used or unused, including re-export chains and entry-point status. | fallow dead-code --trace <file:export> |
trace_symbol | Trace an exact TypeScript symbol with checker-backed references, namespace identity, aliases, and re-export hops. Root trace fields preserve syntactic context; treat semantic.references, semantic.status, and semantic.identity as the authoritative exact evidence. The proof covers only the lane named by semantic.target.namespace, so a root trace that lists a reference the proof does not is wider evidence rather than stale. This is project-wide evidence for Fallow decisions, not a compiler-diagnostic or lint-rule surface. | fallow dead-code --type-aware --trace <file:export> |
symbol_impact | Return advisory exact-symbol consumers, affected files, and targeted tests for a TypeScript export or exported class method; select either export_name, or both class_name and member_name; not a substitute for tsc or Oxlint. | fallow dead-code --type-aware --symbol-impact <file:export-or-class.member> |
trace_file | Trace all module-graph edges for a file (imports, exports, importers, re-exports). | fallow dead-code --trace-file <file> |
trace_import_path | Trace the shortest import path between two modules, hop by hop. | fallow trace --path <from> <to> |
trace_error | Resolve a runtime stack trace's frames against the project graph. | fallow trace-error - |
impact_closure | Trace the transitive affected-but-not-in-diff set and coordination gaps for one file. | fallow dead-code --impact-closure <path> |
trace_dependency | Trace where a dependency is imported, whether scripts or CI use it, and how the code uses each imported name. | fallow dead-code --trace-dependency <package> |
trace_clone | Deep-dive a duplicate-code clone group by location or fingerprint. | fallow dupes --trace <file:line> |
Tool parameters
Both tools also take root (the project root) and config (a path to a config file). These parameters of audit match the options of fallow audit:
| Parameter | Content |
|---|---|
base | The git ref to compare against, for example main. Without it, the base is the merge base with the upstream branch or the remote default branch. FALLOW_AUDIT_BASE in the server environment sets it. See Base ref. |
gate | The findings that count for the verdict: new-only or all. Without it, audit.gate of the config applies (default new-only). See Gate values. |
worsened | The effect of an inherited complexity finding whose value grew: warn (default), error or off. Without it, audit.worsened applies. See Worsened complexity findings. |
only | Run only these parts of the audit: dead-code, architecture, dupes, health. It replaces the selection of the config. You cannot use it with skip. |
skip | Leave out these parts, with the values of only. The response has no block for a skipped part, and summary marks it, for example dead_code_skipped. A baseline for a skipped part is an error. |
css_deep | true or false turns the deep styling analysis on or off. Without it, audit.cssDeep applies (default on). It has no effect when the styling analysis is off. |
These parameters of mutation_plan match the options of fallow mutation --plan:
| Parameter | Content |
|---|---|
changed_since | The base ref of the changed code. Without it, fallow finds the base as for audit. |
all | true plans each source file, not only the changed code. |
paths | Plan only these files or directories, relative to the root. |
max_mutants | The maximum number of mutants in the plan. The other mutants are pending. |
mutants_per_line | At most this number of mutants on one line (1 or more). The other mutants are pending with the reason sampled-out. Without it, mutation.mutantsPerLine applies, else no limit. |
function_scope | true plans each mutant of each function that holds a changed line. Without it, mutation.functionScope applies, else only the changed lines. |
operators | The operator names in kebab case, for example relational-operator. Without it, mutation.operators applies, else the default set. An opt-in operator, such as block-statement, runs only when you name it. |
fallow flags gives the parameters of feature_flags.
Runtime source-map confidence
The runtime context from Fallow Cloud can tell how well a source map connects a function to its original source. get_cloud_runtime_context copies each row field of the cloud into the cloud_context of the finding or hot path. When the capabilities array of the response has function_identity_v2, a row can have two of these fields:
resolution_status: how the cloud found the original position of the function.mapping_quality: how much you can trust the file path and the line number.
The fields tell you how much to trust the location. They do not tell you if the function ran.
A response with a list of functions has the same two fields with the names resolutionStatus and mappingQuality.
resolution_status and mapping_quality | Meaning | What to do |
|---|---|---|
resolved and high | The source map gives the original source of the generated position. | Trust the file path and the line number. Edit the original source. |
fallback and medium | A source map exists, but it does not cover this generated position. | Use the file-level signal as an estimate. Before a precise edit, ask the developer to build with denser source maps. |
unresolved and low | Nobody uploaded a source map for this bundle and commit. | Before you act on a file-level coverage signal, ask the operator to upload the source map. |
null and null | The row has no confidence data. | Read the row as a row without confidence data. Do not lower it to low without other evidence. |
Other values of resolution_status can occur, for example native with high. Let mapping_quality decide what you do.
Resources
| Resource | Content |
|---|---|
fallow://tools | MCP tool manifest: name, kind, one-line description, nearest CLI fallback, key params, license, and read-only flag for every tool. |
fallow://issue-types | Every issue type with its command, category, config key, zero-config default severity, opt-in flag, fixable flag, docs URL, and explain resource URI. |
fallow://explain | Index of every explainable issue type with its one-line summary and the fallow://explain/{issue_type} URI to read. |
fallow://task-matrix | Agent task-to-command matrix: which read-only fallow command to run before deleting, refactoring, committing, or scoping work. |
fallow://schema/config | JSON Schema of the fallow config file (same document as fallow config-schema). |
fallow://schema/plugin | JSON Schema of a user-authored external plugin (same document as fallow plugin-schema). |
fallow://schema/rule-pack | JSON Schema of a declarative rule pack (same document as fallow rule-pack-schema). |
fallow://schema/similar-code-snapshot | JSON Schema of the inspect_similar_code snapshot object: the bounded candidate handoff find_similar_code returns, passed back unchanged. |
fallow://tools/{name} | Per-flag detail for one MCP tool (payload shapes, unit vocabularies, suppression placements) kept out of its tools/list description; name is the wire tool name. Not every tool has a guide. |
fallow://explain/{issue_type} | Explain document for one issue type (same payload as fallow explain <issue-type> --format json): name, summary, rationale, example, fix guidance, docs URL. issue_type accepts the bare id (unused-export), the namespaced id (fallow/unused-export), or the CLI filter spelling; see fallow://explain for the index. |
Skills
The server also serves the fallow and fallow-setup skills through the MCP skills extension. A client that supports the extension loads the skill of the same version as the server, with no separate install.
| Skill | URI | Use |
|---|---|---|
fallow | skill://fallow/SKILL.md | Analysis, cleanup, review and the other fallow workflows. |
fallow-setup | skill://fallow-setup/SKILL.md | Set up code-quality tooling for a project. |
In Claude Code 2.1.331 or later, the skills show as <server>:fallow and <server>:fallow-setup, where <server> is the name of the server entry.
fallow agent install also writes these skills to disk. So it sets FALLOW_MCP_SKILLS=off in the env object of the server entry that it registers, and the client shows each skill once. To stop the server from serving the skills in another setup, set FALLOW_MCP_SKILLS=off yourself.
Tasks
A long tool call can run as a task of the MCP tasks extension (io.modelcontextprotocol/tasks). The server then answers the call at once with a task handle. The client asks tasks/get for the status and the result, and can stop the run with tasks/cancel.
The server returns a task only when the request declares the extension in its _meta client capabilities. Claude Code does this on a 2026-07-28 connection. Other requests get the result as before.
| Tool | Runs as a task | Poll interval |
|---|---|---|
audit | Always | 2 seconds |
mutation_plan | Always | 2 seconds |
find_similar_code | Always | 10 seconds |
analyze | With type-aware analysis: from type_aware, type_aware_projects or type_aware_require, or from FALLOW_TYPE_AWARE or typeAware.enabled when the parameters leave the choice open | 10 seconds |
- A task run has a deadline of 30 minutes.
FALLOW_TIMEOUT_SECSstill sets the deadline when you set it. - The status message names the tool and the time that the run took so far.
- A finished result stays readable for at least one hour.
- The server keeps its tasks in memory. When the server stops, it stops its running tasks, and a new server does not know the old task IDs.
Fix confirmation
When the client declares form elicitation, fix_apply asks the user to confirm before it writes. The server runs the dry run first. The form shows the number of fixes, the number of files, the fixes per type and the fixes that the run skips. The tool writes only after a yes.
- On a
2026-07-28connection, the call returns aninput_requiredresult with the form. The client shows the form and calls the tool again with the answer. Claude Code does this. - On an earlier protocol revision, the server sends
elicitation/createduring the call and waits at most 10 minutes for the answer. - When the user does not confirm, no file changes. The result has
applied: falseand aconfirmationvalue:
confirmation | Meaning |
|---|---|
declined | The user declined, or cleared the apply box. |
cancelled | The form closed without an answer. |
timed_out | No answer came in 10 minutes. |
failed | The client could not show the form. |
plan_changed | The project changed while the form was open. Call fix_apply again to confirm the new plan. |
- A session with no person to answer, such as
claude -por an Agent SDK run, cancels the form at once. The call does not wait. To answer the form from a script, use anElicitationhook that returnsacceptwith{"apply": true}. - A client without form elicitation applies the fixes with no question, as before.
- A plan with no fixes applies with no question.