mcp-triage is a diagnostic and repair tool for MCP (Model Context Protocol) client configurations, developed by NeufAgents. Its core purpose is to help users quickly locate and resolve issues that prevent MCP clients from starting or cause abnormal operation due to configuration errors.
Main capabilities
mcp-triage can scan the MCP configurations of 8 agent clients: Claude Desktop, Claude Code (including project-level servers discovered from ~/.claude.json), Codex, Cursor, VS Code, Windsurf, OpenClaw, and dsh. During the scan, the following checks are performed (v0.1):
- JSON syntax checks, including the classic trailing comma issue.
- Basic Codex-style TOML table checks.
- Whether commands can be resolved in PATH.
- Missing ${VAR} or process.env.VAR references.
- Relative path arguments.
- Plaintext http:// remote URLs.
- Consistency between transport type and configuration items (stdio requires command, HTTP transport requires url, dsh entries require serverName).
- Configuration drift of servers with the same name across different clients.
In addition, OpenClaw's openclaw.json file is in JSON5 format (which allows comments and trailing commas), and the tool parses it as JSON5 to avoid false syntax error reports.
Usage
mcp-triage provides two usage modes:
- CLI mode: It can be run directly in the terminal, and can be used even when the client cannot start. It supports the --fix option for mechanical repairs, only for files that fail to parse; it removes JSON comments and trailing commas, and saves a backup as <file>.mcp-triage.bak before writing (existing backups will not be overwritten). The repaired file must be parseable as JSON, otherwise it will not be written. Other issues are reported as suggestions and are not speculatively modified.
- MCP server mode: It runs as a stdio MCP server via the mcp-triage serve command, providing triage_scan (read-only scan) and triage_fix (dry-run by default, requires explicitly passing " dry_run: false will write) two tools that allow any MCP client to run troubleshooting on its own.
Exit code description: 0 means no errors were found, 1 means at least one error was found (after using --fix, this is the post-fix state).
Use cases
- When an MCP client fails to start or behaves abnormally due to configuration issues, use this to quickly locate the problem.
- Before migration or deployment, check the robustness of the configuration.
- When MCP configurations need to be managed uniformly across multiple clients, detect configuration drift.
- When you want to understand configuration health in a read-only way, use triage_scan.
Limitations and known limitations (v0.1)
- All 8 client paths have been verified against official documentation and/or real machines (there is a verification log in the repository: docs/verification-log.md). The OpenClaw path also respects OPENCLAW_CONFIG_PATH; VS Code includes the remote/WSL user configuration (~/.vscode-server/data/User/mcp.json).
- JSON clients support full parsing (OpenClaw is JSON5-light, meaning comments and trailing commas are supported; more complex JSON5 features will still fail to parse).
- TOML (Codex) supports only basic checks, i.e. the [mcp_servers.*] table.
- YAML (dsh cordis profiles) uses lightweight parsing and only extracts @deepseek-ai/dsh-mcp-client patch entries (serverName, transport, command, args, env, cwd; !!js expressions are kept as text for reference checking).
- When using --file on a file that cannot be attributed to a client, if it can only be parsed as JSON5, an informational message is given (rather than an error), because strict JSON clients would reject such files.
- The fix feature only handles mechanical removal (comments, trailing commas) and does not address other configuration issues.
Other information
- This project has zero runtime dependencies (including server mode) and uses ESM modules.
- The development and test scripts import .ts files directly and require Node 22.18+; the published package supports Node 20+, and the scan/--fix/serve flows have been smoke-tested on Node 20.19 .
- CI runs the full test suite on Node 22 and a build and --version smoke test on Node 20 on every push and pull request.
- The library entry point is src/index.ts, which exports discoverFiles, parseConfigFile, runChecks, and applyFixes; the CLI binary is src/cli.ts; the stdio MCP server is src/serve.ts, which is also re-exported from the library entry point.
- For issues that --fix cannot handle (such as a client still refusing to start after a clean scan, needing to harden the configuration before a failure, or cross-machine migration), NeufAgents offers a paid remediation service. You can send the troubleshooting report to hi@neufagents.com, and a written scope will be provided before work begins.
- The license is MIT © NeufAgents (neufagents.com).