Repository navigation
fix(mcp): log the server/discover connect probe as info, not an error - #2556
Conversation
That call now passes false for the error argument when the method is server/discover and true for every other unknown method, so the probe is logged as level=info with status=ok while other misses stay level=warn and status=error. The JSON-RPC response is still -32601 Method not found. The new test server_handle_discover_probe_logs_info checks those log fields, checks that unknown/method still logs a warning, checks that an initialize request for 2026-07-28 still negotiates 2025-11-25, and checks that resources/list still returns an empty resource list. Fixes DeusData#2433 Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thanks for documenting the server/discover logging change and the unchanged JSON-RPC fallback. I have read the proposal and the incomplete local validation notes; it remains pending review. |
|
Thank you, Matt! This is exactly the right size of fix for #2433. Keeping the -32601 reply untouched means current MCP clients still fall back to initialize the way the spec describes for servers on the 2025-11-25 revision, while the server/discover probe no longer leaves a warn/error line in every daemon log. Every other unknown method still warns, so real misses stay visible. The test is a great example of what we like to see: it pins the probe's log fields, proves an unknown method still logs a warning, and guards the initialize fallback and the empty resources/list along the way. We brought the branch up to date with current main and it passed CI there before merging. Much appreciated! |
server/discover returns -32601 Method not found, so every modern MCP SDK connect logs an error
#2433
What does this PR do?
That call now passes false for the error argument when the method is server/discover and true for every other unknown method, so the probe is logged as level=info with status=ok while other misses stay level=warn and status=error. The JSON-RPC response is still -32601 Method not found. The new test server_handle_discover_probe_logs_info checks those log fields, checks that unknown/method still logs a warning, checks that an initialize request for 2026-07-28 still negotiates 2025-11-25, and checks that resources/list still returns an empty resource list.
Every connect from a current MCP client sends server/discover first. This server answers with JSON-RPC -32601 Method not found, and the daemon records that reply as a warning with status=error, so each successful session leaves one recurring error line even though initialize and the later calls succeed. The method-not-found path in cbm_mcp_server_handle always called cbm_log_mcp_request with the error argument set to true, which is written as level=warn and status=error. server/discover is not implemented, so the modern connect probe takes that path and gets the same log treatment as any other unknown method. The -32601 body is the fallback signal a legacy server is supposed to return so the client continues with initialize.
Fixes #2433
Checklist
git commit -s) — required, CI rejectsunsigned commits (DCO, see CONTRIBUTING.md)
make -f Makefile.cbm test)Not claimed: ran
./scripts/test.shlocally; it hit its time limit before finishing.make -f Makefile.cbm lint-ci)Not claimed:
make -f Makefile.cbm lint-ciwas not run locally either.AI was used for assistance.