Skip to content
Fallow home
All docs pages

Docs home

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"| cloud

Only 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. The fallow npm package contains the fallow-mcp launcher. cargo install fallow-mcp and 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

  1. Add the server to the config of your client. For Claude Code, create .mcp.json in the project root:

    {
      "mcpServers": {
        "fallow": {
          "type": "stdio",
          "command": "npx",
          "args": ["--no", "fallow-mcp"]
        }
      }
    }

    npx --no fallow-mcp starts the launcher from node_modules/.bin and downloads nothing. When fallow is a global install, use "command": "fallow-mcp" with no args.

  2. 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-mcp

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 find fallow-mcp. With a project install, use npx --no fallow-mcp, and start the agent from the project root.
  • A call times out on a large project. Set FALLOW_TIMEOUT_SECS in 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, message and exit_code, and often a code, for example FALLOW_MCP_API_TIMEOUT or FALLOW_MCP_SUBPROCESS_TIMEOUT.
  • The response cap is 1,000,000 bytes. A larger result returns isError: true with the code FALLOW_MCP_SUBPROCESS_OUTPUT_LIMIT. Its narrow array lists the parameters that make the result smaller, for example issue_types or top. Call the tool again with one of them.
  • The max_output_bytes parameter of a call can only lower the cap. FALLOW_MCP_MAX_OUTPUT_BYTES sets 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_candidates and trace_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 as issue_types or top.
  • Only fix_apply changes source files. Call fix_preview first. The workspace parameter of both tools narrows the fixes as --workspace does. 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_execute snippet ends at most 4 seconds after its timeout_ms, also inside one long call of a JavaScript built-in, or when the client cancels the call. The error is code mode execution timed out.
  • An error of code_execute that ends with restart the MCP server means 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, and inspect_target with cloud: 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:

SentenceSource 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_diagnostics and request_outcomes stay in their places.
  • A sentence is added to a warnings array 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_candidates and get_token_blast_radius always return a warnings array, 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:

VariableDefaultDescription
FALLOW_BINPath 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_SECS120MCP 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_BYTES1000000MCP 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_FILEMCP server: path to a unified diff that scopes all findings by changed line.
FALLOW_CHANGED_SINCEMCP server: git ref that scopes file discovery for analysis tools.
FALLOW_MCP_WARM_SESSIONonMCP 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_SKILLSonMCP 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.

ToolDescriptionCLI equivalent
code_executeRun 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
analyzeFull dead-code analysis: unused files, exports, types, dependencies, circular dependencies, and boundary violations, each with a stable finding_id.fallow dead-code
check_changedIncremental 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_architectureArchitecture check: import cycles, boundary violations, and rule-pack policy violations in the architecture envelope, each with a stable finding_id.fallow architecture
security_candidatesUnverified local security candidates (tainted sinks) for downstream agent verification.fallow security
find_similar_codeFind unverified semantically similar function candidates with the exact pinned local model.fallow similar-code
inspect_similar_codeInspect one exact candidate snapshot without rerunning retrieval or global ranking.fallow similar-code inspect <candidate-id> --candidates <report.json>
mutation_planStatic mutation plan for changed code: mutant ids, operators, dispositions, and static test files; runs no tests.fallow mutation --plan
mutation_inspectInspect 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_tasksThe 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_targetOne evidence bundle for a file or exported symbol: trace, dead-code actions, duplication, complexity, and security candidates.fallow inspect
guardReport 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_dupesCode duplication detection with clone groups and refactoring suggestions.fallow dupes
check_healthComplexity, styling health, hotspots, ownership, refactoring targets, coverage gaps, and CSS/CSS-in-JS candidates.fallow health
check_runtime_coverageMerge V8 or Istanbul runtime coverage into the health report (hot paths, cold paths, verdicts).fallow health --runtime-coverage <path>
get_hot_pathsProduction hot paths from runtime coverage, sorted by invocation volume.fallow health --runtime-coverage <path>
get_blast_radiusBlast-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_importanceProduction-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_candidatesCleanup candidates with safe_to_delete, review_required, and low_traffic verdicts from runtime coverage.fallow health --runtime-coverage <path>
get_cloud_runtime_contextRuntime 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_packetProduction 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_changesHow 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_radiusDesign-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
auditCombined 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_surfaceSurface 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_explainExplain one issue type (rationale, examples, fix guidance) without running an analysis.fallow explain <issue-type>
submit_feedbackFile feedback about Fallow as a public GitHub issue; previews by default, creates it only with submit and the preview digest.fallow feedback <message>
fix_previewDry-run auto-fix preview; shows what would change without modifying files.fallow fix --dry-run
fix_applyApply auto-fixes: removes unused exports, dependencies, and enum members (mutates files).fallow fix --yes
project_infoProject metadata: active framework plugins, discovered files, entry points, and boundary zones.fallow list --files --entry-points --plugins
recommendRecommend 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_boundariesList architecture boundary zones and access rules.fallow list --boundaries
feature_flagsDetect feature flag patterns (environment variables, SDK calls, config objects).fallow flags
list_suppressionsList 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
impactRead 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_allRoll 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_exportTrace why an export is used or unused, including re-export chains and entry-point status.fallow dead-code --trace <file:export>
trace_symbolTrace 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_impactReturn 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_fileTrace all module-graph edges for a file (imports, exports, importers, re-exports).fallow dead-code --trace-file <file>
trace_import_pathTrace the shortest import path between two modules, hop by hop.fallow trace --path <from> <to>
trace_errorResolve a runtime stack trace's frames against the project graph.fallow trace-error -
impact_closureTrace the transitive affected-but-not-in-diff set and coordination gaps for one file.fallow dead-code --impact-closure <path>
trace_dependencyTrace 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_cloneDeep-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:

ParameterContent
baseThe 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.
gateThe findings that count for the verdict: new-only or all. Without it, audit.gate of the config applies (default new-only). See Gate values.
worsenedThe effect of an inherited complexity finding whose value grew: warn (default), error or off. Without it, audit.worsened applies. See Worsened complexity findings.
onlyRun only these parts of the audit: dead-code, architecture, dupes, health. It replaces the selection of the config. You cannot use it with skip.
skipLeave 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_deeptrue 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:

ParameterContent
changed_sinceThe base ref of the changed code. Without it, fallow finds the base as for audit.
alltrue plans each source file, not only the changed code.
pathsPlan only these files or directories, relative to the root.
max_mutantsThe maximum number of mutants in the plan. The other mutants are pending.
mutants_per_lineAt 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_scopetrue plans each mutant of each function that holds a changed line. Without it, mutation.functionScope applies, else only the changed lines.
operatorsThe 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_qualityMeaningWhat to do
resolved and highThe source map gives the original source of the generated position.Trust the file path and the line number. Edit the original source.
fallback and mediumA 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 lowNobody 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 nullThe 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

ResourceContent
fallow://toolsMCP tool manifest: name, kind, one-line description, nearest CLI fallback, key params, license, and read-only flag for every tool.
fallow://issue-typesEvery issue type with its command, category, config key, zero-config default severity, opt-in flag, fixable flag, docs URL, and explain resource URI.
fallow://explainIndex of every explainable issue type with its one-line summary and the fallow://explain/{issue_type} URI to read.
fallow://task-matrixAgent task-to-command matrix: which read-only fallow command to run before deleting, refactoring, committing, or scoping work.
fallow://schema/configJSON Schema of the fallow config file (same document as fallow config-schema).
fallow://schema/pluginJSON Schema of a user-authored external plugin (same document as fallow plugin-schema).
fallow://schema/rule-packJSON Schema of a declarative rule pack (same document as fallow rule-pack-schema).
fallow://schema/similar-code-snapshotJSON 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.

SkillURIUse
fallowskill://fallow/SKILL.mdAnalysis, cleanup, review and the other fallow workflows.
fallow-setupskill://fallow-setup/SKILL.mdSet 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.

ToolRuns as a taskPoll interval
auditAlways2 seconds
mutation_planAlways2 seconds
find_similar_codeAlways10 seconds
analyzeWith 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 open10 seconds
  • A task run has a deadline of 30 minutes. FALLOW_TIMEOUT_SECS still 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-28 connection, the call returns an input_required result 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/create during the call and waits at most 10 minutes for the answer.
  • When the user does not confirm, no file changes. The result has applied: false and a confirmation value:
confirmationMeaning
declinedThe user declined, or cleared the apply box.
cancelledThe form closed without an answer.
timed_outNo answer came in 10 minutes.
failedThe client could not show the form.
plan_changedThe 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 -p or an Agent SDK run, cancels the form at once. The call does not wait. To answer the form from a script, use an Elicitation hook that returns accept with {"apply": true}.
  • A client without form elicitation applies the fixes with no question, as before.
  • A plan with no fixes applies with no question.