Skip to content

Commit 144c7c2

Browse files
committed
feat: Improve user experience of az aks agent with aks-mcp
Enhance the user experience of az aks agent, including: 1. Use aks-mcp by default, offering an opt-out flag --no-aks-mcp. 2. Disable duplicated built-in toolsets when using aks-mcp. 3. Manage the lifecycle of aks-mcp binary, including downloading, updating, health checking and gracefully stopping. 4. Offer status subcommand to display the system status. Refine system prompt. 5. Smart toolset refreshment when switching between mcp and traditional mode.
1 parent 17a35fd commit 144c7c2

27 files changed

+6399
-104
lines changed

src/aks-agent/HISTORY.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ To release a new version, please select a new version number (usually plus 1 to
1212
Pending
1313
+++++++
1414

15+
1.0.0b2
16+
+++++++
17+
18+
- Add MCP integration for `az aks agent` with aks-mcp binary management and local server lifecycle (download, version validation, start/stop, health checks).
19+
- Introduce dual-mode operation: MCP mode (enhanced) and Traditional mode (built-in toolsets), with mode-specific system prompts.
20+
- Implement smart toolset refresh strategy with persisted mode state to avoid unnecessary refresh on repeated runs.
21+
- Add `--no-aks-mcp` flag to force Traditional mode when desired.
22+
- Add `az aks agent status` command to display MCP binary availability/version, server health, and overall mode/readiness.
23+
- Add structured error handling with user-friendly messages and actionable suggestions for MCP/binary/server/config errors.
24+
- Port and adapt comprehensive unit tests covering binary manager, MCP manager, configuration generation/validation, status models/collection, error handling, user feedback, parameters, smart refresh, MCP integration, and status command.
25+
1526
1.0.0b1
1627
+++++++
1728
* Add interactive AI-powered debugging tool `az aks agent`.

src/aks-agent/azext_aks_agent/_consts.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,11 @@
88
CONST_AGENT_NAME = "AKS AGENT"
99
CONST_AGENT_NAME_ENV_KEY = "AGENT_NAME"
1010
CONST_AGENT_CONFIG_FILE_NAME = "aksAgent.yaml"
11+
12+
# MCP Integration Constants (ported from previous change)
13+
CONST_MCP_BINARY_NAME = "aks-mcp"
14+
CONST_MCP_DEFAULT_PORT = 8003
15+
CONST_MCP_DEFAULT_URL = "http://localhost:8003/sse"
16+
CONST_MCP_MIN_VERSION = "0.0.7"
17+
CONST_MCP_GITHUB_REPO = "Azure/aks-mcp"
18+
CONST_MCP_BINARY_DIR = "bin"

src/aks-agent/azext_aks_agent/_help.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
- name: --refresh-toolsets
4949
type: bool
5050
short-summary: Refresh the toolsets status.
51+
- name: --no-aks-mcp
52+
type: bool
53+
short-summary: Disable AKS MCP integration and use traditional toolsets.
5154
5255
examples:
5356
- name: Ask about pod issues in the cluster with Azure OpenAI
@@ -104,3 +107,15 @@
104107
enabled: false
105108
```
106109
"""
110+
111+
helps[
112+
"aks agent status"
113+
] = """
114+
type: command
115+
short-summary: Show AKS agent configuration and readiness (MCP binary, server, and mode).
116+
long-summary: |-
117+
Displays MCP binary availability and version, MCP server running/healthy state (if applicable), and overall mode.
118+
examples:
119+
- name: Show agent status
120+
text: az aks agent status
121+
"""

src/aks-agent/azext_aks_agent/_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,9 @@ def load_arguments(self, _):
7777
help="Refresh the toolsets status.",
7878
action="store_true",
7979
)
80+
c.argument(
81+
"no_aks_mcp",
82+
options_list=["--no-aks-mcp"],
83+
help="Disable AKS MCP integration and use traditional toolsets.",
84+
action="store_true",
85+
)

0 commit comments

Comments
 (0)