Skip to main content
Glama
BetterAzureMCP
by SH-G401

BetterAzureMCP

CI npm License: MIT Node.js 22+

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 doctor

doctor 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 indexed

Then add the server to your client.

Client setup

Install in VS Code Install in VS Code Insiders

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

  1. Open Settings (gear icon, bottom left) → MCP Servers → Add custom server.

  2. Name: azure. Transport: stdio. Command: betterazuremcp.

  3. 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

azure_context

Who you are signed in as, the directory, your subscriptions and the current subscription. Switches subscription or directory.

azure_find_resources

Finds resources by name, type, resource group, location or tag across all subscriptions.

azure_resource_graph_query

KQL against Azure Resource Graph, for inventory questions across subscriptions.

azure_get_resource

The full definition of any resource by ID.

What is wrong with this resource?

Tool

What it does

azure_resource_health

Azure's own view of the resource's availability, recent outages, and active service issues.

azure_recent_changes

Configuration changes in the last 14 days, with before and after values and who made them.

azure_activity_log

Deployments, restarts, scaling and other operations, and why they failed.

azure_telemetry_locations

Where the resource's logs go: workspaces, Application Insights, storage, Event Hubs, and which tables to query.

azure_metrics

Platform metrics such as CPU, memory, HTTP 5xx, latency and restarts, summarized.

Telemetry

Tool

What it does

azure_logs_query

KQL against a Log Analytics workspace, an Application Insights resource, or one resource's logs.

azure_appinsights_failures

One-call triage: failure rate, failing operations, top exceptions, failing dependencies, slowest operations.

azure_appinsights_trace

Every request, dependency call, exception and trace of one operation, in time order.

Platforms

Tool

What it does

azure_appservice_overview

App Service and Function app state, runtime, plan, key settings, logging, slots, deployments, functions.

azure_appservice_logs

The latest application or platform log lines from the app's log files.

azure_diagnostics

Azure's built-in "Diagnose and solve problems" detectors for App Service and Container Apps.

azure_containerapp_overview

Container App revisions, replicas, restart counts, ingress, scale rules and containers.

azure_containerapp_logs

Console and system logs of a Container App.

azure_aks_overview

AKS cluster state, version and upgrades, node pools, networking and add-ons.

azure_aks_workloads

Failing pods, Warning events, unavailable deployments and unhealthy nodes, live from the cluster.

azure_aks_pod_logs

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

azure_appservice_logs (reads log files through Kudu)

A role with Microsoft.Web/sites/publish/Action, such as Website Contributor

azure_aks_workloads, azure_aks_pod_logs

Azure Kubernetes Service Cluster User Role, plus read access inside the cluster (Azure Kubernetes Service RBAC Reader, or a Kubernetes view binding). The cluster must use Entra ID integration.

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_context shows it.

  • Switching is one sentence. "Switch to the Staging subscription" or "look in the fabrikam.onmicrosoft.com directory" makes the assistant call azure_context with 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.json on Linux, ~/Library/Application Support/betterazuremcp/ on macOS, %APPDATA%\betterazuremcp\ on Windows. It holds only IDs and display names. Delete it to forget, or set BETTERAZUREMCP_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

BETTERAZUREMCP_TENANT_ID

tenant of your login

Tenant to sign in to. Set this if you have access to several tenants.

BETTERAZUREMCP_CREDENTIAL

auto

auto tries environment variables, Azure CLI, Azure Developer CLI and Azure PowerShell, in that order. Or pin one: azurecli, azd, azurepowershell, environment, managedidentity.

BETTERAZUREMCP_TIMEOUT_SECONDS

60

Deadline for a single tool call (5–600).

BETTERAZUREMCP_MAX_RESPONSE_KB

12

Size limit for a single tool result (2–256).

BETTERAZUREMCP_SUBSCRIPTIONS

all accessible

Comma-separated subscription IDs. The server then reads only from these subscriptions, enforced for every request.

BETTERAZUREMCP_MAX_MEMORY_MB

1024

The server stops itself if it ever uses more memory than this. The client restarts it on the next call.

BETTERAZUREMCP_REMEMBER_CONTEXT

true

Remember the subscription and directory you worked in last. Set to false to turn it off.

BETTERAZUREMCP_STATE_DIR

per-user app data folder

Where the remembered context is stored.

BETTERAZUREMCP_SHOW_SECRETS

false

Set to true to stop masking secret values. Not recommended.

BETTERAZUREMCP_LOG_LEVEL

info

error, warn, info or debug. Logs go to stderr, which clients show in their output panel.

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, PATCH and DELETE are blocked, and so is every POST that 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, exec and calls such as listKeys are 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 az login in a terminal. The client does not need to be restarted.

Signed in, but no subscriptions or 403 errors

You may be in the wrong tenant. Run az login --tenant <tenant> or set BETTERAZUREMCP_TENANT_ID.

The client cannot start betterazuremcp

The client may not see your PATH. Use the full path from which betterazuremcp (macOS/Linux) or where betterazuremcp (Windows). See docs/clients.md for Windows.

Timeouts on large queries

Narrow the query, or raise BETTERAZUREMCP_TIMEOUT_SECONDS.

AKS tools cannot reach a private cluster

Private API servers are only reachable from their network. Use azure_logs_query with Container Insights tables instead.

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 PATH

Contributing

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 tools
azure_activity_logActivity logA
Read-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 overviewA
Read-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 logsA
Read-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 workloadsA
Read-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 overviewA
Read-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 transactionA
Read-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 logsA
Read-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 overviewA
Read-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 logsA
Read-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 overviewA
Read-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 subscriptionsA
Read-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 diagnosticsA
Read-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 resourcesA
Read-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 detailsA
Read-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)A
Read-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 metricsA
Read-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 changesA
Read-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 GraphA
Read-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 issuesA
Read-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?A
Read-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

    A4.2/5.0

    Scored across 20 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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).

    Tool Count4/5

    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.

    Completeness5/5

    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

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides 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
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      11
      42 npm
      2
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      A 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