Skip to content

Feature/mcp server pr3 - #1923

Open
dolliecoder wants to merge 3 commits into
kmesh-net:mainfrom
dolliecoder:feature/mcp-server-pr3
Open

dolliecoder wants to merge 3 commits into
kmesh-net:mainfrom
dolliecoder:feature/mcp-server-pr3

Conversation

@dolliecoder

@dolliecoder dolliecoder commented Aug 14, 2026

Copy link
Copy Markdown

What type of PR is this?

/kind feature

What this PR does / why we need it:
This PR implements the Kmesh Log MCP Tools (kmesh_log_get and kmesh_log_set).

To make Kmesh AI-Native, AI agents need the ability to inspect and dynamically modify internal debugging states. This PR:

  1. Introduces the new mcp/tools/log package.
  2. Implements kmesh_log_get: Allows AI agents to retrieve a list of all available loggers or query the active logging level (e.g., debug, info, warn) of a specific logger on a given Kmesh daemon pod.
  3. Implements kmesh_log_set: Allows AI agents to dynamically update the logging level of a specific logger in real-time.
  4. Registers these tools with the central Kmesh MCP Server.

By exposing these as MCP tools, an AI agent can dynamically increase the logging level to debug, reproduce or observe a failure, retrieve the resulting logs, and then revert the logging level back to info—all autonomously.

Which issue(s) this PR fixes:
Fixes #1922

Special notes for your reviewer:
This tool reuses the existing kmeshctl logic and CreateKmeshPortForwarder to ensure that HTTP API requests hitting the Kmesh daemon (/debug/loggers) follow the exact same security and routing paths as the standard CLI.

Does this PR introduce a user-facing change?:

Added the `kmesh_log_get` and `kmesh_log_set` tools to the Kmesh MCP server, enabling AI agents to dynamically retrieve and modify daemon logging levels.

Signed-off-by: dolliecoder <dollychahar27@gmail.com>
Signed-off-by: dolliecoder <dollychahar27@gmail.com>
Signed-off-by: dolliecoder <dollychahar27@gmail.com>
@kmesh-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign yaozengzeng for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: MCP Server kmesh_log Tool

2 participants