[jaegermcp] Fix MCP server integration with Claude Code#8191
[jaegermcp] Fix MCP server integration with Claude Code#8191yurishkuro merged 17 commits intojaegertracing:mainfrom
Conversation
Signed-off-by: Yuri Shkuro <github@ysh.us>
There was a problem hiding this comment.
Pull request overview
This PR updates the Jaeger MCP extension to improve compatibility with Claude Code and align HTTP serving with OpenTelemetry Collector’s standard confighttp infrastructure.
Changes:
- Reworked
get_trace_topologyoutput from a recursive tree into a flat, depth-first list with apathfield encoding ancestry. - Added MCP request/response logging middleware (session ID, method, duration, error).
- Removed the dedicated
/healthHTTP endpoint and shifted to standardconfighttpserver setup.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/jaeger/internal/extension/jaegermcp/server.go | Switches HTTP lifecycle to confighttp and wires in MCP logging middleware; removes /health endpoint. |
| cmd/jaeger/internal/extension/jaegermcp/server_test.go | Updates test server helpers/readiness checks and removes /health/CORS tests accordingly. |
| cmd/jaeger/internal/extension/jaegermcp/logging_middleware.go | Implements middleware that logs all MCP method calls and results with timing. |
| cmd/jaeger/internal/extension/jaegermcp/logging_middleware_test.go | Adds coverage asserting the middleware emits request/response log entries. |
| cmd/jaeger/internal/extension/jaegermcp/internal/types/get_trace_topology.go | Changes topology response schema to a flat list of TopologySpan with path. |
| cmd/jaeger/internal/extension/jaegermcp/internal/handlers/get_trace_topology.go | Implements flat DFS topology construction with deterministic ordering and depth truncation. |
| cmd/jaeger/internal/extension/jaegermcp/internal/handlers/get_trace_topology_test.go | Updates tests to validate the new flat path encoding, ordering, and truncation semantics. |
| cmd/jaeger/internal/extension/jaegermcp/README.md | Removes /health from documented endpoints and adds Claude Code setup example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
|
||
| s.telset.Logger.Info("Jaeger MCP server started successfully", | ||
| zap.String("endpoint", s.config.HTTP.NetAddr.Endpoint), | ||
| zap.String("mcp_endpoint", "http://"+s.config.HTTP.NetAddr.Endpoint+"/mcp")) |
| func waitForServer(t *testing.T, addr string) { | ||
| t.Helper() | ||
| require.Eventually(t, func() bool { | ||
| resp, err := http.Get(fmt.Sprintf("http://%s/mcp", addr)) | ||
| if err != nil { | ||
| return false | ||
| } | ||
| require.NoError(t, resp.Body.Close()) | ||
| return true | ||
| }, 1*time.Second, 10*time.Millisecond, "Server should be ready") |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8191 +/- ##
==========================================
- Coverage 95.67% 95.62% -0.05%
==========================================
Files 317 318 +1
Lines 16750 16771 +21
==========================================
+ Hits 16026 16038 +12
- Misses 571 578 +7
- Partials 153 155 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Changes
get_trace_topologyoutput format. Changed from a nestedroot_span/orphanstree to a flat, depth-first ordered list of spans. Each span now has apathfield containing slash-delimited span IDs from the root down to that span (e.g.rootID/parentID/spanID), encoding the tree structure without recursion. Thedepthparameter andtruncated_childrenfield are preserved./healthHTTP endpoint.confighttpinfrastructure, enabling TLS, CORS, and other standard HTTP options to be configured via the extension'shttp:config block.Test in Claude