# @akapetaniou/azure-query-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/kapetanios55/azure-query-mcp  
**GitHub Stars:** 2  
**npm Downloads (last month):** 283  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/akapetaniou-azure-query-mcp

## Description
Read-only MCP server for Azure Log Analytics, Microsoft Sentinel and Azure Resource Graph queries.

## Tools
Capabilities this server exposes over MCP:

- **list_workspaces** — List Azure Log Analytics workspaces accessible in a subscription.
- **search_tables** — List or search tables in a Log Analytics workspace using ARM metadata.
- **describe_table** — Get the canonical schema and retention metadata for a Log Analytics table.
- **query_workspace** — Use for telemetry, logs, events, metrics, and time-series data stored in a Log Analytics workspace. Run bounded, read-only KQL against one workspace. Do not use for Azure resource inventory or configuration; use query_azure_resources for those.
- **query_azure_resources** — Use for Azure resource inventory, configuration, tags, policy, health, and cross-subscription discovery through Azure Resource Graph. Do not use for telemetry, logs, events, or time-series analysis; use query_workspace for those.
- **list_incidents** — List Microsoft Sentinel incidents (latest state of each) from the SecurityIncident table, newest first. Use to find incidents to triage; then call get_incident for details.
- **get_incident** — Get one Microsoft Sentinel incident with its alerts and the account, IP and host entities involved. Returned pivotEntities can be passed directly to entity_timeline; unresolvedEntities lists entities recorded without a usable identifier (for example only a display name or SID).
- **entity_timeline** — Build a cross-source activity timeline for one account (UPN), IP address or host: sign-ins, audit events, Office activity, endpoint telemetry, firewall logs and alerts. Tables that are not ingested are skipped automatically.
- **check_ingestion_health** — Check whether log data is still arriving: per-table last-seen time, 24h volume versus the previous daily average, stale tables, volume drops or spikes, and ingestion latency over the last hour.
- **list_hunting_queries** — List the available threat-hunting queries (built-in plus any loaded from AZURE_QUERY_MCP_HUNTING_DIR) with their MITRE ATT&CK tactics and techniques.
- **run_hunting_query** — Run one hunting query from list_hunting_queries against a workspace. Results are capped at 1,000 rows.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "azure-query-mcp": {
    "command": "npx",
    "args": ["-y","@akapetaniou/azure-query-mcp@0.6.1"]
  }
}
```

## Documentation

## What @akapetaniou/azure-query-mcp does

@akapetaniou/azure-query-mcp gives MCP clients read-only access to two Azure data planes. Azure Resource Graph handles resource inventory, configuration, tags, policy, health, and cross-subscription discovery. Log Analytics handles logs, events, telemetry, metrics, incidents, and time-series analysis, including Microsoft Sentinel data stored in workspaces.

The package also exposes higher-level security tools. Agents can locate workspaces, inspect tables and schemas, list or retrieve Sentinel incidents, build an entity timeline across sign-in, audit, Office, endpoint, firewall, and alert data, check ingestion health, and run built-in or user-supplied threat-hunting queries.

All tools are non-destructive, idempotent, and read-only. Query results are not stored, telemetry is not sent, and access remains subject to the identity's Azure permissions.

## How it works

The MCP client starts the npm package locally with `npx`; there is no Azure deployment or repository build step. Authentication uses Azure `DefaultAzureCredential`, which can use an interactive Azure CLI session such as `az login` or another supported identity, including a managed identity. The service communicates with Microsoft Entra ID, Azure Resource Manager, Resource Graph, and the Log Analytics query API for the selected Azure cloud.

`query_azure_resources` sends KQL to Resource Graph for explicitly supplied subscription IDs. The query must start with an ARG table, such as `Resources`, `ResourceContainers`, `ResourceChanges`, or `AuthorizationResources`. `query_workspace` sends bounded KQL to one workspace, identified by GUID or full ARM resource ID, and requires both a result-limiting operator and a timespan. Timespans can be ISO 8601 durations such as `P7D` or absolute intervals.

## Setup and configuration

Use Node.js 22 or later and authenticate to the tenant containing the target subscriptions and workspaces. The identity needs Azure RBAC permissions: `Reader` at the required subscription or narrower resource scope is suggested for Resource Graph and workspace discovery, while `Log Analytics Reader` is suggested for workspace schemas, data, and SOC tools. Custom roles can be used when they include the necessary read operations.

Configure the server as a stdio MCP process in Claude Code, VS Code, Claude Desktop, or Cursor. The command uses `npx -y @akapetaniou/azure-query-mcp`; `AZURE_TENANT_ID` can select the Entra tenant, although the Claude Code setup allows it to be left empty when the Azure CLI session supplies the tenant. Production deployments should prefer managed or workload identity over client secrets.

## Tools and capabilities

- Run Resource Graph KQL across explicitly selected subscriptions with `query_azure_resources`.
- Run bounded Log Analytics KQL with `query_workspace`.
- Discover workspaces and inspect table metadata with `list_workspaces`, `search_tables`, and `describe_table`.
- Investigate Sentinel incidents using `list_incidents` and `get_incident`.
- Trace activity for an account, IP address, or host with `entity_timeline`.
- Examine stale tables, volume changes, and query latency with `check_ingestion_health`.
- Enumerate and execute threat hunts with `list_hunting_queries` and `run_hunting_query`.

## Limitations and notes

Resource Graph describes Azure control-plane resources and may lag behind changes; it does not contain workspace log records. Resource Graph requests require explicit subscription scope and limit each page to 1,000 rows and 5 MiB. Log Analytics responses are limited to 1,000 rows and 2,000 characters per cell.

The read-only policy permits filtering string values and comments but rejects management commands, `set`, and `externaldata`. Cross-resource functions are blocked unless `AZURE_QUERY_MCP_ALLOW_CROSS_RESOURCE=true`; Azure RBAC still applies when that setting is enabled. Only selected row-shaping `evaluate` plugins are permitted, while plugins that access external systems are blocked.

Malformed queries receive Azure's query explanation when Azure returns HTTP 400. Other failures expose the HTTP status, Azure error code, and a remediation hint rather than upstream details that could reveal tenant or object identifiers. Requests can time out, cancellation aborts Azure requests, and access tokens are not logged.

_Full upstream README: https://allmcps.com/mcp/akapetaniou-azure-query-mcp/readme_

