Back to MCP directory
publicPublicdnsLocal runtime

mcp_kusto

一个基于Go SDK的Azure Data Explorer MCP服务器,支持数据库查询和表结构查看。

article

README

🚀 使用MCP服务器与Azure Data Explorer(Kusto)进行Vibe查询

本项目是使用Go SDK为Azure Data Explorer(Kusto)构建的一个MCP服务器实现。借助它,你能与VS Code(或其他MCP工具)搭配使用,从而简化数据分析与探索工作。

主要功能

该MCP服务器提供了以下与Azure Data Explorer交互的功能:

  1. list_databases:列出特定Azure Data Explorer集群中的所有数据库。
  2. list_tables:列出特定Azure Data Explorer数据库中的所有表。
  3. get_table_schema:获取特定表的架构信息。
  4. execute_query:执行针对数据库的只读KQL查询。

⚠️ 重要提示

尽管希望每个人都能从中受益,但必须指出大型语言模型(LLMs)本质上是非确定性的,并且可能会出错。强烈建议在基于它们的结果或查询之前始终进行验证。

功能展示

以下是该服务器的运行示例: kusto mcp服务器运行示例

🚀 快速开始

📦 安装指南

git clone https://github.com/abhirockzz/mcp_kusto
cd mcp_kusto

go build -o mcp_kusto main.go

配置MCP服务器

配置方式会根据你使用的MCP客户端/工具而有所不同:

  • VS Code:你可以按照这些说明使用一个mcp.json文件进行配置。以下是mcp.json文件的示例:
{
  "servers": {
    "Kusto MCP服务器": {
      "type": "stdio",
      "command": "输入可执行文件的路径,例如/Users/demo/Desktop/mcp_kusto",
      "args": []
    },
    // 其他MCP服务器...
  }
}
  • Claude Desktop:以下是Claude Desktop配置的示例:
{
  "mcpServers": {
    "Kusto MCP服务器": {
      "command": "输入可执行文件的路径,例如/Users/demo/Desktop/mcp_kusto",
      "args": []
    },
    // 其他MCP服务器...
  }
}

认证

  • 权限要求:使用的用户主体必须具有对.show databases.show table.show tables和数据库上的查询执行操作的权限。有关详细信息,请参阅Azure Data Explorer文档。
  • 认证方式:为了保持安全和简单,MCP服务器使用DefaultAzureCredential。此方法会在环境变量中查找应用程序服务主体设置,或在本地安装的开发工具(如Azure CLI)中查找一组开发者凭证。这两种方法都可以用于将MCP服务器身份验证到Azure Data Explorer。例如,只需使用Azure CLI(az login)进行本地登录。

完成上述步骤后,你就可以启动VS Code、Claude Desktop或其他任何MCP工具,开始探索你的Azure Data Explorer(Kusto)集群啦!

本地开发/测试

你可以从MCP inspector开始进行本地开发和测试,命令如下:

npx @modelcontextprotocol/inspector ./mcp_kusto
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client