feat: add get_debug_mcp_init_request debug tool#65
Open
antoninkrotky wants to merge 1 commit into
Open
Conversation
Capture the MCP InitializeParams from the client handshake via a receiving middleware and expose them through a new opt-in debug tool get_debug_mcp_init_request. Gated behind the new enable-debug-tools config flag / COLLIBRA_MCP_ENABLE_DEBUG_TOOLS env var (off by default) so the tool stays hidden in normal deployments. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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
get_debug_mcp_init_requestthat returns the MCPInitializeParams(protocol version, client info, declared capabilities) sent by the connected client during the handshake — useful for debugging client/server compatibility.initParamsStore, then re-inject into each tool call's context (works even in stateless HTTP mode where every call gets a fresh session).mcp.enable-debug-toolsconfig flag (env:COLLIBRA_MCP_ENABLE_DEBUG_TOOLS, defaultfalse); documented indocs/CONFIG.mdand--help.IsToolEnabledtable tests, init-params middleware test, handler unit tests, andRegisterAlltests confirming the debug tool is hidden by default and visible when enabled.Test plan
go test ./...COLLIBRA_MCP_ENABLE_DEBUG_TOOLS=true, connect a client, callget_debug_mcp_init_request, verify it returns the client's init params🤖 Generated with Claude Code