Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The AKS Model Context Protocol (MCP) server enables AI assistants to interact with Azure Kubernetes Service (AKS) clusters with clarity, safety, and control. It serves as a bridge between AI tools (like GitHub Copilot, Claude, and other MCP-compatible AI assistants) and AKS, translating natural language requests into AKS operations and returning the results in a format the AI tools can understand.
The AKS MCP server connects to Azure using the Azure SDK and provides a set of tools that AI assistants can use to interact with AKS resources. These tools allow AI agents to perform tasks like:
- Troubleshooting and diagnostics
- Analyze the health of your cluster
- Operate (CRUD) AKS resources
- Retrieve details related to AKS clusters (VNets, Subnets, Network Security Groups (NSGs), Route Tables, etc.)
- Enabling best practices and recommended features
- Manage Azure Fleet operations for multi-cluster scenarios
The AKS MCP server is a fully open-source project. For source code and releases, see the AKS MCP GitHub repository.
When to use the AKS MCP server
The AKS MCP server can be used with any compatible AI assistant, including the agentic CLI for AKS and Microsoft Copilot. Common use cases include:
- Asking AI assistants questions like:
- "Why are pods pending in this cluster?"
- "What is the network configuration of my AKS cluster?"
- "Create a placement to deploy nginx workloads to clusters with app=frontend label."
- Allowing AI tools to:
- Read cluster state and configuration
- Inspect metrics, events, and logs
- Correlate signals across Kubernetes and Azure resources
- Apply changes and enable new features directly on your cluster
All actions you perform through the AKS MCP server are constrained by Kubernetes Role-Based Access Control (RBAC) and Azure RBAC. The AKS MCP server inherits your permissions when accessing cluster and Azure resources.
Available tools
The AKS MCP server provides a comprehensive set of tools for interacting with AKS clusters and associated resources. By default, the server uses unified tools (call_az for Azure operations and call_kubectl for Kubernetes operations) which provide a more flexible interface for interacting with Kubernetes and Azure resources.
There are three sets of permissions you can enable for the AKS MCP server: read-only (default), read-write, and admin. Some tools require read-write or admin permissions to perform actions like deploying debugging pods or CRUD actions on your cluster. To enable read-write or admin permissions for the AKS-MCP server, add the access level parameter to your MCP configuration file:
- Navigate to your mcp.json file, or go to MCP: List Servers -> AKS-MCP -> Show Configuration Details in the Command Palette (For VS Code;
Ctrl+Shift+Pon Windows/Linux orCmd+Shift+Pon macOS). - In the "args" section of AKS-MCP, add the following parameters: "--access-level," "readwrite" or "admin"
For example:
"args": [
"--access-level",
"readwrite"
]
These tools are designed to provide comprehensive functionality through unified interfaces:
Azure CLI Operations (Unified Tool)
Tool: call_az
Unified tool for executing Azure CLI commands directly. This tool provides a flexible interface to run any Azure CLI command.
Parameters:
cli_command: The complete Azure CLI command to execute. For example,az aks list --resource-group myRGoraz vm list --subscription <sub-id>.timeout: Optional timeout in seconds (default: 120)
Example Usage:
{
"cli_command": "az aks list --resource-group myResourceGroup --output json"
}
Access Control:
- readonly: Only read operations are allowed
- readwrite/admin: Both read and write operations are allowed
Important
Commands must be simple Azure CLI invocations without shell features like pipes (|), redirects (>, <), command substitution, or semicolons (;).
Kubernetes Operations (Unified Tool)
Unified kubectl Tool
Tool: call_kubectl
Unified tool for executing kubectl commands directly. This tool provides a flexible interface to run any kubectl command with full argument support.
Parameters:
args: The kubectl command arguments. For example,get pods,describe node mynode, orapply -f deployment.yaml.
Example Usage:
{
"args": "get pods -n kube-system -o wide"
}
Access Control: Operations are restricted based on the configured access level:
- readonly: Only read operations (get, describe, logs, etc.) are allowed
- readwrite/admin: All operations including mutating commands (create, delete, apply, etc.)
Helm
Tool: call_helm
Helm package manager for Kubernetes.
Cilium
Tool: call_cilium
Cilium CLI for eBPF-based networking and security.
Hubble
Tool: call_hubble
Hubble network observability for Cilium.
Network Resource Management
Tool: aks_network_resources
Unified tool for getting Azure network resource information used by AKS clusters.
Available Resource Types:
all: Get information about all network resourcesvnet: Virtual Network informationsubnet: Subnet informationnsg: Network Security Group informationroute_table: Route Table informationload_balancer: Load Balancer informationprivate_endpoint: Private endpoint information
Monitoring and Diagnostics
Tool: aks_monitoring
Unified tool for Azure monitoring and diagnostics operations for AKS clusters.
Available Operations:
metrics: List metric values for resourcesresource_health: Retrieve resource health events for AKS clustersapp_insights: Execute KQL queries against Application Insights telemetry datadiagnostics: Check if AKS cluster has diagnostic settings configuredcontrol_plane_logs: Query AKS control plane logs with safety constraints and time range validation
Compute Resources
Tool: get_aks_vmss_info
- Get detailed configuration of your Virtual Machine Scale Sets (node pools) in the AKS cluster
Fleet Management
Tool: az_fleet
Comprehensive Azure Fleet management for multi-cluster scenarios.
Available Operations:
- Fleet Operations: list, show, create, update, delete, get-credentials
- Member Operations: list, show, create, update, delete
- Update Run Operations: list, show, create, start, stop, delete
- Update Strategy Operations: list, show, create, delete
- ClusterResourcePlacement Operations: list, show, get, create, delete
Supports both Azure Fleet management and Kubernetes ClusterResourcePlacement CRD operations.
Diagnostic Detectors
Tool: aks_detector
Unified tool for executing AKS diagnostic detector operations.
Available Operations:
list: List all available AKS cluster detectorsrun: Run a specific AKS diagnostic detectorrun_by_category: Run all detectors in a specific category
Parameters:
operation(required): Operation to perform (list,run, orrun_by_category)aks_resource_id(required): AKS cluster resource IDdetector_name(required forrunoperation): Name of the detector to runcategory(required forrun_by_categoryoperation): Detector categorystart_time(required forrunandrun_by_categoryoperations): Start time in UTC ISO format (within last 30 days)end_time(required forrunandrun_by_categoryoperations): End time in UTC ISO format (within last 30 days, max 24 hours from start)
Available Categories:
- Best Practices
- Cluster and Control Plane Availability and Performance
- Connectivity Issues
- Create, Upgrade, Delete, and Scale
- Deprecations
- Identity and Security
- Node Health
- Storage
Example Usage:
Tool: run_detectors_by_category
{
"operation": "list",
"aks_resource_id": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.ContainerService/managedClusters/xxx"
}
{
"operation": "run",
"aks_resource_id": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.ContainerService/managedClusters/xxx",
"detector_name": "node-health-detector",
"start_time": "2025-01-15T10:00:00Z",
"end_time": "2025-01-15T12:00:00Z"
}
Azure Advisor
Tool: aks_advisor_recommendation
Retrieve and manage Azure Advisor recommendations for AKS clusters.
Available Operations:
list: List recommendations with filtering optionsreport: Generate recommendation reports- Filter Options: resource_group, cluster_names, category (Cost, HighAvailability, Performance, Security), severity (High, Medium, Low)
Real-time Observability
Tool: inspektor_gadget_observability
Real-time observability tool for Azure Kubernetes Service (AKS) clusters using eBPF.
Available Actions:
deploy: Deploy Inspektor Gadget to clusterundeploy: Remove Inspektor Gadget from clusteris_deployed: Check deployment statusrun: Run one-shot gadgetsstart: Start continuous gadgetsstop: Stop running gadgetsget_results: Retrieve gadget resultslist_gadgets: List available gadgets
Available Gadgets:
observe_dns: Monitor DNS requests and responsesobserve_tcp: Monitor TCP connectionsobserve_file_open: Monitor file system operationsobserve_process_execution: Monitor process executionobserve_signal: Monitor signal deliveryobserve_system_calls: Monitor system callstop_file: Top files by I/O operationstop_tcp: Top TCP connections by traffictcpdump: Capture network packets
Getting started with the AKS MCP server
The MCP server runs on your local machine and connects to AKS by using your existing permissions. You can quickly set up your local AI agent with AKS expertise and tooling. The server uses the current cluster context and enforces your Kubernetes and Azure RBAC permissions.
Note
As of version 0.0.20, remote deployments with Helm or containers aren't supported. Use the local binary.
Prerequisites
Before installing the AKS MCP server, set up Azure CLI and authenticate:
az login
- Visual Studio Code with GitHub Copilot (Recommended)
- Manual Binary Installation
- Custom Client Installation
The easiest way to get started with AKS-MCP is through the Azure Kubernetes Service Extension for VS Code. The AKS extension handles binary downloads, updates, and configuration automatically, ensuring you always have the latest version with optimal settings.
Step 1: Install the AKS Extension
- Open VS Code and go to Extensions (
Ctrl+Shift+Xon Windows/Linux orCmd+Shift+Xon macOS). - Search for Azure Kubernetes Service.
- Install the official Microsoft AKS extension.
Step 2: Launch the AKS-MCP Server
- Open the Command Palette (
Ctrl+Shift+Pon Windows/Linux orCmd+Shift+Pon macOS). - Search and run: AKS: Setup AKS MCP Server.
Upon successful installation, the server appears in MCP: List Servers (via Command Palette). From there, you can start the MCP server or view its status.
Step 3: Start Using AKS-MCP
Once started, the MCP server appears in the Copilot Chat: Configure Tools dropdown under MCP Server: AKS MCP, ready to enhance contextual prompts based on your AKS environment. By default, all AKS-MCP server tools are enabled. You can review the list of available tools and disable any that aren't required for your scenario.
Try a prompt like "List all my AKS clusters" to start using tools from the AKS-MCP server.
Tip
WSL Configuration: If you're using VS Code on Windows with WSL, use "command": "wsl" to invoke the WSL binary. If VS Code is running inside WSL (Remote-WSL), call the binary directly or use a bash wrapper instead.
Uninstall the AKS MCP server
VS Code with AKS Extension
- Open the Command Palette (
Ctrl+Shift+Pon Windows/Linux orCmd+Shift+Pon macOS). - Run MCP: List Servers.
- Select AKS MCP from the list.
- Select Stop Server to stop the running server.
- To remove the configuration, select Delete Server Configuration.
Alternatively, manually remove the server configuration:
- Open your
.vscode/mcp.jsonfile or VS Code User Settings. - Delete the
aks-mcp-serverentry from theserversorgithub.copilot.chat.mcp.serversobject. - Delete the AKS-MCP binary from your system (location varies based on installation method).
Other MCP Clients
Remove the aks or aks-mcp entry from your MCP client configuration file (for example, Claude Desktop's claude_desktop_config.json).
Common issues and troubleshooting
This section outlines common setup and runtime issues, their symptoms, and how to resolve them.
AKS MCP server can't access the cluster
Symptoms:
- Tools return authorization errors
- No resources are visible
Likely causes:
- User doesn't have sufficient permissions
- Misconfigured kubeconfig context
Resolution:
- Check that you have sufficient permissions to access the cluster. Verify that you are in the right cluster and subscription context.
Next steps
Learn more about the intelligent features built natively for AKS:
- About the agentic CLI for AKS
- Install and use the agentic CLI for AKS