Skip to main content
Glama
pab1it0

adx-mcp-server

by pab1it0

Azure データ エクスプローラー MCP サーバー

Microsoft Fabric の Azure Data Explorer/Eventhouse 用のモデル コンテキスト プロトコル(MCP) サーバー。

これにより、標準化された MCP インターフェイスを介して Azure Data Explorer/Eventhouse クラスターとデータベースにアクセスできるようになり、AI アシスタントが KQL クエリを実行してデータを探索できるようになります。

特徴

  • [x] Azure Data Explorerに対してKQLクエリを実行する

  • [x] データベースリソースの検出と探索

    • [x] 設定されたデータベース内のテーブルを一覧表示する

    • [x] テーブルスキーマの表示

    • [x] 表からのサンプルデータ

    • [x] テーブルの統計/詳細を取得する

  • [x] 認証サポート

    • [x] トークン資格情報のサポート (Azure CLI、MSI など)

    • [x] AKS のワークロード ID 資格情報のサポート

  • [x] Dockerコンテナ化のサポート

  • [x] AIアシスタントのためのインタラクティブツールを提供する

ツールリストは設定可能なので、MCPクライアントで利用できるようにするツールを選択できます。これは、特定の機能を使用しない場合や、コンテキストウィンドウをあまり占有したくない場合に便利です。

Related MCP server: EdgeLake MCP Server

使用法

  1. Azure CLI を使用して、ADX クラスターへのアクセス許可を持つ Azure アカウントにログインします。

  2. .envファイルまたはシステム環境変数を使用して、ADX クラスターの環境変数を構成します。

# 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

Azure ワークロード ID サポート

ワークロード ID が構成された Azure Kubernetes Service (AKS) 環境で実行されている場合、サーバーはデフォルトで WorkloadIdentityCredential を使用するようになりました。必要な環境変数が存在する場合は常に、WorkloadIdentityCredential の使用が優先されます。

Azure Workload Identity を使用した AKS の場合、必要なのは次の点だけです。

  1. ポッドにAZURE_TENANT_IDとAZURE_CLIENT_ID環境変数が設定されていることを確認します。

  2. トークン ファイルがデフォルトのパスにマウントされていることを確認するか、 ADX_TOKEN_FILE_PATHでカスタム パスを指定します。

これらの環境変数が存在しない場合、サーバーは自動的に DefaultAzureCredential にフォールバックし、複数の認証方法を順番に試行します。

  1. サーバー設定をクライアント設定ファイルに追加します。例えば、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"
      }
    }
  }
}

注意: Claude Desktop でError: spawn uv ENOENT表示される場合は、 uvへのフル パスを指定するか、構成で環境変数NO_UV=1を設定する必要があります。

Dockerの使用

このプロジェクトには、簡単な展開と分離を実現する Docker サポートが含まれています。

Dockerイメージの構築

次を使用して Docker イメージをビルドします。

docker build -t adx-mcp-server .

Dockerで実行する

Docker を使用してサーバーを実行するにはいくつかの方法があります。

docker run を直接使用する:

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

docker-compose を使用する:

Azure Data Explorer の資格情報を使用して.envファイルを作成し、次を実行します。

docker-compose up

Claude Desktop で Docker を実行する

Claude Desktop でコンテナ化されたサーバーを使用するには、環境変数を使用して Docker を使用するように構成を更新します。

{
  "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"
      }
    }
  }
}

この構成では、変数名のみを指定した-eフラグを使用し、 envオブジェクトに実際の値を指定して、Claude Desktop から Docker コンテナーに環境変数を渡します。

開発コンテナ / GitHub Codespace として使用する

このリポジトリは、シームレスな開発環境を実現する開発コンテナとしても使用できます。開発コンテナのセットアップはdevcontainer-feature/adx-mcp-serverフォルダにあります。

詳細については、 devcontainer README を参照してください。

発達

貢献を歓迎します!ご提案や改善点がありましたら、問題を報告するか、プルリクエストを送信してください。

このプロジェクトは依存関係の管理にuvを使用しています。お使いのプラットフォームの手順に従ってuvをインストールしてください。

curl -LsSf https://astral.sh/uv/install.sh | sh

次に、次のコマンドで仮想環境を作成し、依存関係をインストールします。

uv venv
source .venv/bin/activate  # On Unix/macOS
.venv\Scripts\activate     # On Windows
uv pip install -e .

プロジェクト構造

プロジェクトはsrcディレクトリ構造で構成されています:

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

テスト

このプロジェクトには、機能性を保証し、回帰を防ぐのに役立つ包括的なテスト スイートが含まれています。

pytest でテストを実行します。

# Install development dependencies
uv pip install -e ".[dev]"

# Run the tests
pytest

# Run with coverage report
pytest --cov=src --cov-report=term-missing

テストは次のように分類されます:

  • 構成検証テスト

  • サーバー機能テスト

  • エラー処理テスト

  • 主なアプリケーションテスト

新しい機能を追加する場合は、対応するテストも追加してください。

ツール

道具

カテゴリ

説明

execute_query

クエリ

Azure Data Explorer に対して KQL クエリを実行する

list_tables

発見

構成されたデータベース内のすべてのテーブルを一覧表示する

get_table_schema

発見

特定のテーブルのスキーマを取得する

sample_table_data

発見

オプションのサンプルサイズでテーブルからサンプルデータを取得する

ライセンス

マサチューセッツ工科大学


Available Tools

5 tools
execute_queryB

Executes a Kusto Query Language (KQL) query against the configured Azure Data Explorer database and returns the results as a list of dictionaries.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.2/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters2/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
table_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness3/5

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.

Completeness2/5

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.

Parameters1/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
table_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness3/5

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.

Parameters2/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
table_nameYes
sample_sizeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters2/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv1.1.0
    • Changedexecute_query1 field changed
      • addedInput schema / additionalProperties
        Added value: +false
    • Changedget_table_details1 field changed
      • addedInput schema / additionalProperties
        Added value: +false
    • Changedget_table_schema1 field changed
      • addedInput schema / additionalProperties
        Added value: +false
    • Changedlist_tables1 field changed
      • addedInput schema / additionalProperties
        Added value: +false
    • Changedsample_table_data1 field changed
      • addedInput schema / additionalProperties
        Added value: +false
  2. 5 tool updatesv1.0.0
    • Changedexecute_query3 fields changed
      • removedInput schema / properties / query / title
        Removed value: -"Query"
      • removedInput schema / title
        Removed value: -"execute_queryArguments"
      • changedOutput schema / (root)
        Previous value: -nullNew value: +{
        +  "properties": {
        +    "result": {
        +      "items": {
        +        "additionalProperties": true,
        +        "type": "object"
        +      },
        +      "type": "array"
        +    }
        +  },
        +  "required": [
        +    "result"
        +  ],
        +  "type": "object",
        +  "x-fastmcp-wrap-result": true
        +}
    • Addedget_table_details
    • Changedget_table_schema3 fields changed
      • removedInput schema / properties / table_name / title
        Removed value: -"Table Name"
      • removedInput schema / title
        Removed value: -"get_table_schemaArguments"
      • changedOutput schema / (root)
        Previous value: -nullNew value: +{
        +  "properties": {
        +    "result": {
        +      "items": {
        +        "additionalProperties": true,
        +        "type": "object"
        +      },
        +      "type": "array"
        +    }
        +  },
        +  "required": [
        +    "result"
        +  ],
        +  "type": "object",
        +  "x-fastmcp-wrap-result": true
        +}
    • Changedlist_tables2 fields changed
      • removedInput schema / title
        Removed value: -"list_tablesArguments"
      • changedOutput schema / (root)
        Previous value: -nullNew value: +{
        +  "properties": {
        +    "result": {
        +      "items": {
        +        "additionalProperties": true,
        +        "type": "object"
        +      },
        +      "type": "array"
        +    }
        +  },
        +  "required": [
        +    "result"
        +  ],
        +  "type": "object",
        +  "x-fastmcp-wrap-result": true
        +}
    • Changedsample_table_data4 fields changed
      • removedInput schema / properties / sample_size / title
        Removed value: -"Sample Size"
      • removedInput schema / properties / table_name / title
        Removed value: -"Table Name"
      • removedInput schema / title
        Removed value: -"sample_table_dataArguments"
      • changedOutput schema / (root)
        Previous value: -nullNew value: +{
        +  "properties": {
        +    "result": {
        +      "items": {
        +        "additionalProperties": true,
        +        "type": "object"
        +      },
        +      "type": "array"
        +    }
        +  },
        +  "required": [
        +    "result"
        +  ],
        +  "type": "object",
        +  "x-fastmcp-wrap-result": true
        +}
  3. 4 tool updates
    • First observedexecute_query
    • First observedget_table_schema
    • First observedlist_tables
    • First observedsample_table_data

TDQS

A3.6/5.0

Scored across 5 tools

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables 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.
    127 PyPI
    23
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables 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
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI assistants to query Azure Data Explorer using natural language, eliminating the need to write KQL.
    7
    761 npm
    7
    MIT