Repository navigation
feat(mcp): test every enabled MCP server with one command - #313
Merged
Merged
Conversation
`deepcode mcp test <name>` performs a real handshake for one server. Checking a
whole configuration means running it once per server and reading each exit code,
which is exactly the loop a startup check or a CI job has to write. `mcp test
--all` walks the effective inventory, probes every enabled server, and reports
one summary:
PASS fixture: 3 tools, 1 resources, 1 prompts in 0.412s
FAIL broken: connection failed: ...
1 passed, 1 failed of 2 enabled MCP servers.
The single-server path is unchanged (`mcp test <name>`); passing neither or both
is rejected with exit 2. `--json` emits {ok,total,failed,servers[]} so callers
can assert on it. Probes reuse McpService.probe, so per-server timeouts,
credential resolution and OAuth are unchanged.
Tests: tests/test_mcp_cli.py gains three cases (failure aggregation across
enabled servers, disabled servers skipped, argument validation); the file runs
11 passed and ruff 0.15.21 (check + format) is clean.
Contributor
|
Thanks @raymondginger2018-sudo, merged on 2026-11-23 as 1e9df27. We added one follow-up (97713dd):
|
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.
Summary
deepcode mcp test <name>performs a real handshake for a single server. Checking a whole configuration therefore means running it once per server and reading each exit code — exactly the loop a startup check or a CI job has to write itself.mcp test --allwalks the effective inventory and probes every enabled server, then prints one summary and returns one exit code.Changes
cli/mcp_cli.py—testtakes an optional<name>plus--all; exactly one is required (neither/both exits 2). The--allpath reusesMcpService.probeper enabled server and prints through a new_print_probe_all.core/application/views.py—mcp_probe_all_viewaggregates per-servermcp_probe_viewresults into{ok, total, failed, servers[]}.tests/test_mcp_cli.py— three cases: aggregation across enabled servers, disabled servers skipped, argument validation.mcp test <name>is unchanged. The loop calls the sameprobe, so per-server startup timeouts, credential resolution and OAuth handling are untouched.Output
With
--json:{ "ok": false, "total": 2, "failed": 1, "servers": [ {"name": "fixture", "ok": true, "toolCount": 3, "resourceCount": 1, "promptCount": 1, "elapsedSeconds": 0.412, "error": null}, {"name": "broken", "ok": false, "toolCount": 0, "resourceCount": 0, "promptCount": 0, "elapsedSeconds": 0.003, "error": "..."} ] }Tests
tests/test_mcp_cli.py: 11 passed (8 existing + 3 new).ruff 0.15.21(the version pinned in.pre-commit-config.yaml):checkandformat --checkboth clean.Notes
total: 0and exits 0.