The MCP Server is designed to interface with Kusto databases, allowing you to query and manage resources effectively. This tool leverages Azure OpenAI to help interpret and generate Kusto Query Language (KQL) queries based on natural language inputs.
To use the MCP server, you need to create a configuration file and run the server with this configuration.
Create a settings.yaml
file with the following structure:
model:
endpoint: <Azure OpenAI Endpoint>
deployment: <Deployment Name>
kusto:
- name: <Table Name>
category: <Category>
database: <Database Name>
table: <Table Name>
endpoint: <Kusto Endpoint>
prompts:
- type: <Prompt Type>
content: |
<Prompt Content>
system
, user
, or assistant
Here's a complete configuration example:
model:
endpoint: https://myopenai.openai.azure.com
deployment: gpt-4
kusto:
- name: mytable
category: mycategory
database: mydatabase
table: table
endpoint: https://table.kusto.windows.net
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
To start the MCP server, use the --settings
argument pointing to your configuration file:
mcp-server --settings path/to/settings.yaml
Authentication is handled through the currently logged-in Windows user. Make sure you:
az login
if using Azure CLIThe more detailed your system prompts and examples in the configuration file, the better the model will understand your data schema and generate appropriate KQL queries.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "kusto-nl2kql" '{"command":"docker","args":["run","-i","--rm","-v","${workspaceFolder}/settings.yaml:/app/settings.yaml","-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}"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"kusto-nl2kql": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"${workspaceFolder}/settings.yaml:/app/settings.yaml",
"-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}"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"kusto-nl2kql": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"${workspaceFolder}/settings.yaml:/app/settings.yaml",
"-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}"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect