Repository navigation
feat(mcp): implement Phase 3 (smart filtering, memory guards, stdio transport, and 80%+ test suite) - #1969
feat(mcp): implement Phase 3 (smart filtering, memory guards, stdio transport, and 80%+ test suite)#1969devGPP23 wants to merge 7 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
…and test suite Signed-off-by: devGP7 <gauravpatil232005@gmail.com>
Signed-off-by: devGP7 <gauravpatil232005@gmail.com>
4f0b2ec to
e4f8c59
Compare
…g, and test updates Signed-off-by: devGP7 <gauravpatil232005@gmail.com>
…errors - Use OS-assigned ephemeral local ports (port 0 + GetPorts) so concurrent tool calls can never collide on the same port; removes the pre-allocation race in getAvailablePort - Wrap the client-go forwarder (capturingForwarder) to resolve the bound port after readiness - Split fetch timeouts: 10s forward-start, 30s daemon read for large dumps - Fresh HTTP transport per call (no keep-alive reuse across port-forwards) - Map EOF/refused/timeout failures to actionable hints including pod phase/ready status Signed-off-by: devGP7 <gauravpatil232005@gmail.com>
…_namespaces The daemon enrolls namespaces regardless of the label value casing (strings.EqualFold in pkg/utils/enroll.go), but the tool selected on the exact value 'Kmesh' so namespaces labelled 'kmesh' were silently missing. Select on the label key and filter client-side with EqualFold to match the daemon's enrollment behavior. Signed-off-by: devGP7 <gauravpatil232005@gmail.com>
Signed-off-by: devGP7 <gauravpatil232005@gmail.com>
80a9ff1 to
cfeb534
Compare
Signed-off-by: devGP7 <gauravpatil232005@gmail.com>
This PR implements Phase 3 of the Kmesh MCP Server proposal
It builds upon Phase 1 & 2 by introducing token-efficient context summarization, robust input validation, dual transport modes (
stdioandsse), and a comprehensive unit testing suite achieving 80.2% statement coverage.Work Done in this PR
###1. Smart Context Summarization & 16 MiB Memory Guard (
mcp/summarize.go):summary=true).filter="<name/uid>") to inspect individual listeners, clusters, routes, or map entries in full.2. Dual Transport Protocol Support (
mcp/server.go,ctl/mcp/mcp.go):--transportflag tokmeshctl mcp servewith support for:stdio(default): Enables seamless, zero-config plug-and-play with Claude Desktop and Cursor IDE via standard I/O.sse: Enables HTTP Server-Sent Events streaming transport for web and network-accessible agents.3. Parameter Validation (
mcp/validate.go):podName,namespace) and operating mode parameters.4. Comprehensive Unit Test Suite (
mcp/tools_test.go,mcp/summarize_test.go):fake.Clientsetand daemon mock servers.mcppackage:get_version,get_authz_status,get_daemon_health,get_logger_levelsconfig_dumpandget_bpf_maps(summary and filter paths)list_daemon_pods,get_mesh_namespaces,list_waypoints,get_waypoint_status5. Documentation (
docs/ctl/*.md):--transportflag and options.ITERATIONS AFTER LIVE DEMO - in newer commits
While testing tool chaining with Claude Desktop we ran into some real failures, and this update fixes them properly:
config_dumpwithout a mode used to always 404 - it hit an endpoint the daemon doesn't serve. It now auto-detects the mode via /version, and if that fails it says so clearly instead of silently guessing kernel-native (which could quietly return the wrong data).fixes mcp: config_dump tool returns 404 when the optional mode argument is omitted #1979