adx-mcp-server
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.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@adx-mcp-server show me the top 10 customers by purchase amount this month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Azure Data Explorer MCP Server
A Model Context Protocol (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: EdgeLake 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:
# 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 = 8080Azure 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:
{
"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 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:
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-serverUsing docker-compose:
Create a .env file with your Azure Data Explorer credentials and then run:
docker-compose upRunning 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 Docker with HTTP Transport
For HTTP mode deployment, you can use the following Docker configuration:
{
"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"
}
}
}
}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 | shYou 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 fileTesting
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-missingTests 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 |
|
| Discovery | List all tables in the configured database | None |
| Discovery | Get the schema for a specific table |
|
| Discovery | Get sample data from a table |
|
| Discovery | Get table statistics and metadata |
|
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: |
|
| Host to bind to (HTTP/SSE only) |
|
| Port to bind to (HTTP/SSE only) |
|
Logging
Variable | Description | Default |
| Logging level: |
|
License
MIT
Available Tools
5 toolsexecute_queryB
Executes a Kusto Query Language (KQL) query against the configured Azure Data Explorer database and returns the results as a list of dictionaries.
Inputs: query (required). Returns: result
get_table_detailsC
Retrieves table details including TotalRowCount, HotExtentSize
Inputs: table_name (required). Returns: result
get_table_schemaB
Retrieves the schema information for a specified table in the Azure Data Explorer database, including column names, data types, and other schema-related metadata.
Inputs: table_name (required). Returns: result
list_tablesA
Retrieves a list of all tables available in the configured Azure Data Explorer database, including their names, folders, and database associations.
Inputs: no named parameters. Returns: result
sample_table_dataB
Retrieves a random sample of rows from the specified table in the Azure Data Explorer database. The sample_size parameter controls how many rows to return (default: 10).
Inputs: table_name (required), sample_size. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct purpose: listing tables, retrieving schema, retrieving details, sampling data, and executing arbitrary queries. No overlap and clear boundaries between tools.
All tool names follow a consistent verb_noun pattern (e.g., list_tables, get_table_schema, execute_query) using snake_case, making them predictable and easy to interpret.
Five tools is well-scoped for a read-only Azure Data Explorer query server, covering essential operations like listing, schema retrieval, details, sampling, and querying without unnecessary clutter.
The tool set provides a solid foundation for querying and metadata retrieval. Missing are data modification or ingestion tools, but for a query-focused server this is acceptable, though a bit more (e.g., table statistics) could enhance completeness.
Maintenance
Related MCP Connectors
Query, explore, and manage your databases through natural conversation.
Company and industrial data for AI assistants: datasets, SQL, dashboards, alarms, with approvals.
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables intelligent KQL query execution against Azure Data Explorer clusters with AI-powered schema caching and natural language to KQL conversion. Provides automated schema discovery and context-aware query assistance for enhanced data exploration.75 PyPI24MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to query and explore distributed data across EdgeLake nodes through SQL operations, resource discovery, and schema inspection. Supports complex queries with joins, aggregations, and metadata fields across multiple databases and tables.Mozilla Public 2.0
- AlicenseNot gradedqualityDmaintenanceEnables users to authenticate with Azure Data Explorer and execute KQL queries via natural language through the Model Context Protocol.512 npmMIT
- AlicenseAqualityBmaintenanceEnables AI assistants to query Azure Data Explorer using natural language, eliminating the need to write KQL.71,384 npm8MIT