Skip to content
Back to search

fabric-rti-mcp

MCP server for Fabric Real-Time Intelligence (https://aka.ms/fabricrti) supporting tools for Eventhouse (https://aka.ms/eventhouse), Azure Data Explorer (https://aka.ms/adx, and other RTI services (coming soon)

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/microsoft/fabric-rti-mcp with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/microsoft/fabric-rti-mcp'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/microsoft--fabric-rti-mcp/badge.svg)](/listings/microsoft--fabric-rti-mcp)

HTML

<a href="/listings/microsoft--fabric-rti-mcp"><img src="/api/listings/microsoft--fabric-rti-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

Prerequisites

1. Install either the stable or Insiders release of VS Code: * [๐Ÿ’ซ Stable release](https://code.visualstudio.com/download) * [๐Ÿ”ฎ Insiders release](https://code.visualstudio.com/insiders) 2. Install the [GitHub Copilot](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot) and [GitHub Copilot Chat](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat) extensions 3. Install `uv`

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

or, check here for [other install options](https://docs.astral.sh/uv/getting-started/installation/#__tabbed_1_2)

4. Open VS Code in an empty folder

Install from PyPI (Pip)

The Fabric RTI MCP Server is available on [PyPI](https://pypi.org/project/microsoft-fabric-rti-mcp/), so you can install it using pip. This is the easiest way to install the server.

From VS Code

1. Open the command palette (Ctrl+Shift+P) and run the command `MCP: Add Server` 2. Select install from Pip 3. When prompted, enter the package name `microsoft-fabric-rti-mcp` 4. Follow the prompts to install the package and add it to your settings.json or your mcp.json file

The process should end with the below settings in your `settings.json` or your `mcp.json` file.

settings.json

{
    "mcp": {
        "servers": {
            "fabric-rti-mcp": {
                "command": "uvx",
                "args": [
                    "microsoft-fabric-rti-mcp"
                ],
                "env": {
                    "KUSTO_SERVICE_URI": "https://help.kusto.windows.net/",
                    "KUSTO_SERVICE_DEFAULT_DB": "Samples",
                    "FABRIC_API_BASE": "https://api.fabric.microsoft.com/v1"
                }
            }
        }
    }
}

> **Note**: All environment variables are optional. The `KUSTO_SERVICE_URI` and `KUSTO_SERVICE_DEFAULT_DB` provide default cluster and database settings. `AZ_OPENAI_EMBEDDING_ENDPOINT` configures the default AOAI embedding method used by `kusto_get_shots`.

From GitHub Copilot CLI

Use the interactive command within a GitHub Copilot CLI session:

/mcp add

Or manually add to your `~/.copilot/mcp-config.json`:

{
    "mcpServers": {
        "fabric-rti-mcp": {
            "command": "uvx",
            "args": [
                "microsoft-fabric-rti-mcp"
            ],
            "env": {
                "KUSTO_SERVICE_URI": "https://help.kusto.windows.net/",
                "KUSTO_SERVICE_DEFAULT_DB": "Samples",
                "FABRIC_API_BASE": "https://api.fabric.microsoft.com/v1"
            }
        }
    }
}

For more information, see the [GitHub Copilot CLI documentation](https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli).

๐Ÿ”ง Manual Install (Install from source)

1. Make sure you have Python 3.10+ installed properly and added to your PATH. 2. Clone the repository 3. Install the dependencies (`pip install .` or `uv tool install .`) 4. Add the settings below into your vscode `settings.json` or your `mcp.json` file. 5. Modify the path to match the repo location on your machine. 6. Modify the cluster uri in the settings to match your cluster. 7. Modify the cluster default database in the settings to match your database. 8. Modify the embeddings endpoint in the settings to match yours. This step is optional and needed only in case you supply a shots table

{
    "mcp": {
        "servers": {
            "fabric-rti-mcp": {
                "command": "uv",
                "args": [
                    "--directory",
                    "C:/path/to/fabric-rti-mcp/",
                    "run",
                    "-m",
                    "fabric_rti_mcp.server"
                ],
                "env": {
                    "KUSTO_SERVICE_URI": "https://help.kusto.windows.net/",
                    "KUSTO_SERVICE_DEFAULT_DB": "Samples",

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md ยท README ยท 572 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. [![Install with UVX in VS Code](https://img.shields.io/badge/VS_Code-Install_Microsoft_Fabric_RTI_MCP_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=ms-fabric-rti&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22microsoft-fabric-rti-mcp%22%5D%7D) [![PyPI Downloads](https://static.pepy.tech/badge/microsoft-fabric-rti-mcp)](https://pepy.tech/projects/microsoft-fabric-rti-mcp)
  2. ## ๐ŸŽฏ Overview
  3. A comprehensive Model Context Protocol (MCP) server implementation for [Microsoft Fabric Real-Time Intelligence (RTI)](https://aka.ms/fabricrti).
  4. This server enables AI agents to interact with Fabric RTI services by providing tools through the MCP interface, allowing for seamless data querying, analysis, and streaming capabilities.
  5. > [!NOTE]
  6. > This project is in Public Preview and implementation may significantly change prior to General Availability.
  7. ### ๐Ÿ” How It Works
  8. The Fabric RTI MCP Server acts as a bridge between AI agents and Microsoft Fabric RTI services:
  9. - ๐Ÿ”„ **MCP Protocol**: Uses the Model Context Protocol to expose Fabric RTI capabilities as tools
  10. - ๐Ÿ—๏ธ **Natural Language to KQL**: AI agents can translate natural language requests into KQL queries and Eventstream management
  11. - ๐Ÿ’ก **Secure Authentication**: Leverages Azure Identity for seamless, secure access to your resources
  12. - โšก **Real-time Data Access**: Direct connection to Eventhouse and Eventstreams for live data analysis
  13. - ๐Ÿ“Š **Unified Interface**: For both analytics and streaming workloads with intelligent parameter suggestions
  14. ### โœจ Supported Services
  15. **Eventhouse (Kusto)**: Execute KQL queries against Microsoft Fabric RTI [Eventhouse](https://aka.ms/eventhouse) and [Azure Data Explorer (ADX)](https://aka.ms/adx).
  16. **Eventstreams**: Manage Microsoft Fabric [Eventstreams](https://learn.microsoft.com/en-us/fabric/real-time-intelligence/event-streams/overview) for real-time data processing:
  17. - List Eventstreams in workspaces
  18. - Get Eventstream details and definitions
  19. - Create new Eventstreams
  20. - Update existing Eventstreams
  21. - Delete Eventstreams
  22. **Activator**: Create and manage Microsoft Fabric [Activator](https://learn.microsoft.com/en-us/fabric/real-time-intelligence/data-activator/activator-introduction) triggers for real-time alerting:
  23. - Create new triggers with KQL source monitoring
  24. - Set up email and Teams notifications when a condition occurs
  25. - List Activator artifacts in workspaces
  26. **Map**: Create and manage Microsoft Fabric [Map](https://learn.microsoft.com/en-us/fabric/real-time-intelligence/map/create-map) to visualize geospatial data:
  27. - Create a new map from a provided configuration
  28. - Visualize data on maps
  29. - List Map items in workspaces
  30. - Delete Map items
  31. ### ๐Ÿง  Copilot Skills
  32. This repository includes a **KQL Copilot Skill** (`.github/skills/kql/`) that gives AI agents deep KQL expertise when writing, debugging, or reviewing Kusto queries. The skill covers:
  33. - Syntax gotchas and self-correction patterns for common KQL errors
  34. - Dynamic type discipline, join patterns, datetime pitfalls
  35. - Memory-safe query patterns and result-size discipline
  36. - Advanced functions: graph queries, vector similarity, geospatial operations, time series
  37. - Query templates for deduplication, top-N, sessionization, pivoting, and more
  38. - Full error-to-fix mapping for rapid recovery
  39. The skill references the Fabric RTI MCP tools (`kusto_query`, `kusto_command`, `kusto_sample_entity`, etc.) so agents know how to execute queries through this MCP server.
  40. ## ๐Ÿšง Coming soon
  41. - **Other RTI items**
  42. ### ๐Ÿ” Example Prompts
  43. **Eventhouse Analytics:**
  44. - "Get databases in my Eventhouse"
  45. - "Sample 10 rows from table 'StormEvents' in Eventhouse"
  46. - "What can you tell me about StormEvents data?"
  47. - "Analyze the StormEvents to come up with trend analysis across past 10 years of data"
  48. - "Analyze the commands in 'CommandExecution' table and categorize them as low/medium/high risks"
  49. - "Before running this query, check the execution plan and tell me if it's expensive"
  50. - "Compare these two query approaches and tell me which is more efficient"
  51. - "Check the cluster health โ€” do we have enough capacity for a heavy analytics job?"
  52. **Eventstream Management:**
  53. - "List all Eventstreams in my workspace"
  54. - "Show me the details of my IoT data Eventstream"
  55. - "Create a new Eventstream for processing sensor data"
  56. - "Update my existing Eventstream to add a new destination"
  57. **Activator Alerts:**
  58. - "Using the StormEvents table, notify me via email when there is a flood in Illinois"
  59. - "Create a teams alert to notify me when my success rate drops below 95%"
  60. - "List all Activator artifacts in my workspace"
  61. **Map Visualization:**
  62. - "List all Map items in my workspace"
  63. - "Create a new Map and add LakeHouse with name 'MyLakeHouse' as a data source to Map item 'MyMap'"
  64. - "Delete a Map item with name 'MyMap' from my workspace"
  65. ### Available tools
  66. #### Eventhouse (Kusto) - 13 Tools + 1 Optional:
  67. - **`kusto_known_services`** - List all available Kusto services configured in the MCP
  68. - **`kusto_query`** - Execute KQL queries on the specified database
  69. - **`kusto_command`** - Execute Kusto management commands (`.show`, `.create`, `.alter`, `.drop`)
  70. - **`kusto_list_entities`** - List entities (databases, tables, external tables, materialized views, functions, graphs) in a cluster or database
  71. - **`kusto_describe_database`** - Get schema information for all entities in a database
  72. - **`kusto_describe_database_entity`** - Get detailed schema for a specific entity (table, external table, materialized view, function, graph)
  73. - **`kusto_graph_query`** - Execute graph queries using snapshots or transient graphs
  74. - **`kusto_sample_entity`** - Retrieve sample records from a table, external table, materialized view, or function
  75. - **`kusto_ingest_inline_into_table`** - Ingest inline CSV data into a specified table
  76. - **`kusto_get_shots`** *(when `KUSTO_SHOTS_TABLE` is configured)* - Find semantically similar saved KQL queries using local SLM or Azure OpenAI embeddings
  77. - **`kusto_deeplink_from_query`** - Generate a deeplink URL to open a KQL query in Azure Data Explorer Web Explorer or Microsoft Fabric query workbench
  78. - **`kusto_show_queryplan`** - Retrieve the execution plan for a KQL query without running it. Returns planning stats (PlanSize, RelopSize), the logical operator tree, and execution hints (estimated row counts, concurrency/spread hints, per-shard scan info with filter detection). Useful for comparing query approaches, catching expensive joins, and validating query syntax before execution.
  79. - **`kusto_diagnostics`** - Run a best-effort suite of cluster diagnostic commands and return a unified summary. Sections: capacity (resource slots), cluster (nodes/hardware), principal roles (caller permissions), internal diagnostics (health/utilization), workload groups, rowstores, and ingestion failures (last 24h). Each section runs independently โ€” permission failures on one section don't block others.
  80. #### Eventstreams - 17 Tools:
  81. **Core Operations (6 tools):**
  82. - **`eventstream_list`** - List all Eventstreams in your Fabric workspace
  83. - **`eventstream_get`** - Get detailed information about a specific Eventstream
  84. - **`eventstream_get_definition`** - Retrieve complete JSON definition of an Eventstream
  85. - **`eventstream_create`** - Create new Eventstreams with custom configuration (auto-includes default stream)
  86. - **`eventstream_update`** - Modify existing Eventstream settings and destinations
  87. - **`eventstream_delete`** - Remove Eventstreams and associated resources
  88. **Builder Tools (11 tools):**
  89. - **Session Management**: `eventstream_start_definition`, `eventstream_get_current_definition`, `eventstream_clear_definition`
  90. - **Sources**: `eventstream_add_sample_data_source`, `eventstream_add_custom_endpoint_source`
  91. - **Streams**: `eventstream_add_derived_stream`
  92. - **Destinations**: `eventstream_add_eventhouse_destination`, `eventstream_add_custom_endpoint_destination`
  93. - **Validation**: `eventstream_validate_definition`, `eventstream_create_from_definition`, `eventstream_list_available_components`
  94. > **๐Ÿ’ก Pro Tip**: All tools work with natural language! Just describe what you want to do and the AI agent will use the appropriate tools automatically.
  95. #### Activator - 2 Tools:
  96. - **`activator_list_artifacts`** - List all Activator artifacts in a Fabric workspace
  97. - **`activator_create_trigger`** - Create new Activator triggers with KQL source monitoring and email/Teams alerts
  98. #### Map - 7 Tools:
  99. - **`map_list`** - List all Map items in your Fabric workspace
  100. - **`map_get`** - Get detailed information about a specific Map item
  101. - **`map_get_definition`** - Retrieve the full JSON definition of a Map item
  102. - **`map_create`** - Create a new Map item from a provided configuration
  103. - **`map_update_definition`** - Replace the full JSON definition of an existing Map item
  104. - **`map_update`** - Partially update properties of an existing Map item
  105. - **`map_delete`** - Delete a Map item and its associated configuration
  106. ## Getting Started
  107. ### Prerequisites
  108. 1. Install either the stable or Insiders release of VS Code:
  109. * [๐Ÿ’ซ Stable release](https://code.visualstudio.com/download)
  110. * [๐Ÿ”ฎ Insiders release](https://code.visualstudio.com/insiders)
  111. 2. Install the [GitHub Copilot](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot) and [GitHub Copilot Chat](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat) extensions
  112. 3. Install `uv`
  113. ```ps
  114. powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  115. ```
  116. or, check here for [other install options](https://docs.astral.sh/uv/getting-started/installation/#__tabbed_1_2)
  117. 4. Open VS Code in an empty folder
  118. ### Install from PyPI (Pip)
  119. The Fabric RTI MCP Server is available on [PyPI](https://pypi.org/project/microsoft-fabric-rti-mcp/), so you can install it using pip. This is the easiest way to install the server.
  120. #### From VS Code
  121. 1. Open the command palette (Ctrl+Shift+P) and run the command `MCP: Add Server`
  122. 2. Select install from Pip
  123. 3. When prompted, enter the package name `microsoft-fabric-rti-mcp`
  124. 4. Follow the prompts to install the package and add it to your settings.json or your mcp.json file
  125. The process should end with the below settings in your `settings.json` or your `mcp.json` file.
  126. #### settings.json
  127. ```json
  128. {
  129. "mcp": {
  130. "servers": {
  131. "fabric-rti-mcp": {
  132. "command": "uvx",
  133. "args": [
  134. "microsoft-fabric-rti-mcp"
  135. ],
  136. "env": {
  137. "KUSTO_SERVICE_URI": "https://help.kusto.windows.net/",
  138. "KUSTO_SERVICE_DEFAULT_DB": "Samples",
  139. "FABRIC_API_BASE": "https://api.fabric.microsoft.com/v1"
  140. }
  141. }
  142. }
  143. }
  144. }
  145. ```
  146. > **Note**: All environment variables are optional. The `KUSTO_SERVICE_URI` and `KUSTO_SERVICE_DEFAULT_DB` provide default cluster and database settings. `AZ_OPENAI_EMBEDDING_ENDPOINT` configures the default AOAI embedding method used by `kusto_get_shots`.
  147. #### From GitHub Copilot CLI
  148. Use the interactive command within a GitHub Copilot CLI session:
  149. ```bash
  150. /mcp add
  151. ```
  152. Or manually add to your `~/.copilot/mcp-config.json`:
  153. ```json
  154. {
  155. "mcpServers": {
  156. "fabric-rti-mcp": {
  157. "command": "uvx",
  158. "args": [
  159. "microsoft-fabric-rti-mcp"
  160. ],
  161. "env": {
  162. "KUSTO_SERVICE_URI": "https://help.kusto.windows.net/",
  163. "KUSTO_SERVICE_DEFAULT_DB": "Samples",
  164. "FABRIC_API_BASE": "https://api.fabric.microsoft.com/v1"
  165. }
  166. }
  167. }
  168. }
  169. ```
  170. For more information, see the [GitHub Copilot CLI documentation](https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli).
  171. ### ๐Ÿ”ง Manual Install (Install from source)
  172. 1. Make sure you have Python 3.10+ installed properly and added to your PATH.
  173. 2. Clone the repository
  174. 3. Install the dependencies (`pip install .` or `uv tool install .`)
  175. 4. Add the settings below into your vscode `settings.json` or your `mcp.json` file.
  176. 5. Modify the path to match the repo location on your machine.
  177. 6. Modify the cluster uri in the settings to match your cluster.
  178. 7. Modify the cluster default database in the settings to match your database.
  179. 8. Modify the embeddings endpoint in the settings to match yours. This step is optional and needed only in case you supply a shots table
  180. ```json
  181. {
  182. "mcp": {
  183. "servers": {
  184. "fabric-rti-mcp": {
  185. "command": "uv",
  186. "args": [
  187. "--directory",
  188. "C:/path/to/fabric-rti-mcp/",
  189. "run",
  190. "-m",
  191. "fabric_rti_mcp.server"
  192. ],
  193. "env": {
  194. "KUSTO_SERVICE_URI": "https://help.kusto.windows.net/",
  195. "KUSTO_SERVICE_DEFAULT_DB": "Samples",
  196. "FABRIC_API_BASE": "https://api.fabric.microsoft.com/v1"
  197. }
  198. }
  199. }
  200. }
  201. }
  202. ```
  203. ## ๐Ÿ› Debugging the MCP Server locally
  204. Assuming you have python installed and the repo cloned:
  205. ### Install locally
  206. ```bash
  207. pip install -e ".[dev]"
  208. ```
  209. ### Configure
  210. Follow the [Manual Install](#๐Ÿ”ง-manual-install-install-from-source) instructions.
  211. ### Attach the debugger
  212. Start the MCP server normally from the client that will invoke its tools, then set a breakpoint on an executable
  213. line. If you changed the Python source after the server started, restart the MCP server before attaching.
  214. #### Option 1: Attach by process ID
  215. Press F5 and select `Python Debugger: Attach by Process ID`. VS Code needs the PID of the Python process that is
  216. running `-m fabric_rti_mcp.server`. You can identify it in either of these ways:
  217. 1. **VS Code process picker:** Select the matching Python process from the list. If several related processes are
  218. shown, select the deepest Python child running `-m fabric_rti_mcp.server`, not the `uv` wrapper.
  219. 2. **Manual PID lookup:** If VS Code asks you to enter a PID instead of displaying the process list, find it with
  220. Task Manager or PowerShell:
  221. - In Task Manager, open **Details**, enable the **PID** and **Command line** columns, and locate the matching
  222. `python.exe` process.
  223. - In PowerShell, run:
  224. ```powershell
  225. $servers = @(Get-CimInstance Win32_Process | Where-Object {
  226. $_.Name -eq "python.exe" -and
  227. $_.CommandLine -match "-m\s+fabric_rti_mcp\.server"
  228. })
  229. $servers |
  230. Where-Object { $_.ProcessId -notin $servers.ParentProcessId } |
  231. Sort-Object CreationDate -Descending |
  232. Select-Object -First 1 ProcessId, CommandLine
  233. ```
  234. Enter the returned `ProcessId` in the VS Code prompt.
  235. On newer Windows versions, `wmic.exe` is disabled or removed. Some Python debugger versions still use it to
  236. populate the process picker, causing process enumeration to fail. The manual methods above do not require WMIC.
  237. #### Option 2: Inject debugpy and attach on port 5678
  238. This repository includes the `Python Debugger: Attach to Fabric RTI MCP` launch configuration and its
  239. `Inject debugger into Fabric RTI MCP` pre-launch task. This Windows-specific option uses PowerShell to find the
  240. deepest Fabric RTI MCP Python process, inject `debugpy`, and connect VS Code to `127.0.0.1:5678`.
  241. 1. Ensure the MCP server is already running.
  242. 2. Press F5 and select `Python Debugger: Attach to Fabric RTI MCP`.
  243. 3. Wait for the VS Code debug toolbar to appear.
  244. 4. Invoke the target tool from the same MCP client session that started the attached server.
  245. Do not add `debugpy --listen` to the MCP server command. Some clients may start or reconnect to the command more
  246. than once, which can cause port collisions. If multiple MCP client sessions are running, close the unrelated
  247. sessions first so the debugger attaches to the intended server process.
  248. ## ๐Ÿงช Test the MCP Server
  249. ### Via GitHub Copilot
  250. 1. Open GitHub Copilot in VS Code and [switch to Agent mode](https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode)
  251. 2. You should see the Fabric RTI MCP Server in the list of tools
  252. 3. Try prompts that tell the agent to use the RTI tools, such as:
  253. - **Eventhouse**: "List my Kusto tables" or "Show me a sample from the StormEvents table"
  254. - **Eventstreams**: "List all Eventstreams in my workspace" or "Show me details of my data processing Eventstream"
  255. 4. The agent should be able to use the Fabric RTI MCP Server tools to complete your query
  256. ## โš™๏ธ Configuration
  257. The MCP server can be configured using the following environment variables:
  258. ### Required Environment Variables
  259. None - the server will work with default settings for demo purposes.
  260. ### Optional Environment Variables
  261. | Variable | Service | Description | Default | Example |
  262. |----------|---------|-------------|---------|---------|
  263. | `KUSTO_SERVICE_URI` | Kusto | Default Kusto cluster URI | None | `https://mycluster.westus.kusto.windows.net` |
  264. | `KUSTO_SERVICE_DEFAULT_DB` | Kusto | Default database name for Kusto queries | `NetDefaultDB` | `MyDatabase` |
  265. | `AZ_OPENAI_EMBEDDING_ENDPOINT` | Kusto | Azure OpenAI endpoint used when `kusto_get_shots` selects `embedding_method="aoai"` | None | `https://your-resource.openai.azure.com/openai/deployments/text-embedding-ada-002/embeddings?api-version=2024-10-21;impersonate` |
  266. | `KUSTO_KNOWN_SERVICES` | Kusto | JSON array of preconfigured Kusto services | None | `[{"service_uri":"https://cluster1.kusto.windows.net","default_database":"DB1","description":"Prod"}]` |
  267. | `KUSTO_EAGER_CONNECT` | Kusto | Whether to eagerly connect to default service on startup (not recommended) | `false` | `true` or `false` |
  268. | `KUSTO_ALLOW_UNKNOWN_SERVICES` | Kusto | Security setting to allow connections to services not in `KUSTO_KNOWN_SERVICES` | `true` | `true` or `false` |
  269. | `KUSTO_SHOTS_TABLE` | Kusto | Enable `kusto_get_shots` and set its default shots table | None | `MyDatabase.ShotsTable` |
  270. | `KUSTO_SHOTS_EMBEDDING_METHOD` | Kusto | Default embedding method for `kusto_get_shots` | `aoai` | `slm` or `aoai` |
  271. | `KUSTO_SHOTS_SLM_MODEL` | Kusto | Default SLM model for `kusto_get_shots` | `harrier-v1-270m` | `harrier-v1-270m` |
  272. | `FABRIC_API_BASE` | Global | Base URL for Microsoft Fabric API | `https://api.fabric.microsoft.com/v1` | `https://api.fabric.microsoft.com/v1` |
  273. | `FABRIC_BASE_URL` | Global | Base URL for Microsoft Fabric web interface | `https://fabric.microsoft.com` | `https://fabric.microsoft.com` |
  274. | `FABRIC_RTI_ALLOWED_TOOLS` | Global | Comma-separated service names or full tool names to expose | All tools | `kusto,map_get` |
  275. | `FABRIC_RTI_KUSTO_DEEPLINK_STYLE` | Kusto | Override auto-detection of deeplink style | None | `adx` or `fabric` |
  276. `FABRIC_RTI_ALLOWED_TOOLS` accepts service names derived from the registered `*_tools` modules and full tool names.
  277. ### Shots Embedding Configuration
  278. All supported AOAI and SLM embedding paths return L2-normalized vectors. `kusto_get_shots` uses their known unit
  279. magnitudes when calculating cosine similarity to avoid recalculating vector magnitudes for every shot. Custom or
  280. manually generated `EmbeddingVector` values must therefore also be L2-normalized.
  281. #### SLM embeddings
  282. `kusto_get_shots` defaults to Azure OpenAI embeddings for backward compatibility. To use local SLM embeddings,
  283. set `embedding_method` to `slm` for an individual call, or set `KUSTO_SHOTS_EMBEDDING_METHOD=slm` for the MCP
  284. server. Configure the server's default model with `KUSTO_SHOTS_SLM_MODEL`; it defaults to
  285. `harrier-v1-270m`. Explicit tool arguments override these server defaults. The queried database must contain a
  286. pre-deployed `slm_embeddings_fl` function. Follow the [SLM embeddings function documentation](https://learn.microsoft.com/en-us/kusto/functions-library/slm-embeddings-fl)
  287. and select either **Azure Data Explorer** or **Microsoft Fabric** from the **Version** selector in the left pane
  288. for the correct deployment instructions.
  289. The documented `slm_embeddings_fl` implementation supports:
  290. | Model | Vector dimensions |
  291. |---|---:|
  292. | `jina-v2-small` | 512 |
  293. | `e5-small-v2` | 384 |
  294. | `harrier-v1-270m` (default) | 640 |
  295. Example SLM arguments:
  296. ```json
  297. {
  298. "prompt": "Find a few storm events in Texas",
  299. "cluster_uri": "https://mycluster.westus.kusto.windows.net",
  300. "database": "MyDatabase",
  301. "shots_table_name": "Shots",
  302. "embedding_method": "slm",
  303. "slm_model_name": "harrier-v1-270m"
  304. }
  305. ```
  306. The SLM prompt is embedded with the `query:` prefix. The table's `EmbeddingVector` values must use the same model and vector dimension; for retrieval models, embed the stored `EmbeddingText` corpus with the corresponding `passage:` convention.
  307. The MCP tool does not deploy the function or migrate existing shot vectors.
  308. #### Azure OpenAI embeddings
  309. AOAI is the default embedding method. Follow the [AI embeddings plugin documentation](https://learn.microsoft.com/en-us/kusto/query/ai-embeddings-plugin) and select either **Azure Data Explorer** or **Microsoft Fabric** from the **Version** selector in the left pane for the applicable setup instructions.
  310. Example AOAI arguments:
  311. ```json
  312. {
  313. "prompt": "Find a few storm events in Texas",
  314. "cluster_uri": "https://mycluster.westus.kusto.windows.net",
  315. "database": "MyDatabase",
  316. "shots_table_name": "Shots",
  317. "embedding_method": "aoai",
  318. "embedding_endpoint": "https://your-resource.openai.azure.com/openai/deployments/text-embedding-ada-002/embeddings?api-version=2024-10-21;impersonate"
  319. }
  320. ```
  321. If `embedding_endpoint` isn't supplied, AOAI calls use `AZ_OPENAI_EMBEDDING_ENDPOINT`.
  322. **Format Requirements:**
  323. ```
  324. https://{your-openai-resource}.openai.azure.com/openai/deployments/{deployment-name}/embeddings?api-version={api-version};impersonate
  325. ```
  326. **Components:**
  327. - `{your-openai-resource}`: Your Azure OpenAI resource name
  328. - `{deployment-name}`: Your text embedding deployment name (e.g., `text-embedding-ada-002`)
  329. - `{api-version}`: API version (e.g., `2024-10-21`, `2023-05-15`)
  330. - `;impersonate`: Authentication method (you might use managed identity)
  331. **Authentication Requirements:**
  332. - Your Azure identity must have access to the OpenAI resource
  333. - In case of using managed identity, the OpenAI resource must be configured to accept managed identity authentication
  334. - The deployment must exist and be accessible
  335. ### Configuration of Shots Table
  336. The `kusto_get_shots` tool retrieves shots that are most similar to your prompt from the shots table. This function requires configuration of:
  337. - **Shots table**: Should have an "EmbeddingText" (string) column containing the natural language prompt, "AugmentedText" (string) column containing the respective KQL, and "EmbeddingVector" (dynamic) column containing the embedding vector of the EmbeddingText.
  338. - **Matching embeddings**: The prompt and `EmbeddingVector` column must use the same provider, model, vector dimension, and compatible query/corpus conventions.
  339. Existing AOAI calls remain backward compatible. When `embedding_method="slm"` is selected, `embedding_endpoint` is ignored.
  340. ## ๐Ÿ”‘ Authentication
  341. In `stdio` mode (local), the MCP Server integrates with your host operating system's authentication mechanisms.
  342. We use Azure Identity via [`DefaultAzureCredential`](https://learn.microsoft.com/en-us/azure/developer/python/sdk/authentication/credential-chains?tabs=dac), which tries these authentication methods in order:
  343. 1. **Environment Variables** (`EnvironmentCredential`) - Perfect for CI/CD pipelines
  344. 2. **Visual Studio** (`VisualStudioCredential`) - Uses your Visual Studio credentials
  345. 3. **Azure CLI** (`AzureCliCredential`) - Uses your existing Azure CLI login
  346. 4. **Azure PowerShell** (`AzurePowerShellCredential`) - Uses your Az PowerShell login
  347. 5. **Azure Developer CLI** (`AzureDeveloperCliCredential`) - Uses your azd login
  348. 6. **Interactive Browser** (`InteractiveBrowserCredential`) - Falls back to browser-based login if needed
  349. If you're already logged in through any of these methods, the Fabric RTI MCP Server will automatically use those credentials in `stdio` mode.
  350. This MCP server is not intended to be exposed directly as a production HTTP endpoint.
  351. If you choose to run it over HTTP, the deployment must provide its own security boundary before requests reach this server.
  352. For example, put any Entra-aware authentication layer in front of it.
  353. The HTTP configuration options below are guardrails and local-development conveniences; they are not a substitute for a production authentication boundary.
  354. By default, HTTP requests must provide an `Authorization` bearer token; the server performs deployment-agnostic bearer token shape screening and forwards the bearer to downstream Fabric/Kusto services, or exchanges it with OBO when OBO is enabled.
  355. It does not perform cryptographic Entra JWT signature, issuer, tenant, or audience validation.
  356. ## HTTP Mode Configuration for MCP Server
  357. When the MCP server is running locally to the agent in HTTP mode or is deployed to Azure, the following environment variables are used to define and enable HTTP mode. You can find practical examples of this setup in the `tests/live/test_kusto_tools_live_http.py` file:
  358. | Variable | Description | Default | Example |
  359. |----------|-------------|---------|---------|
  360. | `FABRIC_RTI_TRANSPORT` | Transport mode for the server | `stdio` | `http` |
  361. | `FABRIC_RTI_HTTP_HOST` | Host address for HTTP server | `127.0.0.1` | `0.0.0.0` |
  362. | `FABRIC_RTI_HTTP_PORT` | Port for HTTP server | `3000` | `8080` |
  363. | `FABRIC_RTI_HTTP_PATH` | HTTP path for MCP endpoint | `/mcp` | `/mcp` |
  364. | `FABRIC_RTI_STATELESS_HTTP` | Whether to use stateless HTTP mode | `false` | `true` |
  365. | `FABRIC_RTI_HTTP_ALLOW_MI` | Allow HTTP requests without a bearer to use Managed Identity | `false` | `true` |
  366. | `FABRIC_RTI_HTTP_DEBUG_MODE` | Local HTTP testing mode that allows local process credentials and permissive CORS | `false` | `true` |
  367. | `FABRIC_RTI_HTTP_ALLOWED_HOSTS` | Host allow-list for HTTP DNS-rebinding protection | empty | `mcp.example.com:*,127.0.0.1:*` |
  368. | `FABRIC_RTI_HTTP_ALLOWED_ORIGINS` | Origin allow-list for HTTP DNS-rebinding protection | empty | `https://mcp.example.com` |
  369. | `FABRIC_RTI_CORS_ORIGINS` | CORS origins. If unset, HTTP uses loopback origins; debug mode uses `*` | empty | `https://mcp.example.com` |
  370. | `FABRIC_RTI_KUSTO_KNOWN_SERVICES_PROBE` | Filter `kusto_known_services` by probing configured services. Values: `auto`, `always`, `never` | `auto` | `always` |
  371. HTTP credential behavior:
  372. | Mode | Behavior |
  373. |------|----------|
  374. | Default HTTP | Requires a bearer token. No local process credentials are used when the bearer is missing. |
  375. | `USE_OBO_FLOW=true` | Exchanges the request bearer for the configured Fabric/Kusto audience. Forged tokens fail the OBO exchange. |
  376. | `FABRIC_RTI_HTTP_ALLOW_MI=true` | Allows missing bearer tokens and uses `ManagedIdentityCredential` only. Use only behind a trusted hosting/network/auth boundary. |
  377. | `FABRIC_RTI_HTTP_DEBUG_MODE=true` | Restores local HTTP testing convenience with local process credentials, permissive CORS, and unsafe non-loopback binds. Do not use in production. |
  378. Binding HTTP to a non-loopback address such as `0.0.0.0` exposes the MCP listener outside the local process boundary.
  379. Non-loopback HTTP without an explicit host allow-list is allowed only in `FABRIC_RTI_HTTP_DEBUG_MODE`.
  380. This exception is for local testing only; it does not make direct HTTP exposure production-safe.
  381. HTTP clients connecting to the server need to include the appropriate authentication token in the request headers unless `FABRIC_RTI_HTTP_ALLOW_MI` or `FABRIC_RTI_HTTP_DEBUG_MODE` is explicitly enabled:
  382. ```python
  383. # Example from test_kusto_tools_live_http.py
  384. auth_header = f"Bearer {token.token}"
  385. headers = {
  386. "Content-Type": "application/json",
  387. "Accept": "application/json, text/event-stream",
  388. "Authorization": auth_header,
  389. }
  390. ```
  391. ### OBO Flow Authentication
  392. If your scenario involves a user token with a non-Kusto audience and you need to exchange it for a Kusto audience token using the OBO flow, the Fabric RTI MCP Server can handle this exchange automatically by setting the following environment variables:
  393. | Variable | Description | Default | Example |
  394. |----------|-------------|---------|---------|
  395. | `USE_OBO_FLOW` | Enable OBO flow for token exchange | `false` | `true` |
  396. | `FABRIC_RTI_MCP_AZURE_TENANT_ID` | Azure AD tenant ID | `72f988bf-86f1-41af-91ab-2d7cd011db47` (Microsoft) | `72f988bf-86f1-41af-91ab-2d7cd011db47` |
  397. | `FABRIC_RTI_MCP_ENTRA_APP_CLIENT_ID` | Entra App (AAD) Client ID | Your client ID |
  398. | `FABRIC_RTI_MCP_USER_MANAGED_IDENTITY_CLIENT_ID` | User Managed Identity Client ID | Your UMI client ID |
  399. This flow is typically used in OAuth scenarios where a gateway like Azure API Management (APIM) is involved (example: https://github.com/ai-microsoft/adsmcp-apim-dual-validation?tab=readme-ov-file). The user authenticates via Entra ID, and APIM forwards the token to the MCP server. The token audience is not Kusto, so the MCP server must perform an OBO token exchange to get a token with the Kusto audience.
  400. To support this setup, your Microsoft Entra App must be configured to use Federated Credentials following the official guide: https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation. This enables the app to exchange tokens (OBO).
  401. Additionally, the Entra app must be granted Azure Data Explorer API permissions to successfully acquire an OBO token with the Kusto audience.
  402. ### Remote Deployment
  403. The MCP server can be deployed using the method of your choice. For example, you can follow the guide at https://github.com/Azure-Samples/mcp-sdk-functions-hosting-python/blob/main/ExistingServer.md to deploy the MCP server to an Azure Function App.
  404. ## ๐Ÿ›ก๏ธ Security Note
  405. Your credentials are always handled securely through the official [Azure Identity SDK](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md) - **we never store or manage tokens directly**.
  406. MCP as a phenomenon is very novel and cutting-edge. As with all new technology standards, consider doing a security review to ensure any systems that integrate with MCP servers follow all regulations and standards your system is expected to adhere to. This includes not only the Azure MCP Server, but any MCP client/agent that you choose to implement down to the model provider.
  407. You should follow Microsoft security guidance for MCP servers, including enabling Entra ID authentication, secure token management, and network isolation. Refer to [Microsoft Security Documentation](https://learn.microsoft.com/en-us/azure/api-management/secure-mcp-servers)ย for details.
  408. ## ๐Ÿ‘ฅ Contributing
  409. This project welcomes contributions and suggestions. Most contributions require you to agree to a
  410. Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
  411. the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
  412. When you submit a pull request, a CLA bot will automatically determine whether you need to provide
  413. a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
  414. provided by the bot. You will only need to do this once across all repos using our CLA.
  415. ## Permissions and Risk
  416. MCP clients can invoke operations based on the userโ€™s Fabric Role-Based Access Control (RBAC) permissions. Autonomous or misconfigured clients may perform destructive actions. You should review and apply least-privilege RBAC roles and implement safeguards before deployment. Certain safeguards, such as flags to prevent destructive operations, are not standardized in the MCP specification and may not be supported by all clients.ย 
  417. ## Compliance Responsibility
  418. This MCP server may be installed, used and share data with clients and services, such as third party LLMs, AI agents or services that operate outside Fabricโ€™s compliance boundaries. You are responsible for ensuring that any integration complies with applicable organizational, regulatory, and contractual requirements.
  419. ## Third Party Components
  420. This MCP server may use or depend on third party components.ย  You are responsible for reviewing and complying with the licenses and security posture of any third-party components.
  421. ## Export Control
  422. Use of this software must comply with all applicable export laws and regulations, including U.S. Export Administration Regulations and local jurisdiction requirements.
  423. ## No Warranty / Limitation of Liability
  424. This software is provided โ€œas isโ€ without warranties or conditions of any kind, either express or implied. Microsoft shall not be liable for any damages arising from use, misuse, or misconfiguration of this software.
  425. ## ๐Ÿค Code of Conduct
  426. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
  427. For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
  428. contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
  429. ## ๐Ÿ“š Documentation
  430. - **[Changelog](./CHANGELOG.md)** - Release history and breaking changes
  431. - **[Contributing](./CONTRIB.md)** - Contribution guidelines
  432. ## Data Collection
  433. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoftโ€™s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
  434. ## Trademarks
  435. This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
  436. trademarks or logos is subject to and must follow
  437. [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
  438. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
  439. Any use of third-party trademarks or logos are subject to those third-party's policies.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If itโ€™s helped, pass it on.