kusto-mcp

A Model Context Protocol server for Azure Data Explorer. Zero config. Headless auth. Multi-cluster.

CI Python 3.10+ MIT License
View on GitHub Get Started

Quick Start

Claude Code

claude mcp add kusto -- uvx --from git+https://github.com/animeshkundu/kusto-mcp kusto-mcp

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "kusto": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/animeshkundu/kusto-mcp", "kusto-mcp"]
    }
  }
}

That's it. No cluster URL, credentials, or tenant ID needed at startup. The LLM provides the cluster and database with each tool call.

Authentication

Auth happens automatically on the first tool call. Tokens are cached persistently across server restarts.

  1. Azure CLI — silent if you've run az login
  2. Device code flow — the server returns a code and URL through the LLM, which asks you to authenticate in any browser. Works on headless/SSH machines.
  3. Cached — subsequent calls and restarts use the persistent token cache. No re-auth needed.

Tools

All tools accept cluster and database as required parameters.

Internal tables are ingested into the cluster. External tables reference data stored outside the cluster and are queried via external_table(). Materialized views are queried like internal tables. When using table_kind='external', the server rewrites leading table references and direct join/union table tokens; use external_table() explicitly in subqueries or let bindings.

ToolDescription
list_tablesList tables by kind (internal, external, materialized_view, or all)
execute_queryRun KQL; set table_kind='external' for external tables
retrieve_table_schemaGet table schema; set table_kind='external' for external tables

Features

Zero Config

No CLI arguments required. Start the server and go.

Multi-Cluster

Query different ADX clusters in the same session. Connections cached per cluster.

Headless Auth

Azure CLI → device code chain. Works on remote/SSH machines without a browser.

Token Caching

Persistent cache across restarts. Authenticate once, query forever.

Schema Hints

Query failures include the table schema so the LLM can self-correct without extra round trips.

Query Safety

3-minute timeouts, management command blocking, and deferred partial query failures.

Install

From GitHub Release

pip install https://github.com/animeshkundu/kusto-mcp/releases/latest/download/kusto_mcp-0.2.0-py3-none-any.whl

From Source

pip install git+https://github.com/animeshkundu/kusto-mcp

With uvx (no install needed)

uvx kusto-mcp

Development

git clone https://github.com/animeshkundu/kusto-mcp
cd kusto-mcp
uv sync --dev
uv run pytest tests/ -v