sem
Entity-level diff, impact, call-graph and blame queries over a local Git repo for coding agents
Static impact analysis of Salesforce metadata changes, run over a git diff before you deploy
By Vishal Parashar (individual) TypeScript Local · stdio Developer toolsCRM and sales
26 popularity score ★ 12 ↓ 38/wk
Opens the app, which asks before it adds the server.
claude mcp add sf-preflight -- npx -y sf-preflight mcp{
"mcpServers": {
"sf-preflight": {
"command": "npx",
"args": [
"-y",
"sf-preflight",
"mcp"
]
}
}
}{
"mcpServers": {
"sf-preflight": {
"command": "npx",
"args": [
"-y",
"sf-preflight",
"mcp"
]
}
}
}{
"servers": {
"sf-preflight": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"sf-preflight",
"mcp"
]
}
}
}[mcp_servers.sf-preflight]
command = "npx"
args = ["-y", "sf-preflight", "mcp"]gemini mcp add --scope user sf-preflight npx -- -y sf-preflight mcpPREFLIGHT_CACHE_DIR |
Optional: Where parsed Apex results are cached (default ~/.cache/sf-preflight). |
|---|---|
PREFLIGHT_NO_CACHE |
Optional: Set to 1 to turn the parse cache off. |
PREFLIGHT_JOBS |
Optional: Set to 1 to parse on a single thread instead of worker threads. |
sf-preflight is a command-line tool for Salesforce DX projects that also ships a stdio MCP server, started with `preflight mcp`. It takes a git diff of SFDX source and traces what the change would trigger in the org's order of execution: flows, Apex triggers, validation rules, roll-up summaries, sharing and permissions, Agentforce actions, OmniStudio components and more. A coding agent can call it after editing metadata to see collisions, recursion cycles and access changes before anything is committed or deployed.
The server works on the local project and git history. With no arguments, `analyze_change` compares the working tree, untracked files included, against `HEAD`. Other tools list what runs when a given object is saved, find every place a field is used, describe an Agentforce agent, draft a partial rollback plan for a commit, and return Apex test classes as code. Two tools that the README mentions but docs/MCP.md leaves out of its table, `suggest_fixes` and `check_fix`, return proposed diffs for findings and re-run the analysis on edits the agent proposes, without saving them.
The source of v0.13.0 (src/mcp.ts) registers eight tools, all marked read-only. It also sets caps the docs do not list: `analyze_change` follows the cascade 4 levels deep by default and at most 8 via `max_depth`; `generate_tests` uses 200 records per bulk test by default, up to 10000 via `bulk_size`; `check_fix` accepts 1 to 20 file edits per call. The project describes itself as early (0.x); org context is in beta.
| Runtime | Node.js 22+ |
|---|
Node.js 22.13 or newer (the docs launch it with npx), git on PATH, and a Salesforce DX project in a git repository. The server analyzes the directory the client starts it in, or the one given with `--root`. The optional `org` argument needs the Salesforce CLI (`sf`) installed and an org already authorized with `sf org login`.
Status is early (0.x), and org context is marked beta. It analyzes source files, so automation that exists only in the org is missed unless the beta `org` argument is used. `project_dir` must stay inside the server root; tool calls outside it are refused. Cascade depth is capped at 8 (default 4). Tools never write files: generated tests, fixes and rollback plans come back as text for the agent or user to apply. docs/MCP.md says the server never contacts an org, but at v0.13.0 `analyze_change` accepts an `org` alias and then queries that org read-only through the sf CLI.
Salesforce developers and admins who keep metadata in an SFDX git repository and let coding agents such as Claude Code, Cursor or Codex edit flows, Apex or permissions, and want the agent to check the knock-on effects before committing. It runs locally and needs no org credentials for its main analysis. It is not a tool for managing a live org: it cannot deploy, query records or change org data, so teams wanting that need a different server. Projects not kept in git get little from it, since its analysis is built on diffs.
analyze_changesuggest_fixescheck_fixexplain_save_orderexplain_agentfind_field_referencesgenerate_testsplan_rollback