Skip to main content

mcp-config-dedupe

Detect duplicate, drifted, and dead MCP server configurations across your AI clients — then dedupe them in one command.

If you run Claude Desktop, Cursor, VS Code, and Codex side by side, you have probably pasted the same mcpServers block into four different config files. Over time they rot: the same server gets configured twice, one copy gets different args than the other (drift), and old entries point at commands you uninstalled months ago (dead links). mcp-dedupe scans every client, shows you the mess, and cleans it up — with backups and a dry-run first.

Stdlib-only. No dependencies, no network calls, no telemetry.

Install

pip install mcp-config-dedupe

Requires Python 3.11+.

Usage

# Scan all supported clients (read-only) and print findings
mcp-dedupe scan

# Machine-readable report (exit code 1 when findings exist — CI friendly)
mcp-dedupe scan --format json

# Preview what dedupe would change (default; writes nothing)
mcp-dedupe dedupe

# Actually dedupe: backups are taken first, confirmation is explicit
mcp-dedupe dedupe --apply --yes

# Also resolve drifted duplicates, preferring Cursor's copy
mcp-dedupe dedupe --apply --yes --include-drift --prefer cursor

# Also remove servers whose command/cwd no longer exists
mcp-dedupe dedupe --apply --yes --prune-dead

What it detects:

Finding Meaning
DUPLICATE Same server name with an identical config in 2+ clients — safe to dedupe automatically
DRIFT Same server name but different command/args/env across clients — reported, and only touched with --include-drift
DEAD-LINK command not on PATH / path doesn't exist, or cwd is gone — only removed with --prune-dead
REMOTE URL-based server; can't be verified offline, listed for visibility
UNREADABLE Config file exists but can't be parsed

Supported clients: Claude Desktop, Cursor, VS Code (mcp.servers settings), Codex CLI (~/.codex/config.toml).

Safety model: scan and the default dedupe (dry-run) never write. --apply refuses to run without --yes, backs up every touched file to ~/.mcp-dedupe/backups/<timestamp>/ first, and only rewrites configs that parsed cleanly. Drifted duplicates are never auto-merged — you pick the winner with --prefer.

Differentiation

  • vs mcp-audit-tool (config security auditing): auditing tells you a config looks risky; mcp-dedupe takes action — it removes the duplicate and dead entries across clients in one command.
  • vs editing JSON by hand: one scan gives you a unified cross-client view with drift highlighted, instead of diffing four files in four different locations yourself.
  • vs mcp-config-sync (merge-everything sync): syncing unions every server into every client; dedupe does the opposite job — it collapses redundant copies down to one canonical entry and prunes what's dead.

Exit codes

  • 0 — success (scan clean / apply completed)
  • 1 — findings present (scan or dry-run)
  • 2 — usage error, or --apply without --yes

Development

python3 -m unittest discover -s tests -v   # 14 smoke tests, stdlib only

License

MIT — see LICENSE.

Metadata

Release files for mcp-config-dedupe 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-config-dedupe 0.1.0
File Size Uploaded
mcp_config_dedupe-0.1.0.tar.gz 13.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-config-dedupe 0.1.0
File Interpreter ABI Platform
mcp_config_dedupe-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.5 kB

Release files / mcp_config_dedupe-0.1.0.tar.gz

Download URL mcp_config_dedupe-0.1.0.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
772309215cced3ad2a37e92ef8ca3c008529697bf98d41859135b1369972e0a9
BLAKE2b-256 checksum
How to use checksums
f4d2df135f28e20358c95d8289fa435f16e252ecc23d3d0bed9b788db777df5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / mcp_config_dedupe-0.1.0-py3-none-any.whl

Download URL mcp_config_dedupe-0.1.0-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5306dd28d868a6bbc525c5c3a5a68dcb78eb03c97cd6715d01a3dd6dcbdf39ea
BLAKE2b-256 checksum
How to use checksums
9b460af42386d42b66bb9e0aef9cf70cf18c6f40e6f551bb643913bea3f70c89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page