Cover image
Try Now
2025-04-14

Ein konfigurierbarer MCP -Server zur Übersetzung der natürlichen Sprache in Kusto -Abfragen

3 years

Works with Finder

2

Github Watches

0

Github Forks

2

Github Stars

Natural Language to Kusto Query MCP Server

A configurable MCP server that can convert natural language into kusto queries and execute the query against kusto database.

Features

  • Fully configurable: provide a settings.yaml file to give the kusto query generator the data it needs to generate queries against any database
  • Generate: returns a kusto query based on the given natural language prompt
  • Execute: generate and execute a query based on the given natural language prompt. Output responses as JSON or in a CSV file
  • Multiple databases: configure multiple databases in settings.yaml

Tools

  • list-supported-tables
    • Lists the supported tables as provided in the settings.yaml file
  • generate-kusto-query
    • Generates a kusto query against the provided table for the given prompt
    • Inputs:
      • parameters: an object containing the following parameters:
        • table (string): name of the table as configured in the settings.yaml file
        • category (string): category of the table as configured in the settings.yaml file
        • prompt (string): natural language prompt to execute against the provided database
  • execute-kusto-query
  • Generates a kusto query against the provided table for the given prompt
  • Inputs:
    • parameters: an object containing the following parameters:
      • table (string): name of the table as configured in the settings.yaml file
      • category (string): category of the table as configured in the settings.yaml file
      • prompt (string): natural language prompt to execute against the provided database
      • outputType ('Json' or 'CSV'): output type for the response

Configuration

This project is designed to interact with Kusto databases and provides tools for querying and managing resources. Below are the steps to configure the project using the settings.yaml file.

Configuration File: settings.yaml

The MCP server takes in a --settings argument that should point to a yaml file configured as follows:

Environment variable references

You can configure references to environment variables in your settings.yaml file by using the ${{ENVIRONMENT_VARIABLE_NAME}} syntax.

Model Configuration

model:
  endpoint: <Azure OpenAI Endpoint>
  deployment: <Deployment Name>
  key: <Azure Open AI key>
  • endpoint: The Azure OpenAI endpoint URL.
  • deployment: The name of the deployment to use.
  • key (optional): An optional key for the given Azure OpenAI endpoint. If a key is not provided, the tool will attempt to use the default azure credentials to execute on behalf of the user. This fallback currently only works if you run the server using dotnet run instead of docker run, and only inside of vs code.

Kusto Configuration

kusto:
  - name: <Table Name>
    category: <Category>
    database: <Database Name>
    table: <Table Name>
    endpoint: <Kusto Endpoint>
    accessToken: <Access Token>
    prompts:
      - type: <Prompt Type>
        content: |
          <Prompt Content>
  • name: The name of the Kusto table.
  • category: The category of the Kusto table (e.g., managedlabs).
  • database: The name of the Kusto database.
  • table: The name of the table in the Kusto database.
  • endpoint: The Kusto endpoint URL.
  • accessToken (optional): An optional user access token that can be used to connect to the given kusto database. If an access token is not provided, the tool will attempt to use the default azure credentials to execute on behalf of the user. This fallback currently only works if you run the server using dotnet run instead of docker run, and only inside of vs code. To generate an access token for a kusto database, you can run the following:
    az login
    az account get-access-token --resource "your-kusto-database-url" --query "accessToken"
    
  • prompts: A list of prompts used for querying the Kusto database.
    • type: The type of the prompt (e.g., system, user, assistant).
    • content: The content of the prompt, which can include KQL queries and explanations.

Example Configuration

Below is an example configuration for the settings.yaml file:

model:
  endpoint: https://my-oai-resource.openai.azure.com
  deployment: my-deployment
  key: ${{ AZURE_OPENAI_KEY }}

kusto:
  - name: mytable
    category: mycategory
    database: mydatabase
    table: table
    endpoint: https://table.kusto.windows.net
    accessToken: ${{ MYTABLE_KUSTO_ACCESS_TOKEN }}
    prompts:
      - type: system
        content: |
          The table contains the following columns:
          * Id: id of the resource
          * Name: name of the resource
          * CreationTime: timestamp when the resource was created
          * LastModified: timestamp when the resource was last modified
          * Owner: owner of the resource
      - type: user
        content: When was the resource 'my resource' created in mycategory/mytable?
      - type: assistant
        content: |
          table
          | where name == 'my resource'
          | project CreationTime
      - type: user
        content: How many resources were created after April 1st, 2025?
      - type: assistant
        content: |
          table
          | where CreationTime > datetime(2025-04-01)
          | summarize count()
      - type: user
        content: Which owner owns the most resources in mycategory/mytable?
      - type: assistant
        content: |
          table
          | summarize Resources=count() by Owner
          | order by Resources desc
          | take 1
          | project Owner

Notes

  • Ensure that the endpoint URLs are correct and accessible. Authentication is done via the currently logged in user in Windows. You may need to run az login or ensure that you are logged into to VSCode/VS to be able to authenticate
  • Update the prompts section with relevant queries and explanations as needed. The more descriptive the better.
  • Use the example configuration as a template to set up your own settings.yaml file.

Usage with VS Code

Add this to your .vscode/mcp.json:

{
  "inputs": [
    {
        "type": "promptString",
        "id": "azure-open-ai-key",
        "description": "Enter your Azure OpenAI key",
        "password": true
    },
    {
        "type": "promptString",
        "id": "kusto-token",
        "description": "Enter your Kusto token",
        "password": true
    }
  ],
  "kusto": {
    "type": "stdio",
    "command": "docker",
    "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "/path/to/settings.yaml:/app/settings.yaml", // Enter path to settings.yaml file. Can use vscode variables
        // Include environment variables that are references in settings.yaml file
        "-e",
        "AZURE_OPENAI_KEY",
        "-e",
        "KUSTO_ACCESS_TOKEN",
        "alexeyler/kusto-mcp-server",
    ],
    "env": {
        "AZURE_OPENAI_KEY": "${input:azure-open-ai-key}",
        "KUSTO_ACCESS_TOKEN": "${input:kusto-token}",
    }
  }
}

Build

From repo root: docker build ./src/Server/Dockerfile src

相关推荐

  • av
  • Führen Sie mühelos LLM -Backends, APIs, Frontends und Dienste mit einem Befehl aus.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llm 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Zusammenfassung der weltbesten LLM -Ressourcen.

  • 1Panel-dev
  • 🔥 1Panel bietet eine intuitive Weboberfläche und einen MCP -Server, um Websites, Dateien, Container, Datenbanken und LLMs auf einem Linux -Server zu verwalten.

  • rulego
  • ⛓️Rugele ist ein leichter, leistungsstarker, leistungsstarker, eingebetteter Komponenten-Orchestrierungsregel-Motor-Rahmen für GO.

  • lasso-security
  • Ein Plugin-basiertes Gateway, das andere MCPs orchestriert und es Entwicklern ermöglicht, auf IT-Agenten zu bauen.

  • Byaidu
  • PDF wissenschaftliche Papierübersetzung mit erhaltenen Formaten - 基于 ai 完整保留排版的 pdf 文档全文双语翻译 , 支持 支持 支持 支持 google/deeptl/ollama/openai 等服务 提供 cli/gui/mcp/docker/zotero

  • hkr04
  • Leichtes C ++ MCP (Modellkontextprotokoll) SDK

  • sigoden
  • Erstellen Sie einfach LLM -Tools und -Argarten mit einfachen Bash/JavaScript/Python -Funktionen.

  • RockChinQ
  • 😎简单易用、🧩丰富生态 - 大模型原生即时通信机器人平台 | 适配 qq / 微信(企业微信、个人微信) / 飞书 / 钉钉 / diskord / telegram / slack 等平台 | 支持 Chatgpt 、 Deepseek 、 Diffy 、 Claude 、 Gemini 、 xai 、 ppio 、 、 ulama 、 lm Studio 、阿里云百炼、火山方舟、 siliconflow 、 qwen 、 mondshot 、 chatglm 、 sillytraven 、 mcp 等 llm 的机器人 / agent | LLM-basierte Instant Messaging Bots-Plattform, unterstützt Zwietracht, Telegramm, Wechat, Lark, Dingtalk, QQ, Slack

  • modelscope
  • Bauen Sie LLM-Multi-Agent-Anwendungen auf einfachere Weise auf.

    Reviews

    3 (6)
    Avatar
    user_96r4nVRq
    2025-04-25

    As a dedicated user of the kusto-mcp application created by alexneyler, I can confidently say it’s an exceptional tool for data enthusiasts. The seamless integration and intuitive UI make it a standout product in its category. Using it has significantly streamlined my workflow, and the welcoming interface ensures I always feel supported. Highly recommended!

    Avatar
    user_nsxzysaM
    2025-04-25

    I've been using Kusto-MCP by Alexneyler for several weeks now, and it has significantly streamlined my data management tasks. The user interface is intuitive, making it easy for both beginners and seasoned professionals. The integration with existing systems is seamless, and the performance is remarkably efficient. Highly recommend this tool to anyone looking for a reliable solution in data management!

    Avatar
    user_87mKazrV
    2025-04-25

    As a dedicated user of kusto-mcp by alexneyler, I find it incredibly efficient and user-friendly for managing tasks. The seamless integration and robust features greatly enhance my productivity. Highly recommend this app for anyone looking for an effective task management tool!

    Avatar
    user_TtY3Yxd8
    2025-04-25

    As a dedicated user of kusto-mcp, I must say that this application has greatly enhanced my data querying and analysis experience. Created by the talented alexneyler, kusto-mcp is user-friendly, efficient, and robust. It's an indispensable tool for anyone looking to streamline their workflow in a concise and effective manner. Highly recommended!

    Avatar
    user_a5zl5iF2
    2025-04-25

    Kusto-mcp is a phenomenal application designed by Alexneyler. Its intuitive interface and robust features make data querying seamless and efficient. As a dedicated user, I appreciate the smooth integration and real-time analytics it offers. Highly recommend for anyone looking to enhance their data management experience.

    Avatar
    user_OlkRMVnO
    2025-04-25

    As a dedicated user of Kusto-MCP, I have found it to be an incredibly efficient and reliable tool. Developed by AlexNeyler, it stands out for its seamless integration and user-friendly interface. The performance and functionality of Kusto-MCP have significantly enhanced my productivity, making data queries and management a breeze. Highly recommended for anyone in need of a robust MCP application!