Adx
    Adx

    Adx

    A Model Context Protocol (MCP) server that enables AI assistants to query and analyze Azure Data Explorer databases through standardized interfaces.

    4.3

    GitHub Stats

    Stars

    43

    Forks

    19

    Release Date

    6/4/2025

    about a month ago

    Detailed Description

    azure data explorer mcp server

    a model context protocol (mcp) server for azure data explorer/eventhouse in microsoft fabric.

    this provides access to your azure data explorer/eventhouse clusters and databases through standardized mcp interfaces, allowing ai assistants to execute kql queries and explore your data.

    features

    • [x] execute kql queries against azure data explorer

    • [x] discover and explore database resources

      • [x] list tables in the configured database
      • [x] view table schemas
      • [x] sample data from tables
      • [x] get table statistics/details
    • [x] authentication support

      • [x] token credential support (azure cli, msi, etc.)
      • [x] workload identity credential support for aks
    • [x] docker containerization support

    • [x] provide interactive tools for ai assistants

    the list of tools is configurable, so you can choose which tools you want to make available to the mcp client. this is useful if you don't use certain functionality or if you don't want to take up too much of the context window.

    usage

    1. login to your azure account which has the permission to the adx cluster using azure cli.

    2. configure the environment variables for your adx cluster, either through 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
    

    azure workload identity support

    the server now uses workloadidentitycredential by default when running in azure kubernetes service (aks) environments with workload identity configured. it prioritizes the use of workloadidentitycredential whenever the necessary environment variables are present.

    for aks with azure workload identity, you only need to:

    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, which tries multiple authentication methods in sequence.

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

    note: 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 usage

    this project includes docker support for easy deployment and isolation.

    building the docker image

    build the docker image using:

    docker build -t adx-mcp-server .
    

    running with docker

    you can run the server using docker in several ways:

    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

    to use the containerized server with 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"
          }
        }
      }
    }
    

    this configuration passes the environment variables from claude desktop to the docker container by using the -e flag with just the variable name, and providing the actual values in the env object.

    using as a dev container / github codespace

    this repository can also be used as a development container for a seamless development experience. the dev container setup is located in the devcontainer-feature/adx-mcp-server folder.

    for more details, check the devcontainer readme.

    development

    contributions are welcome! please open an issue or submit a pull request if you have any suggestions or improvements.

    this project uses uv to manage dependencies. install uv following the instructions for your platform:

    curl -lssf https://astral.sh/uv/install.sh | sh
    

    you can then create a virtual environment and install the dependencies with:

    uv venv
    source .venv/bin/activate  # on unix/macos
    .venv\scripts\activate     # on windows
    uv pip install -e .
    

    project structure

    the project has been organized with a src directory structure:

    adx-mcp-server/
    ├── src/
    │   └── adx_mcp_server/
    │       ├── __init__.py      # package initialization
    │       ├── server.py        # mcp server implementation
    │       ├── main.py          # main application logic
    ├── dockerfile               # docker configuration
    ├── docker-compose.yml       # docker compose configuration
    ├── .dockerignore            # docker ignore file
    ├── pyproject.toml           # project configuration
    └── readme.md                # this file
    

    testing

    the project includes a comprehensive test suite that ensures functionality and helps prevent regressions.

    run the tests with pytest:

    # install development dependencies
    uv pip install -e ".[dev]"
    
    # run the tests
    pytest
    
    # run with coverage report
    pytest --cov=src --cov-report=term-missing
    

    tests are organized into:

    • configuration validation tests
    • server functionality tests
    • error handling tests
    • main application tests

    when adding new features, please also add corresponding tests.

    tools

    | tool | category | description | | --- | --- | --- | | execute_query | query | execute a kql query against azure data explorer | | list_tables | discovery | list all tables in the configured database | | get_table_schema | discovery | get the schema for a specific table | | sample_table_data | discovery | get sample data from a table with optional sample size |

    license

    mit


    Star History

    Star History

    Mar 10Mar 24Apr 2Apr 8Apr 11Apr 15Apr 22Apr 25May 11May 23Jul 2015304560
    Powered by MSeeP Analytics

    About the Project

    This app has not been claimed by its owner yet.

    Claim Ownership

    Receive Updates

    Security Updates

    Get notified about trust rating changes

    to receive email notifications.