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
48 stars

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

Features

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

Installation and Setup

Basic Configuration

  1. Login to your Azure account with permissions to access the ADX cluster 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

# Optional: Custom MCP Server configuration
ADX_MCP_SERVER_TRANSPORT=stdio # Choose between http/sse/stdio, default = stdio

# Optional: Only relevant for non-stdio transports
ADX_MCP_BIND_HOST=127.0.0.1 # default = 127.0.0.1
ADX_MCP_BIND_PORT=8080 # default = 8080

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"
      }
    }
  }
}

Docker Usage

Building the Docker Image

docker build -t adx-mcp-server .

Running with Docker

Using docker run directly:

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 then run:

docker-compose up

Running with Docker in Claude Desktop

Update the configuration to use Docker with the environment variables:

{
  "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"
      }
    }
  }
}

Using Docker with HTTP Transport

For HTTP mode deployment:

{
  "mcpServers": {
    "adx": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-p", "8080:8080",
        "-e", "ADX_CLUSTER_URL",
        "-e", "ADX_DATABASE", 
        "-e", "ADX_MCP_SERVER_TRANSPORT",
        "-e", "ADX_MCP_BIND_HOST",
        "-e", "ADX_MCP_BIND_PORT",
        "adx-mcp-server"
      ],
      "env": {
        "ADX_CLUSTER_URL": "https://yourcluster.region.kusto.windows.net",
        "ADX_DATABASE": "your_database",
        "ADX_MCP_SERVER_TRANSPORT": "http",
        "ADX_MCP_BIND_HOST": "0.0.0.0",
        "ADX_MCP_BIND_PORT": "8080"
      }
    }
  }
}

Azure Workload Identity Support

The server uses WorkloadIdentityCredential by default when running in Azure Kubernetes Service (AKS) environments with workload identity configured. For AKS with Azure Workload Identity:

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

If these environment variables are not present, the server will automatically fall back to DefaultAzureCredential.

Available Tools

The MCP server provides several tools for interacting with Azure Data Explorer:

  • 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

These tools can be used by AI assistants to interact with your data through the MCP interface.

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