Repository navigation
lint: lint every server in an MCP client config - #178
Open
abu-tahir-0 wants to merge 1 commit into
Open
abu-tahir-0 wants to merge 1 commit into
abu-tahir-0 wants to merge 1 commit into
Conversation
Add --client-config for Claude Desktop, Claude Code, Cursor and VS Code files (mcpServers or servers), starting each enabled stdio server with its command, args and env, and linting url entries as endpoints. One report per server, with text, markdown and an aggregated JSON shape. Env values are only passed to the child; error text is redacted and a test asserts a configured secret never reaches stdout or stderr.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
lint --commandhandles one server. Most people already have a dozen configured in a client, sotoolgauge lint --client-config PATHnow walks the file and lints each enabled server.harness/src/toolgauge/client_config.pyreads both layouts:mcpServers(Claude Desktop, Claude Code, Cursor) andservers(VS Code). Entries become:StdioServer(command, args, env)whencommandis present,HttpServer(url)when onlyurlis present."disabled": trueentries are skipped; anything with neither command nor url is an error rather than silently ignored.ClientConfigError, which the CLI prints without a traceback and exits 2.--command,--endpoint,--client-configis required.Probefor all lint rules (same as--command).== name (stdio) ==for text,## namefor markdown, and an aggregated{"clientConfig", "servers": [{"name", "kind", "report"|"error"}]}for JSON. SARIF/JUnit/HTML are rejected for multi-server output with a clear message.redact_env(longest value first), and the integration test configuresSECRET=hunter2then asserts it is absent from both stdout and stderr.--command.Verification
uv run pytest tests/harness/test_client_config.py tests/harness/test_lint_client_config.py tests/harness/test_stdio_lint.py -q— 17 passed (spawns real subprocess servers; both children proved they received the configured env)uv run pytest tests -m unit -q -n auto(with localhost NO_PROXY) — 407 passed; 4 failures are the known flaky graybox/population/fleet dashboard tests, unrelated to this changeuv run mypy— clean (57 files)uv run ruff check .— cleanCloses #143