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 "Install 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-servershow 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.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description must disclose behavioral traits. It only states that the tool returns a list of dictionaries but does not mention whether queries can modify data, rate limits, or pagination behavior. The lack of safety disclaimers is a gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that immediately conveys the core action and result format. No unnecessary words or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simplicity of the tool (one parameter) and the presence of an output schema (not shown but indicated), the description covers the essential action. However, it lacks usage guidance and behavioral transparency, making it only minimally adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The single parameter 'query' has no schema description (0% coverage). The description adds the phrase 'Kusto Query Language (KQL)' which clarifies the language but does not explain expected syntax, format, or examples. The value added beyond the schema is minimal.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the tool as executing a KQL query against Azure Data Explorer, with a specific verb ('executes') and resource ('KQL query'). It distinguishes itself from siblings like get_table_details by being the only tool that runs arbitrary queries.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like list_tables or sample_table_data. There is no mention of prerequisites, safety considerations, or typical use cases.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_table_detailsC
Retrieves table details including TotalRowCount, HotExtentSize
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It only states 'retrieves', hinting at read-only, but doesn't disclose auth needs, performance impact, or other behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence is concise, but it is too brief to be fully informative. It could include more detail without being verbose, such as stating it's a read operation.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Output schema exists, so return values are covered. However, the description lacks context on when to use, parameter details, and behavioral traits, making it incomplete for an agent's decision.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has one parameter (table_name) with 0% description coverage. The description does not explain the parameter format, constraints, or valid values, adding no value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves table details and lists specific metrics (TotalRowCount, HotExtentSize). It distinguishes from sibling tools like get_table_schema (schema) and sample_table_data (samples).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool vs alternatives. Usage is implied by the description of retrieving row count and extent size, but no conditions or exclusions are stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description must fully disclose behavior. It states the action but does not mention read-only safety, error handling (e.g., if table does not exist), or any prerequisites. For a read operation, minimal but still insufficient given zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence that is concise and directly states the purpose. No wasted words, but could be slightly more structured (e.g., separating purpose and details). Still effective and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given presence of output schema, description need not explain return values. For a simple one-parameter tool, the description covers the core function but misses usage guidelines and parameter details. Minimal viable but with clear gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema has one parameter (table_name) with 0% description coverage. The tool description does not elaborate on table_name format, expected values, or constraints. With low schema coverage, the description should compensate but fails to add meaning beyond the parameter name.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the verb 'retrieves', the resource 'schema information for a specified table', and includes specifics like 'column names, data types, and other schema-related metadata'. It easily distinguishes from siblings like 'execute_query' (runs queries) and 'list_tables' (lists tables).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. For example, it does not explain that this is for schema metadata only, while 'get_table_details' might include more. Lacks any explicit context or exclusion criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_tablesA
Retrieves a list of all tables available in the configured Azure Data Explorer database, including their names, folders, and database associations.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It indicates a read operation (retrieves) without mentioning side effects, auth needs, or rate limits. For a simple list operation, this is minimally adequate but lacks explicit disclosure of read-only behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, front-loaded with verb 'Retrieves'. Every word adds value with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Complexity is low (empty schema, 0 parameters). Description covers what the tool returns (table names, folders, database associations). Presence of an output schema reduces burden, and the description aligns well.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema has no parameters (100% coverage), so baseline is 3. The description adds no parameter details, which is acceptable since there are none.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool retrieves a list of all tables in the Azure Data Explorer database, specifying the returned fields (names, folders, database associations). This distinguishes it from sibling tools like get_table_details or get_table_schema which focus on individual tables or schemas.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. The description does not mention when to use list_tables instead of execute_query, get_table_details, etc. Context about use cases or exclusions is absent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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).
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes | ||
| sample_size | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose behavior but only mentions sampling and sample_size default. It does not state whether the operation is read-only, the nature of randomness, or implications for large tables. Minimal transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with purpose, no redundant words. Efficiently communicates core function and key parameter.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the output schema exists, the description need not detail return values, but lacks context like the source database name (implied in description), column selection, or ordering. Sufficient for a simple sampling tool but minimal.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0% so description must compensate. It explains sample_size (default 10) but provides no meaning for table_name beyond its existence. Half the parameters are undocumented in meaning.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it retrieves a random sample of rows from a specified table in Azure Data Explorer. It uses a specific verb and resource, and implicitly distinguishes from sibling tools like list_tables or execute_query by specifying sampling behavior.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use when a random sample is needed, but provides no explicit guidance on when to use this tool versus alternatives (e.g., execute_query for custom queries). No when-not or context about prerequisites is given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Ask data questions in natural language. Get SQL, insights, and charts from your databases.
Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...
Explore and query your data warehouse through Myriade's AI data analyst agent.
Find relevant security data from Sentinel data lake for building effective agents. More:aka.ms/s/de
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables 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.23MIT
- 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.225MIT
- AlicenseAqualityAmaintenanceEnables AI assistants to query Azure Data Explorer using natural language, eliminating the need to write KQL.72187MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pab1it0/adx-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server