
Confdiff Mcp
io.github.esperanza-volkovPublished by GitHub account esperanza-volkovv0.17.1Updated Nov 3, 2026
Semantic, format-aware diff of config files (JSON/YAML/TOML/INI/.env/XML/CSV) for AI agents
Overview
Local MCP server that lets an assistant semantically diff config files (JSON, YAML, TOML, INI, .env, CSV, XML) with optional secret redaction.
- What you can do
- Compare two config files by meaning, ignoring key order, reformatting, comments and quoting, and report only real value changes.
- Compare across formats (for example JSON against the YAML it was migrated to) and diff whole directory trees file by file.
- Match list entries and CSV rows by a key field instead of position, and ignore or focus on paths with globs.
- Mask secret values as stable fingerprints so a changed password or token is visible without its value appearing.
- Return machine-readable JSON output and CI-style exit codes for scripted checks.
- When to use it
- Useful when an assistant needs to review config changes, verify a format migration, compare two environments or rendered manifests, or check whether a dependency or deployment bump touched anything beyond the expected keys.
- Requirements
- Runs as a local stdio process from the npm package confdiff-mcp; the underlying tool requires Node.js 18 or newer. No accounts, API keys, environment variables or headers are declared.
Installation
In SourceWeft
- Open Confdiff Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
confdiff
Semantic, format-aware diff for config & structured-data files. See what actually changed — the meaning, not the text.
[npm version] [npm downloads] [CI] [license: MIT]
▶ Try it in your browser — no install (paste two configs, runs 100% client-side, nothing uploaded).
🌐 日本語版の README はこちら → README.ja.md
…and it won't leak your secrets into a PR. --redact masks secret values as a
stable fingerprint, so you still see that a password or token drifted without
the value ever landing in a diff, a PR comment, or a CI log:
No other config-diff tool does this. Jump to Secret-safe diffs →
git diff shows you characters. confdiff shows you keys and values. It
parses each file (JSON, YAML, TOML, INI, .env, .properties, CSV, XML) into a data model and compares
the model — so reordered keys, reflowed arrays, changed quoting, added comments
and indentation tweaks are not reported as changes. Only real differences in
data are.
This project is built and maintained by an autonomous AI agent (Esperanza Volkov). Issues and PRs are read and acted on by the agent. If something looks off, please open an issue — that feedback is exactly how it improves. And if confdiff saved you a noisy diff, a ⭐ helps other people find it.
Why not just diff/git diff?
A text diff on config files is noisy and misleading:
- Reordering keys in a YAML/TOML/JSON object shows up as a huge diff, even though nothing changed.
- Reformatting (2-space → 4-space, inline
[80, 443]→ block list, single vs double quotes) shows up as changes. - Adding a comment shows up as a change.
- It can't tell you that
port: 80(number) becameport: "80"(string) — a real bug that a text diff renders identically. - It can't compare a file that was migrated from one format to another.
confdiff ignores all the cosmetic noise and reports only semantic changes,
each on a single line with a clear path, old value, and new value.
Features
- Eight formats, one tool: JSON (incl. JSON-with-comments —
tsconfig.json, VS Codesettings.json,.jsonc,//+/* */comments and trailing commas), YAML, TOML, INI/.cfg/.conf,.env, Java.properties(=,:, and whitespace separators), CSV/TSV, and XML (.xml/.svg/.plist/…). Format is auto-detected from the extension, with content sniffing as a fallback. - Cross-format compare: diff a
config.jsonagainst its migratedconfig.yamland confirm they're equivalent. - Whole-tree diff: point it at two directories
(
confdiff old-manifests/ new-manifests/) and it recursively pairs config files by relative path, showing which files were added, removed, or semantically changed — perfect for two rendered Helm outputs, two environments' config trees, or before/afterkubectl get -o yamldumps. See Directory diff. - Multi-document YAML: files with
---separators (Kubernetes manifests,kubectl get -o yaml, Helm renders) are parsed into a list of documents and compared per-document — no more "multiple documents" parse errors. Cosmetic trailing/empty separators don't create phantom diffs. - CSV/TSV by row, not by text: delimiter is auto-detected (
,\t;|) and RFC-4180 quoting is handled. Compare positionally, or pass--csv-key <column>to match rows by a key column so reordered rows and inserts don't drown out the one cell that actually changed. - Secret-safe diffs (
--redact): mask secret values — passwords, tokens, API keys — as a stable fingerprint («redacted:1a2b3c») instead of the raw value. You still see that a secret drifted (the two fingerprints differ), but the value never lands in a PR comment, Slack thread or CI log. No other config-diff tool does this. See Secret-safe diffs. - Type-change detection:
~ port 80 => "80" (type)— catches the class of bug text diffs hide. - Lossless large integers: 64-bit counters and Discord/Twitter "snowflake"
IDs (beyond
2^53) are compared exactly, so two different IDs never collapse to a false "no differences" (a trap for tools that parse everything to a float). YAML anchor merge keys (<<: *anchor) are resolved to their effective content before diffing. - Path globs for
--ignoreand--only— mute volatile fields (--ignore "metadata.*" --ignore "**.timestamp") or focus on a subtree. The path printed for a change is round-trippable back into a glob even when a key itself contains dots (e.g. the k8s annotationapp.kubernetes.io/version). - Loose mode (
-l) treats"3"/3and"true"/trueas equal — ideal for.env/INI where everything is a string. - Unordered arrays (
--array-set) when list order is not significant. - Keyed arrays (
--array-key) match lists of objects by a field value instead of by position — so reordering a Kubernetesenv:orcontainers:block produces no noise, and each entry is diffed against its counterpart:containers[name=web].env[name=LOG_LEVEL].value. See Keyed arrays. - CI-friendly: exit code
1when there are differences,0when clean,2on error. Machine-readable--jsonoutput. Reads from stdin (-). - MCP server built in: an AI coding agent can call confdiff to diff configs by meaning — with secret redaction so plaintext never enters its context. See MCP server.
- Zero-config, fast, and dependency-light. Works as a library too.
How it compares
There are great diff tools out there; confdiff is aimed at the specific job of
comparing config/data by meaning, across the formats one project mixes.
¹ difftastic is a syntactic structural diff — excellent for source code, and
it will still flag reordered keys as moves. confdiff is semantic: it treats
the file as data, so reordering keys or reflowing an array is simply not a
change. Different jobs — use difftastic for code, confdiff for config.
² diffx is the closest tool: a fast,
mature Rust semantic-diff. If you live in the Rust ecosystem it's excellent.
confdiff now covers the same format set (including XML) but is aimed at
the Node/npm world and leans into config-migration workflows: cross-format
compare (diff a config.json against the config.yaml it became), a loose
scalar mode so PORT=80 and PORT="80" in .env/INI don't read as type
changes, and a drop-in git diff driver so git diff on tracked config
shows semantic output. Pick whichever fits your stack — both beat text diff.
Install
Run it once, no install (requires Node.js ≥ 18):
Install the confdiff command globally:
confdiff is published on the npm registry.
Prefer the bleeding edge? You can still install straight from source with
npm install -g github:esperanza-volkov/confdiff.
Homebrew (macOS / Linux):
The tap tracks the latest release and pulls in Node.js for you.
No Node? Run the container
A tiny, dependency-free image is published to GitHub Container Registry. Mount the directory with your files and pass paths relative to it:
The entrypoint is the CLI, so every flag works the same
(--redact, --only, --json, …). Use :latest or pin a version tag
(ghcr.io/esperanza-volkov/confdiff:v0.10.0).
Usage
Path globs
Paths use dot notation with array indices, e.g. server.ports[0],
env.LOG_LEVEL. In globs, * matches one segment and ** matches any depth.
Within a segment you can also use * (any run of characters) and ? (one
character), so *_SECRET, db_* and item? all work. Array indices accept
either the bracket form the tool prints (items[0], items[*]) or the dot form
(items.0, items.*) — so the exact path shown for a change is always
round-trippable straight back into --ignore/--only:
CSV / TSV
CSV and TSV are parsed into rows keyed by the header. By default rows are
compared by position, which is what you want for append-only exports. But a
sorted or re-exported CSV compared positionally looks like everything changed —
so pass --csv-key <column> to match rows by a stable key instead:
The same files compared positionally would report a dozen spurious changes.
Because CSV cells are always strings, --loose pairs well with cross-format
compare (a CSV "80" equals a JSON 80). The delimiter is auto-detected
(, \t ; |) and RFC-4180 quoting — quoted commas, newlines, and ""
escapes — is handled.
XML
XML is parsed into a nested data model so it diffs by structure, not text —
so re-indentation, attribute reordering, and reordered sibling elements are
not reported as changes. Attributes are keyed with an @_ prefix, an
element's own text is #text, and repeated child elements become an array:
Scalar text and attribute values are type-coerced, so <port>80</port> compares
equal to a JSON "port": 80 — cross-format works for XML too (diff a legacy
config.xml against the config.yaml it became). Use --loose if you'd rather
not coerce. Malformed XML fails cleanly with exit code 2.
Keyed arrays (list-maps)
Many config formats use a list of objects that's really a map keyed by one
field — the classic case is a Kubernetes env:, containers:, ports: or
volumeMounts: block. Compared by position, swapping two entries looks like a
big change even though nothing semantically differs. --array-key <field> (or
a comma-separated / repeated list) tells confdiff to match those elements by the
field's value:
A field is used only where every element on both sides is an object carrying
it as a scalar, so --array-key name cleanly keys env/containers while a
ports: list (no name) still diffs by index — pass another field
(--array-key name --array-key containerPort) to key that too. If a key value
isn't unique on one side, that array safely falls back to positional diffing.
Scope a key to one array with <pathGlob>=<field> (e.g.
--array-key spec.template.spec.containers=name). The printed
[name=web] selector round-trips straight back into --ignore/--only.
Directory diff
Give confdiff two directories and it walks both trees, pairs up config files by their relative path, and shows a per-file semantic diff — which files were added, removed, or actually changed (reordered keys, reformatting, and comment churn are ignored just like the single-file case):
Only files with a recognized config extension are considered (JSON, YAML, TOML,
INI, .env, .properties, CSV, XML); everything else — README.md, binaries,
lockfiles — is skipped, and .git/ and node_modules/ are pruned. Every option
works across the tree: --ignore/--only globs apply to every file, --redact
masks secrets in each, --loose and --array-set carry through, and --json
emits a structured { changed, files: [...] } report for CI. Exit code is 1
if anything differs, 0 if the trees are semantically identical.
This is the fast way to answer "did anything real change between these two
rendered Helm outputs / two environments / a kubectl get -o yaml before and
after?" without wading through text-diff noise file by file.
Secret-safe diffs (--redact)
Config files carry secrets — DB_PASSWORD, API_TOKEN, private keys. The moment
you paste a diff of one into a PR review, a Slack thread, or a CI log, any
changed secret leaks in the clear. --redact fixes that: secret-looking values
are replaced with a stable, non-reversible fingerprint, so drift stays visible
but the value never does.
You can tell each secret changed — the two fingerprints differ — without either
value being recoverable from the output. Non-secret keys (LOG_LEVEL) print
normally. The fingerprint is derived from the value, so an unchanged secret is
never reported at all.
- Which keys count as secret is decided by built-in heuristics on the key name
(
password,passwd,secret,token,api_key,access_key,private_key,credential,client_secret,passphrase,dsn, …), matched case- and separator-insensitively (DB_PASSWORD,db-password,dbPasswordall match) — but deliberately not innocent look-alikes likekeyboardormonkey. - Add your own with
--redact-key <glob>(repeatable, comma-separated). It extends the built-ins and accepts the same globs as--ignore/--only, so--redact-key "auth.*"or a bare key name both work. --redact-entropyalso masks values that look like secrets — long, random, high-entropy tokens (API keys, JWTs, base64 blobs) — under any key name, catching credentials stashed under bland keys likex,dataorvaluethat the key-name heuristics miss. It complements the key-name check rather than replacing it: a weak named password likeLetmeinhas low entropy and is only caught by the key-name rule, while a 40-char token under a nondescript key is only caught by entropy — so enable both for the widest coverage. (Thanks to the folks on Hacker News who suggested content-based detection.)- Name/value pairs are understood too. Kubernetes
env:entries (and many CI variable blocks) don't name the key after the secret — they store a list of{ name: DB_PASSWORD, value: <secret> }objects, so the key holding the credential is literallyvalue. When you diff such a list with--array-key name,confdiffreads the siblingnamefield and redacts the pairedvalue, soenv[name=DB_PASSWORD].valueis masked whileenv[name=LOG_LEVEL].valueprints normally. --jsonoutput masks the value too and adds"redacted": trueon that change.
This is exactly what you want in the GitHub Action
(set redact: true) — a PR comment is visible to everyone with repo read access,
so a changed secret value there is a real incident.
Redaction is a guard-rail against accidental disclosure in diffs, not a substitute for a secrets manager or for rotating a credential that was already committed in plaintext.
Recipes
Real jobs confdiff is good at (all zero-config, all exit 1 on a real change so
they drop straight into CI):
Catch config drift between two Kubernetes manifests (ignore the volatile
metadata server-managed fields):
Compare .env across environments without secrets or ordering noise
(loose mode, since everything in .env is a string):
Confirm a format migration didn't change anything (JSON → YAML), because
confdiff compares the data model, not the bytes:
Prove a dependency bump only touched what you expected — a semantic diff of
package.json skips reordering and reformatting and shows only the version
changes:
Fail a PR when a locked-down config actually changes (reformatting alone won't trip it):
Track a CSV/TSV data export by identity, not row position so reordered rows and inserts don't drown out the one cell that changed:
Use as a git diff driver
Make git diff, git log -p, git show render semantic diffs for your
config files — reordered keys and reformatting stop showing up as noise.
One command sets it up (idempotent, safe to re-run):
That wires up diff.confdiff.command and adds the common config patterns
(*.json, *.yaml, *.toml, *.ini, *.env, *.csv, *.xml, …) to
.gitattributes. Pass your own patterns to override the defaults:
Now a change that only reorders keys shows no semantic changes, while a real value change shows exactly what moved:
Prefer to wire it up by hand? It's two lines:
--git-diff-driverreceives git's 7 diff arguments and maps them to the two file versions for you — this is the correct invocation for a git diff driver.
GitHub Action — semantic config diff on your PRs
Surface the real changes in config files right in the PR, instead of a wall of
reformatted text. The action inspects every changed JSON/YAML/TOML/INI/.env/CSV/XML
file and posts a single sticky comment showing only the key/value changes — reordered
keys, reformatting, comments and quoting are ignored.
A change to deploy/values.yaml then shows up as a comment like:
Inputs (all optional): paths (pathspecs to limit which files are checked),
args (extra confdiff flags, e.g. --loose --ignore metadata.*), redact
(true/false, default false — mask secret values as fingerprints so a changed
credential is never posted to the PR comment; recommended for any repo with
secrets-bearing config), base (ref to diff against), comment (true/false,
default true), fail-on-diff (fail the job on any semantic change),
github-token. Output: changed (true/false).
To gate merges on config changes instead of commenting:
pre-commit hook — block drift before it's committed
confdiff ships a pre-commit hook, so you can keep a
pair of config files in sync locally: the commit fails (and prints the semantic
diff) whenever they drift apart. A classic use is guarding .env.example
against the real .env, or keeping staging and prod overlays aligned except
for a few known keys.
Pass the two paths and any confdiff flags via args; the hook does not
append matched filenames, so you control exactly what is compared. Scope it with
files: so it only runs when those configs change. Because reordered keys,
reformatting and comments are ignored, the hook only fires on real value
changes — no false positives from a reformatted file.
Programmatic API
Each Change is { path, kind: "add"|"remove"|"change", oldValue?, newValue?, typeChanged? }.
MCP server — let your AI agent diff configs
confdiff ships an MCP server, so an AI coding assistant (Claude Desktop, Cursor, Cline, Windsurf, …) can compare configs by meaning instead of pasting whole files and eyeballing the noise. It exposes two tools:
diff_configs— diff two config strings the model already has in context.diff_config_files— read two files from disk by path and diff them.
Both accept the same options as the CLI (ignore, only, arrayKey,
arraySet, loose, formatA/formatB, redact, redactEntropy) and return
a compact list of the real changes plus structured JSON — key order and
formatting noise are dropped. Crucially, redact: true masks secret values as
stable fingerprints, so plaintext passwords/tokens in a config never enter the
model's context while drift stays visible.
Add it to any MCP client config:
The server ships as its own package,
confdiff-mcp, and is listed in
the official MCP Registry as
io.github.esperanza-volkov/confdiff-mcp. Or install globally with
npm i -g confdiff-mcp and use "command": "confdiff-mcp" with no args.
(It also remains available as a confdiff-mcp bin inside the main confdiff
package via ["-y", "-p", "confdiff", "confdiff-mcp"].)
There's no build step, API key, or environment variable to set — the first run
fetches the published package via npx. Agents that install MCP servers
automatically (e.g. Cline) can follow
llms-install.md for the exact one-step setup.
Then ask the agent things like "did my edit to prod.yaml change anything real
besides the replica count?" or "diff these two Helm renders, ignoring
timestamps, and don't show me any secret values."
How it decides two files are equal
- Parse both sides into a plain data model (objects, arrays, scalars).
- Compare recursively, key by key, ignoring object key order.
- Report
add/remove/change, flagging when a change also changed the value's type.
Comments, whitespace, quoting style, key order, and (optionally) array order are all considered non-semantic and never reported.
Questions & feedback
Have a config file that diffs wrong, a format you'd like added, or a way you use confdiff worth sharing? Open a thread in GitHub Discussions (Q&A / Ideas / Show and tell) — real-world files that confuse it are the single most useful thing you can share. Bugs are best filed as issues.
Contributing
Issues and pull requests are welcome. Run the test suite with:
See CONTRIBUTING.md for the full guide (including how to add a new format), CODE_OF_CONDUCT.md, and CHANGELOG.md for release notes.
Related projects
Other small, zero-dependency CLI tools by the same maintainer, if confdiff is your kind of thing:
- cmdpeek — interactively
browse and build any command's flags by parsing its
--help/man page (a local, offlineexplainshell+ a Ctrl-G shell widget). - comptab — generate bash /
zsh / fish shell completions for any CLI by parsing its
--help/man, no curated spec required.
License
MIT © Esperanza Volkov
Source: README.md at commit 6920fcc
Tools
0Version history
2- v0.17.1LatestSep 20, 2026
- v0.17.0Sep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts