Open
Conversation
eb5da59 to
cba04f0
Compare
Cali0707
reviewed
Mar 26, 2026
Contributor
Author
|
Hi @Cali0707 thanks for the review. You're right. We are still working on it, which is why we marked it as WIP, and it's likely we'll find something else. We won't be able to verify everything until Kiali 2.24 is released next Monday. |
69abe42 to
0217d00
Compare
Signed-off-by: Alberto Gutierrez <aljesusg@gmail.com>
Signed-off-by: Alberto Gutierrez <aljesusg@gmail.com>
Signed-off-by: Alberto Gutierrez <aljesusg@gmail.com>
3ea7cf9 to
6fcba0a
Compare
Contributor
Author
|
Hi @Cali0707 ! This isr eady. Can we run it? |
Signed-off-by: Alberto Gutierrez <aljesusg@gmail.com>
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.
Ready
Summary
/api/chat/mcp/*endpoints instead of implementing the logic locallyMotivation
Kiali's UI already ships a built-in chatbot that uses the same MCP tool semantics. Maintaining two independent implementations of the same tools — one in the Kiali backend and one here in the MCP server — created several problems:
What changed
Architecture
Before: each tool handler built REST API calls to multiple Kiali endpoints, parsed JSON responses, computed derived data (health rollups, graph merges), and formatted output.
After: each tool handler is a thin wrapper that POSTs to
<kiali-url>/api/chat/mcp/<tool_name>with the tool arguments as JSON. Kiali's backend owns all data fetching, aggregation, and LLM-optimized formatting.Deleted (~3,000 lines)
pkg/kiali/: 15 files removed —health_calculation.go(626 lines),get_mesh_graph.go,graph.go,traces.go,logs.go,services.go,workloads.go,istio.go,mesh.go,namespaces.go,validations.go,types.go,endpoints.go, etc.pkg/toolsets/kiali/: 7 files removed —get_mesh_graph.go,get_metrics.go,get_resource_details.go,get_traces.go,helpers.go,helpers_test.go,logs.go,manage_istio_config.goAdded
pkg/toolsets/kiali/tools/: 9 thin tool handlers (~60–90 lines each) that define the tool schema and delegate tokiali.ExecuteRequest()pkg/toolsets/kiali/tools/endpoints.go: centralized MCP endpoint path constantspkg/toolsets/kiali/internal/defaults/: shared default values for tool parameterspkg/kiali/tests/: endpoint coverage test ensuring every endpoint constant is wired to a tool implementation, plus backend contract test scaffoldingImproved test coverage
kiali_test.go: no-config initialization, empty endpoint, non-2xx error handling (with/without body), JSON body serialization, header assertions (Content-Type,X-Kubernetes-MCP-Server, POST method), Bearer token edge cases (empty, already-prefixed)config_test.go: directValidate()tests for nil config, empty URL, invalid URL, URL without scheme, HTTP vs HTTPS certificate requirementspkg/mcp/kiali_test.go: rewritten to test the new architecture (single POST per tool, MCP endpoint paths, JSON argument forwarding)Benefits
Test plan
make testpasses (all 25 packages green)