BetterAzureMCP
BetterAzureMCP is a read-only MCP server that helps debug Azure applications from Copilot/VS Code by inspecting resources, health, logs, and telemetry.
Azure context & discovery: show sign-in/subscriptions, switch subscriptions/tenants, find resources by name/type/group/location/tag, get full resource definitions, and run KQL against Azure Resource Graph.
Health & change triage: check resource health and active service issues, list recent configuration changes with before/after values, review activity log for deployments/restarts/failures, and get platform metrics (CPU, memory, HTTP 5xx, latency).
Log & telemetry analysis: locate where telemetry goes (Log Analytics, App Insights, storage, Event Hubs), run KQL log queries, get Application Insights failure/triage summaries, and trace end-to-end transactions by operation ID.
App Service & Function Apps: overview state, runtime, plan, settings, logging, slots, deployments, functions; read app/platform log files; run built-in diagnostic detectors.
Container Apps: overview revisions, replicas, ingress, scale rules, containers; read console and system logs.
AKS: overview cluster state, node pools, networking, upgrades; inspect workloads, pods, events, deployments, and node health; read pod logs including previous crashed instances.
Privacy/read-only guarantees: write operations blocked, secrets masked, endpoint allowlist enforced, and output capped to avoid flooding context.
Provides read-only tools for inspecting Azure Kubernetes Service (AKS) clusters, including cluster state, node pools, workloads, events, and pod logs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@BetterAzureMCP why is orders-api returning 500s since this morning?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
BetterAzureMCP
A read-only Model Context Protocol server for Azure, built for one job: helping developers debug their Azure applications from GitHub Copilot, VS Code and other MCP clients.
Ask "why is orders-api returning 500s since this morning?" and the assistant can check resource health, recent configuration changes, failed deployments, Application Insights exceptions, container logs and pod restarts, without you opening the portal.
Stable. Every tool call has a hard deadline. Sign-in never waits on a hidden browser window. Nothing but protocol messages is written to stdout. No auto-updates and no runtime downloads.
Private. The server only talks to Azure's own API endpoints, enforced by an allowlist in code. No telemetry, no analytics, no third parties.
Read-only. Write operations are blocked at the HTTP layer, not just left out of the tool list. Values that look like secrets are masked before they leave the server.
Focused. 20 tools that cover the debugging path, instead of hundreds of per-service wrappers competing for the model's attention.
Contents
Related MCP server: mcp-ado-browser
Quick start
You need Node.js 22 or later and an Azure login through the Azure CLI (az login), the Azure Developer CLI (azd auth login) or Azure PowerShell (Connect-AzAccount).
npm install -g betterazuremcp
az login
betterazuremcp doctordoctor checks the setup and tells you what to fix:
betterazuremcp 1.0.0 doctor
ok Node.js version: 22.22.2
ok Azure sign-in: dev@contoso.com (tenant 8a1c...e42f) via Azure CLI (az login)
ok Subscriptions: 3 accessible, 3 enabled
ok Azure Resource Graph: reachable, 412 resources indexedThen add the server to your client.
Client setup
Every client starts the server the same way: the command betterazuremcp, over stdio, with no arguments.
VS Code (GitHub Copilot)
Use the install button above, or add this to .vscode/mcp.json (or MCP: Open User Configuration for all workspaces):
{
"servers": {
"azure": {
"type": "stdio",
"command": "betterazuremcp"
}
}
}The tools are available in Copilot Chat in Agent mode.
GitHub Copilot Desktop
Open Settings (gear icon, bottom left) → MCP Servers → Add custom server.
Name:
azure. Transport:stdio. Command:betterazuremcp.Save. The server starts with the next chat.
Visual Studio, Copilot CLI, Claude Desktop and others are covered in docs/clients.md.
Tools
Finding things
Tool | What it does |
| Who you are signed in as, the directory, your subscriptions and the current subscription. Switches subscription or directory. |
| Finds resources by name, type, resource group, location or tag across all subscriptions. |
| KQL against Azure Resource Graph, for inventory questions across subscriptions. |
| The full definition of any resource by ID. |
What is wrong with this resource?
Tool | What it does |
| Azure's own view of the resource's availability, recent outages, and active service issues. |
| Configuration changes in the last 14 days, with before and after values and who made them. |
| Deployments, restarts, scaling and other operations, and why they failed. |
| Where the resource's logs go: workspaces, Application Insights, storage, Event Hubs, and which tables to query. |
| Platform metrics such as CPU, memory, HTTP 5xx, latency and restarts, summarized. |
Telemetry
Tool | What it does |
| KQL against a Log Analytics workspace, an Application Insights resource, or one resource's logs. |
| One-call triage: failure rate, failing operations, top exceptions, failing dependencies, slowest operations. |
| Every request, dependency call, exception and trace of one operation, in time order. |
Platforms
Tool | What it does |
| App Service and Function app state, runtime, plan, key settings, logging, slots, deployments, functions. |
| The latest application or platform log lines from the app's log files. |
| Azure's built-in "Diagnose and solve problems" detectors for App Service and Container Apps. |
| Container App revisions, replicas, restart counts, ingress, scale rules and containers. |
| Console and system logs of a Container App. |
| AKS cluster state, version and upgrades, node pools, networking and add-ons. |
| Failing pods, Warning events, unavailable deployments and unhealthy nodes, live from the cluster. |
| Pod logs, including the previous instance of a crashing container. |
Results start with a one-line summary followed by compact JSON, and are capped in size so they do not flood the model's context.
Things to ask:
"orders-api has been returning 500s since 9:00. Find out why."
"What changed in resource group rg-orders-prod in the last 24 hours?"
"Show the slowest operations of the checkout service this week and trace one of them."
"Why does the latest revision of the payments container app not become healthy?"
"Which pods in the shop namespace of aks-prod are crash-looping, and what do their logs say?"
Permissions
The server can only see what your account can see. Most tools work with the Reader role. A few need more:
Tools | Role needed |
All tools, at the scope you want to inspect | Reader |
| A role with |
| Azure Kubernetes Service Cluster User Role, plus read access inside the cluster (Azure Kubernetes Service RBAC Reader, or a Kubernetes |
When a role is missing, the tool says which one and suggests an alternative that works with Reader.
Current subscription
The server remembers the subscription and directory (Entra tenant) you worked in most recently, so the assistant does not have to ask where to look every time.
It follows your work. Whenever a tool reads a resource in a subscription, that subscription becomes the current one. Tools that need a scope, such as the activity log and recent changes, use it when you don't name another.
The assistant knows it. The current subscription is part of the server's instructions at the start of every session, and
azure_contextshows it.Switching is one sentence. "Switch to the Staging subscription" or "look in the fabrikam.onmicrosoft.com directory" makes the assistant call
azure_contextwith the new choice, which is then remembered.It survives restarts and stays local. The choice is stored in a small file in your user profile:
~/.local/state/betterazuremcp/context.jsonon Linux,~/Library/Application Support/betterazuremcp/on macOS,%APPDATA%\betterazuremcp\on Windows. It holds only IDs and display names. Delete it to forget, or setBETTERAZUREMCP_REMEMBER_CONTEXT=false.
If the remembered directory stops working for your login, for example after you sign in with another account, the server falls back to your default directory and forgets the old choice. BETTERAZUREMCP_TENANT_ID and BETTERAZUREMCP_SUBSCRIPTIONS always take precedence.
Configuration
Configuration is optional and done through environment variables. Most clients let you set them in the server entry ("env": { ... }).
Variable | Default | Description |
| tenant of your login | Tenant to sign in to. Set this if you have access to several tenants. |
|
|
|
|
| Deadline for a single tool call (5–600). |
|
| Size limit for a single tool result (2–256). |
| all accessible | Comma-separated subscription IDs. The server then reads only from these subscriptions, enforced for every request. |
|
| The server stops itself if it ever uses more memory than this. The client restarts it on the next call. |
|
| Remember the subscription and directory you worked in last. Set to |
| per-user app data folder | Where the remembered context is stored. |
|
| Set to |
|
|
|
Behind a corporate proxy, set HTTPS_PROXY (and NO_PROXY if needed).
Privacy and safety
Where data goes. Requests go only to Azure Resource Manager (
management.azure.com), the Log Analytics query API (api.loganalytics.io), your App Service apps' Kudu sites (*.scm.azurewebsites.net) and your AKS API servers (*.azmk8s.io). Any other host is refused before a request is made.What is sent. Only the Azure API calls needed to answer a tool call. There is no telemetry, crash reporting or update check.
What cannot happen.
PUT,PATCHandDELETEare blocked, and so is everyPOSTthat is not a known read. Kudu access is limited to log files, and Kubernetes access to pod, event, deployment and node status and pod logs. Secrets, config maps,execand calls such aslistKeysare blocked by the same rules.Prompt injection. Logs, messages and tags can contain text written by anyone. Results that carry such text are marked as untrusted, and text that reads like instructions to an AI assistant is flagged with a warning. The server limits what an injected instruction could achieve: it does not request secret values, cannot write, and can only reach Azure endpoints of resources you can already read.
What the AI sees. Your MCP client passes tool results to its language model. Values that look like secrets (passwords, keys, connection strings, SAS tokens) are masked first, and app setting values are not requested. Masking is pattern-based and cannot catch everything: logs and telemetry contain whatever your application wrote, so a secret your app logged in an unusual format can reach the model. Use an MCP client and model you trust with your logs.
The full model is in SECURITY.md. These are design properties backed by tests, not a warranty; see the license.
Troubleshooting
Start with betterazuremcp doctor. It checks sign-in, subscriptions and connectivity, and prints what to fix.
Symptom | Fix |
"Not signed in to Azure" | Run |
Signed in, but no subscriptions or 403 errors | You may be in the wrong tenant. Run |
The client cannot start | The client may not see your |
Timeouts on large queries | Narrow the query, or raise |
AKS tools cannot reach a private cluster | Private API servers are only reachable from their network. Use |
Server logs appear in your client's MCP output (in VS Code: MCP: List Servers → azure → Show Output). Set BETTERAZUREMCP_LOG_LEVEL=debug for more detail.
Building from source
git clone https://github.com/SH-G401/BetterAzureMCP.git
cd BetterAzureMCP
npm ci
npm run build
npm link # puts the `betterazuremcp` command on your PATHContributing
Issues and pull requests are welcome. See CONTRIBUTING.md for the development setup and ground rules, and docs/architecture.md for how the code fits together. The reasoning behind the design is in docs/RESEARCH.md and docs/PLAN.md, and docs/COMPLAINTS.md tracks user complaints about the official Azure MCP Server and what we do about each.
License
MIT. The npm package bundles open-source dependencies into a single file; their licenses are in dist/THIRD_PARTY_NOTICES.txt.
BetterAzureMCP is an independent project. It is not affiliated with, endorsed by or supported by Microsoft. Microsoft and Azure are trademarks of the Microsoft group of companies.
Available Tools
20 toolsazure_activity_logActivity logARead-onlyIdempotent
Lists control-plane operations from the Azure activity log: deployments, restarts, scaling, configuration updates, role assignments, and their failures, with the caller and error message. Scope it to a resource, a resource group or a whole subscription. Set onlyFailures to see only failed operations.
Inputs: scope (required), hours, limit, onlyFailures.
azure_aks_overviewAKS cluster overviewARead-onlyIdempotent
Summarizes an AKS cluster from Azure Resource Manager: power and provisioning state, Kubernetes version and available upgrades, node pools (size, count, autoscaling, state), networking, identity and access mode, and enabled add-ons such as Container Insights. Also tells whether azure_aks_workloads and azure_aks_pod_logs can reach this cluster.
Inputs: clusterId (required).
azure_aks_pod_logsAKS pod logsARead-onlyIdempotent
Reads the last log lines of a pod container in an AKS cluster through the Kubernetes API (read-only). Set previous to true to read the logs of the previous, crashed instance of a container in CrashLoopBackOff. Find pod names with azure_aks_workloads.
Inputs: pod (required), clusterId (required), namespace (required), previous, +3 more.
azure_aks_workloadsAKS workloadsARead-onlyIdempotent
Reads live workload state from an AKS cluster's Kubernetes API with your Entra ID account (read-only). view "problems" (default) returns only what needs attention: failing or restarting pods, recent Warning events, deployments that are not fully available, and nodes that are not ready. Other views list everything: "pods", "events", "deployments", "nodes". Optionally limit to one namespace.
Inputs: clusterId (required), view, limit, namespace.
azure_appinsights_failuresApplication failures overviewARead-onlyIdempotent
One-call triage of an application from Application Insights: request volume and failure rate, the most frequent failed operations, top exceptions, failing dependencies (databases, HTTP calls, queues) and the slowest operations. Each entry carries a sample operation ID to pass to azure_appinsights_trace for the full end-to-end transaction.
Inputs: appInsightsId (required), role, hours.
azure_appinsights_traceEnd-to-end transactionARead-onlyIdempotent
Shows everything recorded for one operation ID in Application Insights, in time order: the incoming request, outgoing dependency calls, exceptions with stack details, and log traces, across all services. Get operation IDs from azure_appinsights_failures (sampleOperationId) or from a log query.
Inputs: operationId (required), appInsightsId (required), hours.
azure_appservice_logsApp Service logsARead-onlyIdempotent
Reads the most recent log lines of an App Service or Function app from its log files (Kudu). Linux: source "app" is the container stdout/stderr (your application output), "platform" is container start, stop and crash events. Windows: "app" is application logging (must be enabled), "platform" is the Windows event log (IIS and runtime errors). For logs older than the files on disk, use azure_logs_query.
Inputs: resourceId (required), lines, source.
azure_appservice_overviewApp Service overviewARead-onlyIdempotent
Summarizes an App Service or Function app (or a deployment slot) for debugging: state, runtime stack, plan and scale, key configuration (Always On, health check, TLS, workers), logging settings, slots, recent deployments and, for Function apps, the functions. App setting and connection string values are never read.
Inputs: resourceId (required).
azure_containerapp_logsContainer App logsARead-onlyIdempotent
Reads recent Container App logs from the environment's Log Analytics workspace. source "console" is your containers' stdout/stderr; "system" is platform events: revision provisioning, image pulls, probe failures, crashes and scaling. Filter by revision or by text. Results are oldest first.
Inputs: resourceId (required), hours, limit, search, +2 more.
azure_containerapp_overviewContainer App overviewARead-onlyIdempotent
Summarizes a Container App for debugging: provisioning and running state, ingress, containers (image, CPU, memory, probes), scale rules, revisions with health and traffic, and the replicas of active revisions with container restart counts and states. Use azure_containerapp_logs for console and system logs.
Inputs: resourceId (required).
azure_contextAzure sign-in and subscriptionsARead-onlyIdempotent
Shows who you are signed in to Azure as, which tenant is used, and the subscriptions you can read. Call this first when you need a subscription ID, or when another tool reports an authentication or permission problem.
Inputs: no named parameters.
azure_diagnosticsBuilt-in diagnosticsARead-onlyIdempotent
Runs Azure's built-in "Diagnose and solve problems" detectors for App Service, Function apps and Container Apps. These analyze platform data you cannot query yourself: crashes, restarts, HTTP 5xx breakdowns, CPU and memory pressure, SNAT port exhaustion, deployment and container start failures. Call without detector to list the available detectors, then call again with a detector id.
Inputs: resourceId (required), hours, detector.
azure_find_resourcesFind Azure resourcesARead-onlyIdempotent
Finds Azure resources by name, type, resource group, location or tag, across all your subscriptions at once. Returns resource IDs you can pass to other tools, plus type, location, SKU and provisioning state. Example: {"name": "orders-api", "type": "Microsoft.Web/sites"}. Common types: Microsoft.Web/sites (App Service and Functions), Microsoft.App/containerApps, Microsoft.ContainerService/managedClusters (AKS), Microsoft.Insights/components (Application Insights), Microsoft.OperationalInsights/workspaces (Log Analytics).
Inputs: name, tags, type, limit, +3 more.
azure_get_resourceGet Azure resource detailsARead-onlyIdempotent
Returns the full Azure Resource Manager definition of one resource: configuration, SKU, identity, networking and state. Works for any resource type, including child resources such as deployment slots. Secret values are masked. Get the resource ID from azure_find_resources.
Inputs: resourceId (required), apiVersion.
azure_logs_queryQuery logs (KQL)ARead-onlyIdempotent
Runs a KQL query against Azure Monitor Logs. scope can be a Log Analytics workspace (queries the whole workspace), an Application Insights resource, or any other resource (only that resource's logs, from every workspace it sends to). Application Insights tables: AppRequests, AppDependencies, AppExceptions, AppTraces. App Service: AppServiceHTTPLogs, AppServiceConsoleLogs. AKS: ContainerLogV2, KubePodInventory, KubeEvents. Example: {"scope": "", "query": "AppRequests | where Success == false | summarize count() by ResultCode, Name | top 10 by count_"}. Use azure_telemetry_locations to find the right scope.
Inputs: query (required), scope (required), hours, limit.
azure_metricsAzure Monitor metricsARead-onlyIdempotent
Reads platform metrics for any resource: CPU, memory, requests, HTTP 5xx, response time, restarts, queue length, DTU and so on. Call without metrics to list the metrics a resource offers. With metrics, returns min/avg/max/latest per series and a downsampled time series. Example: {"resourceId": "...sites/orders-api", "metrics": ["Http5xx", "HttpResponseTime"], "hours": 6}. Split by a dimension with filter, e.g. "Instance eq '*'".
Inputs: resourceId (required), hours, filter, metrics, +2 more.
azure_recent_changesRecent resource changesARead-onlyIdempotent
Lists configuration changes to a resource, or to every resource in a resource group or subscription, over the last hours (up to 14 days): what changed, the before and after values, who changed it and through which client. Use it to answer "what changed before this broke?".
Inputs: scope (required), hours, limit.
azure_resource_graph_queryQuery Azure Resource GraphARead-onlyIdempotent
Runs a KQL query against Azure Resource Graph: a fast, read-only index of every resource across your subscriptions. Useful tables: resources, resourcecontainers (subscriptions and resource groups), resourcechanges (recent property changes), healthresources (availability), advisorresources, policyresources. Examples: "resources | where type =~ 'microsoft.web/sites' | summarize count() by location"; "resourcechanges | where properties.changeAttributes.timestamp > ago(1d) | project properties.targetResourceId, properties.changeType, properties.changes | take 20". Use azure_find_resources for simple lookups.
Inputs: query (required), top, skipToken, subscriptionIds, +1 more.
azure_resource_healthResource health and service issuesARead-onlyIdempotent
Shows whether Azure itself reports a resource as healthy: its current availability, recent availability changes with Azure's stated reason, and active Azure service issues affecting the subscription. Use it early when an app is down, to tell a platform problem apart from an application problem.
Inputs: resourceId (required).
azure_telemetry_locationsWhere does telemetry go?ARead-onlyIdempotent
Finds where a resource's logs and telemetry are stored: diagnostic settings (Log Analytics workspaces, storage accounts, Event Hubs, with the enabled log categories), linked Application Insights, Container Apps environment logging, and AKS Container Insights. Returns the resource IDs to use with azure_logs_query and azure_appinsights_failures, and which tables to query. Call this before querying logs for a resource you have not looked at yet.
Inputs: resourceId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Most tools are clearly distinct by resource type (App Service vs AKS vs Container Apps) and by action (overview vs logs vs metrics vs query). However, azure_logs_query and azure_appinsights_failures both query application telemetry and could be confused, though one is a raw query and the other is a pre-built triage. Also, azure_appservice_logs and azure_containerapp_logs are similar but differ by platform.
The naming pattern is mostly consistent with a resource prefix (azure_<resourcetype>_<action>), e.g., azure_appservice_logs, azure_containerapp_overview, azure_aks_workloads. However, there are several tools that break this pattern: azure_context, azure_find_resources, azure_resource_graph_query, and azure_logs_query lack a clear resource type in the name, making them less predictable. But the overall style is still uniform (snake_case, resource-first).
With 20 tools, this is at the upper edge of a well-scoped set. Each tool covers a specific debugging need, and there is no redundancy or bloat. It feels slightly heavy because azure_get_resource could be redundant with azure_find_resources plus the ARM API, but it's still reasonable given the breadth of Azure services covered.
The tool surface is remarkably complete for the domain of Azure debugging. It covers resource discovery (find_resources, resource_graph_query), state (get_resource, resource_health), metrics (azure_metrics), logs (appservice_logs, containerapp_logs, aks_pod_logs, logs_query), diagnostics (azure_diagnostics, appinsights_failures), telemetry locations (azure_telemetry_locations), and change tracking (azure_recent_changes, activity_log). It provides a full lifecycle for investigating any Azure resource, and the ability to drill down from broad to specific.
Maintenance
Related MCP Connectors
The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.
Read-only AI coding tools for change verification, release readiness, capacity, and guidance.
Read-only AI/LLM cost tools with current MCP discovery and attributable Registry transport.
Read-only production context for AI agents: Docker/K8s health, deploys, logs, traffic, code graph
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides tools for listing and querying Azure resources directly from any MCP client, allowing you to efficiently browse your Azure infrastructure and analyze costs without leaving your workflow.3-
- AlicenseAqualityCmaintenanceProvides read-only access to Azure DevOps using your browser session, no PAT required. Enables browsing projects, repos, work items, pull requests, and feeds through MCP tools.1214 npmMIT
- AlicenseAqualityBmaintenanceEnables read-only querying of Azure Log Analytics and Azure Resource Graph through MCP, supporting KQL queries, workspace discovery, and resource inventory exploration with Azure RBAC authentication.1142 npm2MIT
- AlicenseNot gradedqualityCmaintenanceA read-only MCP server that exposes Azure incident-investigation tools for a single App Service and its Application Insights telemetry, enabling an agent to correlate deployment history, platform metrics, and transaction traces.MIT