Skip to content

feat: add get_debug_mcp_init_request debug tool#65

Open
antoninkrotky wants to merge 1 commit into
mainfrom
feat/get-debug-mcp-init-request
Open

feat: add get_debug_mcp_init_request debug tool#65
antoninkrotky wants to merge 1 commit into
mainfrom
feat/get-debug-mcp-init-request

Conversation

@antoninkrotky
Copy link
Copy Markdown

Summary

  • Add an opt-in debug tool get_debug_mcp_init_request that returns the MCP InitializeParams (protocol version, client info, declared capabilities) sent by the connected client during the handshake — useful for debugging client/server compatibility.
  • Capture init params via a receiving middleware and store them in a per-server initParamsStore, then re-inject into each tool call's context (works even in stateless HTTP mode where every call gets a fresh session).
  • Gate the tool behind a new mcp.enable-debug-tools config flag (env: COLLIBRA_MCP_ENABLE_DEBUG_TOOLS, default false); documented in docs/CONFIG.md and --help.
  • Tests: IsToolEnabled table tests, init-params middleware test, handler unit tests, and RegisterAll tests confirming the debug tool is hidden by default and visible when enabled.

Test plan

  • go test ./...
  • Start server with COLLIBRA_MCP_ENABLE_DEBUG_TOOLS=true, connect a client, call get_debug_mcp_init_request, verify it returns the client's init params
  • Start server without the flag, confirm tool is not listed

🤖 Generated with Claude Code

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>
@antoninkrotky antoninkrotky requested a review from a team as a code owner May 22, 2026 20:45
@svc-snyk-github-jira
Copy link
Copy Markdown

svc-snyk-github-jira commented May 22, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants