KustoAgentMCP

Yucheng-Ren/KustoAgentMCP

3.2

If you are the rightful owner of KustoAgentMCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Kusto MCP Server is a .NET 9 Model Context Protocol server that provides HTTP endpoints for Azure Data Explorer operations using JSON-RPC 2.0.

Tools
6
Resources
0
Prompts
0

Kusto MCP Server

A .NET 9 Model Context Protocol (MCP) server that exposes Azure Data Explorer (Kusto) operations as HTTP endpoints speaking JSON-RPC 2.0. The server listens on a configurable loopback address and can be attached to any MCP-compatible client that understands HTTP transports.

Features

  • HTTP transport with JSON-RPC 2.0 request/response semantics, including initialize/ping/shutdown.
  • Kusto-aware tooling for queries and workflow error analysis.
  • Structured results surfaced through the MCP structuredContent channel plus human-readable text summaries.
  • Azure-ready authentication via Managed Identity, Service Principal, Device Code, Interactive browser, or Azure CLI.
  • Production hardening inherited from the original agent: retry logic, logging, configurable timeouts, and health-check endpoint.
  • MCP Prompts for guided multi-step workflows like Power Flow error analysis.

Supported tools

Tool nameDescriptionRequired arguments
kusto_execute_queryExecute an arbitrary KQL query. Returns result rows and timing metrics.query
kusto_workflow_errors_templateRuns the predefined workflow error analysis template.actionName, environmentId
kusto_powerflow_daily_errorAnalyze Power Flow errors from the last 24 hours.(none)
kusto_is_customizationCheck if an object is a customization.objectName

The JSON schemas for inputs/outputs are advertised through tools/list so MCP clients can render forms and validate payloads automatically.

Supported prompts

Prompt nameDescription
powerflow_error_analysisMulti-step workflow to analyze Power Flow errors: runs daily error check, queries detailed errors for each failure, and identifies root causes.

Quick start

  1. Restore & build

    dotnet restore
    dotnet build
    
  2. Configure credentials Edit appsettings.json (or set equivalent environment variables) with your cluster information:

    {
      "KustoSettings": {
        "ClusterUri": "https://<cluster>.<region>.kusto.windows.net/",
        "DefaultDatabase": "YourDatabase",
        "AuthenticationMethod": "ManagedIdentity"
      },
      "ManagedIdentity": {
        "ClientId": "<optional-user-assigned-client-id>"
      },
      "ServicePrincipal": {
        "TenantId": "<tenant>",
        "ClientId": "<app-id>",
        "ClientSecret": "<secret>"
      },
      "McpServer": {
        "UrlPrefix": "http://127.0.0.1:8080/",
        "EnableCors": false
      }
    }
    
  3. Run the MCP server

    dotnet run
    

    The process listens for HTTP requests (default http://127.0.0.1:8080/) and exposes a health probe at /healthz.

  4. Call the server

    • OpenAI Desktop / MCP: configure an HTTP transport pointing to the server URL.

    • cURL / custom tooling:

      curl -s http://127.0.0.1:8080/ \
        -H 'Content-Type: application/json' \
        -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"1.0","capabilities":{},"clientInfo":{"name":"demo","version":"1.0"}}}'
      
    • Python (mcp package):

      mcp client http --url http://127.0.0.1:8080/
      

Configuration reference

Configuration is provided through appsettings.json, environment variables, or any IConfiguration provider supported by the .NET host.

  • KustoSettings.ClusterUri — required cluster URI.
  • KustoSettings.DefaultDatabase — fallback database when tool input omits one.
  • KustoSettings.AuthenticationMethodInteractive, ManagedIdentity, ServicePrincipal, DeviceCode, or AzureCli.
  • KustoSettings.EnableRetryLogic, MaxRetryAttempts, RetryDelaySeconds — control retry behaviour.
  • ManagedIdentity.ClientId — optional user-assigned identity.
  • ServicePrincipal.TenantId, ClientId, ClientSecret — required for service principal auth.
  • McpServer.UrlPrefix — HTTP listener prefix (must end with /), defaults to http://127.0.0.1:8080/.
  • McpServer.EnableCors / AllowedOrigins — enable and customise permissive CORS headers for browser-based clients.
  • McpServer.HealthcheckPath — path of the health probe (default /healthz).

Logging defaults to Information level and can be overridden via the standard Logging:LogLevel:Default configuration key.

Structured responses

Clients can use the structured payload for programmatic flows while displaying the text snippets for humans.