MCP server that exposes Kusto table schemas as tools
Project description
Introduction
Kusto MCP is a Model Context Protocol (MCP) server that exposes Kusto table schemas as tools for AI agents and LLM applications.
What it does
This server allows AI assistants to discover and understand Kusto log table structures by providing:
list_tables— A tool that returns all available tables with their descriptionsget_table_schema(table_name)— A tool that returns the full schema (columns, types, descriptions) for any specific table
Why it's useful
When writing KQL (Kusto Query Language) queries against Kusto logs, knowing the exact column names and types is essential. This MCP server gives AI agents direct access to schema information, enabling them to generate accurate queries without hallucinating column names.
Quick Start
Installation
# Using uv (recommended)
uv add kusto-mcp
# Using pip
pip install kusto-mcp
Adding custom schemas
Place your table schema JSON files in the samples/schemas/ directory relative to where your invocation of the server occurs. Each file should follow the schema format defined in schemas/table.json.
Running the server
from kusto_mcp.server import mcp
mcp.run()
Implementing a custom loader
To load schemas from other sources (API, database, etc.), subclass SchemaLoader:
from kusto_mcp.loaders import SchemaLoader
from kusto_mcp.models import TableSchema, Column
class ApiSchemaLoader(SchemaLoader):
def __init__(self, api_url: str):
self.api_url = api_url
def load_schemas(self) -> dict[str, TableSchema]:
# Fetch schemas from your API
response = requests.get(f"{self.api_url}/schemas")
schemas = {}
for data in response.json():
schema = TableSchema.model_validate(data)
schemas[schema.table_name] = schema
return schemas
Configuring the loader for MCP
To use a custom loader with the MCP server, call configure_loader() before starting:
from kusto_mcp.server import mcp, configure_loader
from your_module import ApiSchemaLoader
# Configure custom loader before server starts
configure_loader(ApiSchemaLoader("https://api.example.com"))
# Start the server
mcp.run()
Note: configure_loader() must be called before any schema access. If not configured, the server defaults to FileSchemaLoader.
Architecture
The project uses an extensible loader pattern via Python's ABC (Abstract Base Class), allowing schemas to be loaded from various sources:
FileSchemaLoader— Loads schemas from local JSON files (default)CSVSchemaLoader— Loads schemas from CSV files; use this when your table metadata is maintained in spreadsheet/tabular form rather than per-table JSON documents- Custom loaders can be implemented to fetch schemas from APIs, databases, or other sources
SBOM and CVE Scanning
This project uses Syft for generating Software Bill of Materials (SBOM) and Grype for vulnerability scanning.
Generate SBOM
# Using Makefile
make sbom
# Or manually
syft scan uv.lock -o cyclonedx-json=sbom.json
Scan for CVE
# Using Makefile
make scan
# Or manually
grype sbom:sbom.json -v
Full Vulnerability Workflow
# Generate SBOM and scan in one step
make vuln
Functional Requirements
- Read from schema file to list available table for agent.
- Expose a list of available tables as MCP tool (currently just load from
samples/schemas). - Expose each table schema as an MCP tool.
- Use ABC so that the loading of schemas can be flexible.
Non-functional Requirements
- Use Pydantic to convert content from schema files to Pydantic objects.
To-dos
This section lists out the to-dos for the project.
- Expose operator syntax and usage example as tools so that AI doesn't hallucinate when invoking operators.
- Add
strip_whitespaceandmin_lengtharguments to theTableSchemaso that edge cases like empty fields are handled robustly. - Add
$schemaas one of the field requirement intable.json. - Add GitHub action to publish package to PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kusto_mcp-0.1.2.tar.gz.
File metadata
- Download URL: kusto_mcp-0.1.2.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48ac3333de1b925ec8a8e7fe04f3ebdea3c811f9feae5deb36782d0232c571b3
|
|
| MD5 |
91a6cd372b5ae40111ea45efd0848976
|
|
| BLAKE2b-256 |
97f5ecd6cc26deae5db54ad26301e237f9528162d11af7e16f472aa28534125e
|
File details
Details for the file kusto_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: kusto_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85b0b2576a1ef844abdfb8ce416a06b9e52f22423af9fcae15dcd4ff647de1af
|
|
| MD5 |
8c36b95055d0e01bb544b0bf4f2afbb7
|
|
| BLAKE2b-256 |
984deecad6e487ad3e6b4dba8c2198478062a7c13070715e8570b17ae4dc4563
|