Azure Data Explorer MCP server

Integrates with Azure Data Explorer to enable executing KQL queries, discovering database resources, exploring table schemas, and sampling data for data analysis and insights generation.
Back to servers
Setup instructions
Provider
pab1it0
Release date
Mar 10, 2025
Language
Python
Stats
42 stars

The Azure Data Explorer MCP Server provides a standardized Model Context Protocol interface for Azure Data Explorer/Eventhouse in Microsoft Fabric. This server enables AI assistants to execute KQL queries and explore your data through consistent, well-defined interfaces.

Features

  • Execute KQL queries against Azure Data Explorer
  • Discover and explore database resources (list tables, view schemas, sample data, get statistics)
  • Authentication support (Token credential, Workload Identity for AKS)
  • Docker containerization support
  • Configurable tools for AI assistants

Installation

Prerequisites

  • Azure account with permissions to access your ADX cluster
  • Authentication via Azure CLI or Workload Identity

Basic Installation

  1. Login to your Azure account using Azure CLI
  2. Configure the environment variables for your ADX cluster using a .env file or system environment variables:
# Required: Azure Data Explorer configuration
ADX_CLUSTER_URL=https://yourcluster.region.kusto.windows.net
ADX_DATABASE=your_database

# Optional: Azure Workload Identity credentials 
# AZURE_TENANT_ID=your-tenant-id
# AZURE_CLIENT_ID=your-client-id 
# ADX_TOKEN_FILE_PATH=/var/run/secrets/azure/tokens/azure-identity-token

Client Configuration

Add the server configuration to your client configuration file. For example, for Claude Desktop:

{
  "mcpServers": {
    "adx": {
      "command": "uv",
      "args": [
        "--directory",
        "<full path to adx-mcp-server directory>",
        "run",
        "src/adx_mcp_server/main.py"
      ],
      "env": {
        "ADX_CLUSTER_URL": "https://yourcluster.region.kusto.windows.net",
        "ADX_DATABASE": "your_database"
      }
    }
  }
}

If you see Error: spawn uv ENOENT in Claude Desktop, you may need to specify the full path to uv or set the environment variable NO_UV=1 in the configuration.

Docker Installation

Building the Docker Image

docker build -t adx-mcp-server .

Running with Docker

Using docker run:

docker run -it --rm \
  -e ADX_CLUSTER_URL=https://yourcluster.region.kusto.windows.net \
  -e ADX_DATABASE=your_database \
  -e AZURE_TENANT_ID=your_tenant_id \
  -e AZURE_CLIENT_ID=your_client_id \
  adx-mcp-server

Using docker-compose:

Create a .env file with your Azure Data Explorer credentials and run:

docker-compose up

Docker with Claude Desktop

For containerized server with Claude Desktop, update the configuration:

{
  "mcpServers": {
    "adx": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e", "ADX_CLUSTER_URL",
        "-e", "ADX_DATABASE",
        "-e", "AZURE_TENANT_ID",
        "-e", "AZURE_CLIENT_ID",
        "-e", "ADX_TOKEN_FILE_PATH",
        "adx-mcp-server"
      ],
      "env": {
        "ADX_CLUSTER_URL": "https://yourcluster.region.kusto.windows.net",
        "ADX_DATABASE": "your_database",
        "AZURE_TENANT_ID": "your_tenant_id",
        "AZURE_CLIENT_ID": "your_client_id",
        "ADX_TOKEN_FILE_PATH": "/var/run/secrets/azure/tokens/azure-identity-token"
      }
    }
  }
}

Usage

Authentication

The server supports multiple authentication methods:

  • Default: Uses Azure's DefaultAzureCredential, which tries multiple authentication methods
  • Workload Identity: Automatically used when running in AKS with the necessary environment variables

Using the MCP Tools

The server provides several tools that AI assistants can use:

Tool Description
execute_query Execute a KQL query against Azure Data Explorer
list_tables List all tables in the configured database
get_table_schema Get the schema for a specific table
sample_table_data Get sample data from a table with optional sample size

Azure Workload Identity

For AKS with Azure Workload Identity:

  1. Ensure the pod has AZURE_TENANT_ID and AZURE_CLIENT_ID environment variables
  2. Verify the token file is mounted at the default path or specify a custom path with ADX_TOKEN_FILE_PATH

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "adx" '{"command":"uv","args":["--directory","<full path to adx-mcp-server directory>","run","src/adx_mcp_server/main.py"],"env":{"ADX_CLUSTER_URL":"https://yourcluster.region.kusto.windows.net","ADX_DATABASE":"your_database"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "adx": {
            "command": "uv",
            "args": [
                "--directory",
                "<full path to adx-mcp-server directory>",
                "run",
                "src/adx_mcp_server/main.py"
            ],
            "env": {
                "ADX_CLUSTER_URL": "https://yourcluster.region.kusto.windows.net",
                "ADX_DATABASE": "your_database"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "adx": {
            "command": "uv",
            "args": [
                "--directory",
                "<full path to adx-mcp-server directory>",
                "run",
                "src/adx_mcp_server/main.py"
            ],
            "env": {
                "ADX_CLUSTER_URL": "https://yourcluster.region.kusto.windows.net",
                "ADX_DATABASE": "your_database"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later