Kusto Natural Language Query
STDIOConverts natural language into Kusto queries and executes them against Kusto database.
Converts natural language into Kusto queries and executes them against Kusto database.
A configurable MCP server that can convert natural language into kusto queries and execute the query against kusto database.
settings.yaml
file to give the kusto query generator the data it needs to generate queries against any databasesettings.yaml
settings.yaml
fileparameters
: an object containing the following parameters:
table
(string): name of the table as configured in the settings.yaml
filecategory
(string): category of the table as configured in the settings.yaml
fileprompt
(string): natural language prompt to execute against the provided databaseparameters
: an object containing the following parameters:
table
(string): name of the table as configured in the settings.yaml
filecategory
(string): category of the table as configured in the settings.yaml
fileprompt
(string): natural language prompt to execute against the provided databaseoutputType
('Json' or 'CSV'): output type for the responseThis 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.
settings.yaml
The MCP server takes in a --settings
argument that should point to a yaml file configured as follows:
You can configure references to environment variables in your settings.yaml file by using the ${{ENVIRONMENT_VARIABLE_NAME}}
syntax.
model: endpoint: <Azure OpenAI Endpoint> deployment: <Deployment Name> key: <Azure Open AI key>
dotnet run
instead of docker run
, and only inside of vs code.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>
managedlabs
).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"
system
, user
, assistant
).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
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 authenticateprompts
section with relevant queries and explanations as needed. The more descriptive the better.settings.yaml
file.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}", } } }
From repo root:
docker build ./src/Server/Dockerfile src