Query and analyze Azure Data Explorer databases
This repository provides a robust and streamlined MCP server specifically designed for Azure Data Explorer (ADX). By leveraging the Model Context Protocol, this server empowers Large Language Models (LLMs) with direct access to your ADX data, enabling sophisticated AI-driven insights and automation. Imagine your AI assistant seamlessly querying your data, understanding its structure, and providing actionable intelligence – all within a standardized and secure framework.
Authentication: Ensure you are logged into your Azure account with the necessary permissions to access your ADX cluster. This is typically done via the Azure CLI:
az login
Environment Variables: Configure the following environment variables, either in a .env
file or directly in your system environment:
ADX_CLUSTER_URL=https://yourcluster.region.kusto.windows.net # Your ADX cluster URL ADX_DATABASE=your_database # The database to connect to
Client Integration: Integrate the server configuration into your LLM client. Here's an example configuration 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 encounter an Error: spawn uv ENOENT
in Claude Desktop, ensure that the full path to uv
is correctly specified or set the environment variable NO_UV=1
in the configuration.
Simplify deployment and ensure consistency with Docker.
docker build -t adx-mcp-server .
Direct Execution:
docker run -it --rm \ -e ADX_CLUSTER_URL=https://yourcluster.region.kusto.windows.net \ -e ADX_DATABASE=your_database \ adx-mcp-server
Docker Compose: Create a .env
file with your ADX credentials and execute:
docker-compose up
To leverage the containerized server within Claude Desktop, modify the configuration as follows:
{ "mcpServers": { "adx": { "command": "docker", "args": [ "run", "--rm", "-i", "-e", "ADX_CLUSTER_URL", "-e", "ADX_DATABASE", "adx-mcp-server" ], "env": { "ADX_CLUSTER_URL": "https://yourcluster.region.kusto.windows.net", "ADX_DATABASE": "your_database" } } } }
This configuration seamlessly passes environment variables from Claude Desktop to the Docker container.
We welcome contributions! Feel free to open issues or submit pull requests with suggestions and improvements.
This project utilizes uv
for dependency management.
Install uv
: Follow the installation instructions for your operating system.
curl -LsSf https://astral.sh/uv/install.sh | sh
Create Virtual Environment and Install Dependencies:
uv venv source .venv/bin/activate # On Unix/macOS .venv\Scripts\activate # On Windows uv pip install -e .
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
A comprehensive test suite is included to ensure functionality and prevent regressions.
Install Development Dependencies:
uv pip install -e ".[dev]"
Run Tests:
pytest
Run with Coverage Report:
pytest --cov=src --cov-report=term-missing
The test suite covers:
When introducing new features, please include corresponding tests.
Tool | Category | Description |
---|---|---|
execute_query | Query | Executes a KQL query against Azure Data Explorer. |
list_tables | Discovery | Lists all tables in the configured database. |
get_table_schema | Discovery | Retrieves the schema for a specific table. |
sample_table_data | Discovery | Retrieves sample data from a table with an optional sample size parameter. |
This project is licensed under the MIT License.
🐍 ☁️ Biomedical research server providing access to PubMed, ClinicalTrials.gov, and MyVariant.info.
🐍 MCP server that provides SQL analysis, linting, and dialect conversion using [SQLGlot](https://github.com/tobymao/sqlglot)
🐍 🏠 All-in-one MCP server for Postgres development and operations, with tools for performance analysis, tuning, and health checks
Supabase MCP Server with support for SQL query execution and database exploration tools