The adx-mcp-server is an MCP server that connects to Azure Data Explorer/Eventhouse databases, enabling AI assistants to interact with data through standardized interfaces.
Key capabilities:
Execute KQL queries against configured databases
Discover and explore database resources:
List available tables with names and associations
View table schemas, including column names and data types
Sample data from tables with customizable sample sizes
Authentication support including token credentials and Workload Identity for AKS
Deployment options through Docker containerization and Dev Container/GitHub Codespace compatibility
Used for loading environment variables from a .env file for configuration of the Azure Data Explorer connection details and authentication credentials.
Supports comprehensive testing of the MCP server functionality, including configuration validation, server operation, and error handling tests.
Azure Data Explorer MCP Server
A (MCP) server that enables AI assistants to execute KQL queries and explore Azure Data Explorer (ADX/Kusto) databases through standardized interfaces.
This server provides seamless access to Azure Data Explorer and Eventhouse (in Microsoft Fabric) clusters, allowing AI assistants to query and analyze your data using the powerful Kusto Query Language.
Features
Query Execution
Execute KQL queries - Run arbitrary KQL queries against your ADX database
Structured results - Get results formatted as JSON for easy consumption
Database Discovery
List tables - Discover all tables in your database
View schemas - Inspect table schemas and column types
Sample data - Preview table contents with configurable sample sizes
Table statistics - Get detailed metadata including row counts and storage size
Authentication
DefaultAzureCredential - Supports Azure CLI, Managed Identity, and more
Workload Identity - Native support for AKS workload identity
Flexible credentials - Works with multiple Azure authentication methods
Deployment Options
Multiple transports - stdio (default), HTTP, and Server-Sent Events (SSE)
Docker support - Production-ready container images with security best practices
Dev Container - Seamless development experience with GitHub Codespaces
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.
Related MCP server: Metabase MCP Server
Usage
Login to your Azure account which has the permission to the ADX cluster using Azure CLI.
Configure the environment variables for your ADX cluster, either through a
.envfile or system environment variables:
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:
Make sure the pod has
AZURE_TENANT_IDandAZURE_CLIENT_IDenvironment variables setEnsure 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.
Add the server configuration to your client configuration file. For example, for Claude Desktop:
Note: if you see
Error: spawn uv ENOENTin Claude Desktop, you may need to specify the full path touvor set the environment variableNO_UV=1in the configuration.
Docker Usage
This project includes Docker support for easy deployment and isolation.
Building the Docker Image
Build the Docker image using:
Running with Docker
You can run the server using Docker in several ways:
Using docker run directly:
Using docker-compose:
Create a .env file with your Azure Data Explorer credentials and then run:
Running with Docker in Claude Desktop
To use the containerized server with Claude Desktop, update the configuration to use Docker with the environment variables:
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 Docker with HTTP Transport
For HTTP mode deployment, you can use the following Docker configuration:
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:
You can then create a virtual environment and install the dependencies with:
Project Structure
The project has been organized with a src directory structure:
Testing
The project includes a comprehensive test suite that ensures functionality and helps prevent regressions.
Run the tests with pytest:
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.
Available Tools
Tool | Category | Description | Parameters |
| Query | Execute a KQL query against Azure Data Explorer |
(string) - KQL query to execute |
| Discovery | List all tables in the configured database | None |
| Discovery | Get the schema for a specific table |
(string) - Name of the table |
| Discovery | Get sample data from a table |
(string),
(int, default: 10) |
| Discovery | Get table statistics and metadata |
(string) - Name of the table |
Configuration
Required Environment Variables
Variable | Description | Example |
| Azure Data Explorer cluster URL |
|
| Database name to connect to |
|
Optional Environment Variables
Azure Workload Identity (for AKS)
Variable | Description | Default |
| Azure AD tenant ID | - |
| Azure AD client/application ID | - |
| Path to workload identity token file |
|
MCP Server Configuration
Variable | Description | Default |
| Transport mode:
,
, or
|
|
| Host to bind to (HTTP/SSE only) |
|
| Port to bind to (HTTP/SSE only) |
|
Logging
Variable | Description | Default |
| Logging level:
,
,
,
|
|
License
MIT