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.
Login to your Azure account with permissions to access the ADX cluster using Azure CLI.
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
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 build -t adx-mcp-server .
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
Create a .env
file with your Azure Data Explorer credentials and then run:
docker-compose up
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"
}
}
}
}
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"
}
}
}
}
The server uses WorkloadIdentityCredential by default when running in Azure Kubernetes Service (AKS) environments with workload identity configured. For AKS with Azure Workload Identity:
AZURE_TENANT_ID
and AZURE_CLIENT_ID
environment variables setADX_TOKEN_FILE_PATH
If these environment variables are not present, the server will automatically fall back to DefaultAzureCredential.
The MCP server provides several tools for interacting with Azure Data Explorer:
These tools can be used by AI assistants to interact with your data through the MCP interface.
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.
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.
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"
}
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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