Skip to content

Commit b448866

Browse files
Merge branch 'user/priyansh/updateBIforAksDPP' of https://github.com/priyansh17/azure-cli-extensions into user/priyansh/updateBIforAksDPP
2 parents a617b59 + 6e25cc5 commit b448866

33 files changed

+9288
-74
lines changed

src/aks-agent/HISTORY.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,21 @@ To release a new version, please select a new version number (usually plus 1 to
1111

1212
Pending
1313
+++++++
14+
15+
1.0.0b3
16+
+++++++
17+
* Disable aks-mcp by default, offer --aks-mcp flag to enable it.
1418
* Don't print version check at bottom toolbar
1519

20+
1621
1.0.0b2
1722
+++++++
1823

1924
* Add MCP integration for `az aks agent` with aks-mcp binary management and local server lifecycle (download, version validation, start/stop, health checks).
2025
* Introduce dual-mode operation: MCP mode (enhanced) and Traditional mode (built-in toolsets), with mode-specific system prompts.
2126
* Implement smart toolset refresh strategy with persisted mode state to avoid unnecessary refresh on repeated runs.
2227
* Add `--no-aks-mcp` flag to force Traditional mode when desired.
23-
* Add `az aks agent status` command to display MCP binary availability/version, server health, and overall mode/readiness.
28+
* Add `az aks agent --status` command to display MCP binary availability/version, server health, and overall mode/readiness.
2429
* Add structured error handling with user-friendly messages and actionable suggestions for MCP/binary/server/config errors.
2530
* 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.
2631

src/aks-agent/README.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Key capabilities
1818
- Configurable via a JSON/YAML config file provided with --config-file.
1919
- Control echo and tool output visibility with --no-echo-request and --show-tool-output.
2020
- Refresh the available toolsets with --refresh-toolsets.
21+
- Stay in traditional toolset mode by default, or opt in to aks-mcp integration with ``--aks-mcp`` when you need the enhanced capabilities.
2122

2223
Prerequisites
2324
-------------
@@ -63,6 +64,15 @@ Run in non-interactive batch mode
6364
6465
az aks agent "Diagnose networking issues" --no-interactive --max-steps 15 --model azure/my-gpt4.1-deployment
6566
67+
Opt in to MCP mode
68+
------------------
69+
70+
Traditional toolsets remain the default. Enable the aks-mcp integration when you want the enhanced toolsets by passing ``--aks-mcp``. You can return to traditional mode on a subsequent run with ``--no-aks-mcp``.
71+
72+
.. code-block:: bash
73+
74+
az aks agent --aks-mcp "Check node health with MCP" --name MyManagedCluster --resource-group MyResourceGroup --model azure/my-gpt4.1-deployment
75+
6676
Using a configuration file
6777
--------------------------
6878

src/aks-agent/azext_aks_agent/_help.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@
5858
- name: --status
5959
type: bool
6060
short-summary: Show AKS agent configuration and status information.
61-
- name: --no-aks-mcp
61+
- name: --aks-mcp
6262
type: bool
63-
short-summary: Disable AKS MCP integration and use traditional toolsets.
63+
short-summary: Enable AKS MCP integration for enhanced capabilities. Traditional mode is the default.
6464
6565
examples:
6666
- name: Ask about pod issues in the cluster with Azure OpenAI

src/aks-agent/azext_aks_agent/_params.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os.path
88

99
from azure.cli.core.api import get_config_dir
10+
from azure.cli.core.commands.parameters import get_three_state_flag
1011

1112
from azext_aks_agent._consts import CONST_AGENT_CONFIG_FILE_NAME
1213

@@ -86,8 +87,16 @@ def load_arguments(self, _):
8687
help="Show AKS agent configuration and status information.",
8788
)
8889
c.argument(
89-
"no_aks_mcp",
90-
options_list=["--no-aks-mcp"],
91-
help="Disable AKS MCP integration and use traditional toolsets.",
92-
action="store_true",
90+
"use_aks_mcp",
91+
options_list=["--aks-mcp"],
92+
default=False,
93+
arg_type=get_three_state_flag(
94+
positive_label="Enable AKS MCP integration",
95+
negative_label="Disable AKS MCP integration",
96+
),
97+
help=(
98+
"Enable AKS MCP integration for enhanced capabilities. "
99+
"Traditional mode is the default. Use --aks-mcp to enable MCP mode, or "
100+
"--no-aks-mcp to explicitly disable it."
101+
),
93102
)

src/aks-agent/azext_aks_agent/agent/agent.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def aks_agent(
126126
no_echo_request,
127127
show_tool_output,
128128
refresh_toolsets,
129-
no_aks_mcp=False,
129+
use_aks_mcp=False,
130130
):
131131
"""
132132
Interact with the AKS agent using a prompt or piped input.
@@ -147,8 +147,8 @@ def aks_agent(
147147
:type show_tool_output: bool
148148
:param refresh_toolsets: Refresh the toolsets status.
149149
:type refresh_toolsets: bool
150-
:param no_aks_mcp: Disable AKS MCP integration and use traditional toolsets.
151-
:type no_aks_mcp: bool
150+
:param use_aks_mcp: Enable AKS MCP integration and use enhanced toolsets.
151+
:type use_aks_mcp: bool
152152
"""
153153

154154
with CLITelemetryClient():
@@ -177,7 +177,7 @@ def aks_agent(
177177
interactive = False
178178

179179
# Determine MCP mode and smart refresh logic
180-
use_aks_mcp = not no_aks_mcp
180+
use_aks_mcp = bool(use_aks_mcp)
181181
current_mode = "mcp" if use_aks_mcp else "traditional"
182182
smart_refresh = _should_refresh_toolsets(current_mode, refresh_toolsets)
183183

@@ -293,7 +293,7 @@ def _initialize_mcp_manager(verbose: bool = False):
293293
[
294294
"Ensure all required dependencies are installed",
295295
"Try reinstalling the aks-preview extension",
296-
"Use --no-aks-mcp flag to disable MCP integration"
296+
"Use --aks-mcp flag to enable MCP integration"
297297
]
298298
)
299299

src/aks-agent/azext_aks_agent/agent/binary_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ async def download_binary(
454454
"PLATFORM_UNSUPPORTED",
455455
[
456456
"Check if your platform is supported by the aks-mcp project",
457-
"Try using --no-aks-mcp to disable MCP integration",
457+
"Run without --aks-mcp to stay in traditional mode",
458458
f"Manually install the binary from {self.GITHUB_RELEASES_URL} if available"
459459
]
460460
)

src/aks-agent/azext_aks_agent/agent/error_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class MCPError(AgentError):
3434

3535
def __init__(self, message: str, error_code: str = None, suggestions: List[str] = None):
3636
default_suggestions = [
37-
"Try running with --no-aks-mcp to use traditional mode",
37+
"Try running without --aks-mcp to stay in traditional mode",
3838
"Check your internet connection for MCP binary download",
3939
"Verify that port 8003 is available for MCP server"
4040
]

src/aks-agent/azext_aks_agent/agent/mcp_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ async def start_server(self) -> bool:
109109
"The MCP binary should be automatically downloaded",
110110
"Check your internet connection for binary download",
111111
"Try running the command again to retry download",
112-
"Use --no-aks-mcp to disable MCP integration"
112+
"Run without --aks-mcp to stay in traditional mode"
113113
]
114114
)
115115

src/aks-agent/azext_aks_agent/agent/status_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def get_recommendations(self) -> List[str]:
242242
# Traditional mode specific recommendations
243243
elif self.config.is_traditional_mode:
244244
if self.mcp_binary.ready:
245-
recommendations.append("Consider using MCP mode for enhanced capabilities (remove --no-aks-mcp)")
245+
recommendations.append("Consider using MCP mode for enhanced capabilities (run with --aks-mcp)")
246246

247247
# General recommendations
248248
if not self.config.config_valid:

src/aks-agent/azext_aks_agent/custom.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def aks_agent(
2828
show_tool_output=False,
2929
refresh_toolsets=False,
3030
status=False,
31-
no_aks_mcp=False,
31+
use_aks_mcp=False,
3232
):
3333
# If only status is requested, display and return early
3434
if status:
@@ -47,7 +47,7 @@ def aks_agent(
4747
no_echo_request,
4848
show_tool_output,
4949
refresh_toolsets,
50-
no_aks_mcp,
50+
use_aks_mcp=use_aks_mcp,
5151
)
5252

5353

@@ -237,7 +237,7 @@ def _get_recommendations(status_info):
237237
if binary_info.get("available"):
238238
recommendations.append(
239239
"Consider using MCP mode for enhanced capabilities by running 'az aks agent' "
240-
"(remove --no-aks-mcp if used)"
240+
"(run again with --aks-mcp to switch modes)"
241241
)
242242
else:
243243
recommendations.append("✅ AKS agent is ready in traditional mode")

0 commit comments

Comments
 (0)