Skip to main content

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 descriptions
  • get_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.

  • Add strip_whitespace and min_length arguments to the TableSchema so that edge cases like empty fields are handled robustly.
  • Add $schema as one of the field requirement in table.json.
  • Ads GitHub action to publish package to PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kusto_mcp-0.1.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kusto_mcp-0.1.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file kusto_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: kusto_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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

Hashes for kusto_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dc3d11d4a8028893a0544c6735b6954eed71e6ce0d7ff23ef0139b676aa8a6a0
MD5 4df8056c5ed8b167e0311625b9eb9710
BLAKE2b-256 4d3e715705083a09d9a17147d2605404e186aca69b7ae5e0e3834dd10547ccba

See more details on using hashes here.

File details

Details for the file kusto_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: kusto_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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

Hashes for kusto_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 65638279cfbf95778db468cac647a3b27499cf8d7eafd6d8959d8d9d9433e513
MD5 b5da0a5b917b02a926bcb886f7e2af8a
BLAKE2b-256 815510eadd65da6bf06586fd45c9cb288809b8912aa5c316055424915ffd80a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page