Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
Fabric Real-Time Intelligence logo

Fabric Real-Time Intelligence

Bymicrosoft·62

Query Eventhouse/ADX with KQL and manage Eventstreams.

Install with UVX in VS CodePyPI Downloads

🎯 Overview

A Model Context Protocol (MCP) server implementation forMicrosoft Fabric Real-Time Intelligence (RTI).This server enables AI agents to interact with Fabric RTI services by providing tools through the MCP interface, allowing for seamless data querying and analysis capabilities.

Note

This project is in Public Preview and implementation may significantly change prior to General Availability.

🔍 How It Works

The Fabric RTI MCP Server acts as a bridge between AI agents and Microsoft Fabric RTI services:

  • 🔄MCP Protocol: Uses the Model Context Protocol to expose Fabric RTI capabilities as tools
  • 🏗️Natural Language to KQL: AI agents can translate natural language requests into KQL queries
  • 💡Secure Authentication: Leverages Azure Identity for seamless, secure access to your resources
  • Real-time Data Access: Direct connection to Eventhouse and Eventstreams for live data analysis

✨ Supported Services

Eventhouse (Kusto): Execute KQL queries against Microsoft Fabric RTIEventhouse andAzure Data Explorer (ADX).

Eventstreams: Manage Microsoft FabricEventstreams for real-time data processing:

  • List Eventstreams in workspaces
  • Get Eventstream details and definitions

🚧 Coming soon

  • Activator
  • Other RTI items

🔍 Example Prompts

Eventhouse Analytics:

  • "Get databases in my Eventhouse"
  • "Sample 10 rows from table 'StormEvents' in Eventhouse"
  • "What can you tell me about StormEvents data?"
  • "Analyze the StormEvents to come up with trend analysis across past 10 years of data"
  • "Analyze the commands in 'CommandExecution' table and categorize them as low/medium/high risks"

Eventstream Management:

  • "List all Eventstreams in my workspace"
  • "Show me the details of my IoT data Eventstream"

Available tools

Eventhouse (Kusto) - 12 Tools:

  • kusto_known_services - List all available Kusto services configured in the MCP
  • kusto_query - Execute KQL queries on the specified database
  • kusto_command - Execute Kusto management commands (destructive operations)
  • kusto_list_databases - List all databases in the Kusto cluster
  • kusto_list_tables - List all tables in a specified database
  • kusto_get_entities_schema - Get schema information for all entities (tables, materialized views, functions) in a database
  • kusto_get_table_schema - Get detailed schema information for a specific table
  • kusto_get_function_schema - Get schema information for a specific function, including parameters and output schema
  • kusto_sample_table_data - Retrieve random sample records from a specified table
  • kusto_sample_function_data - Retrieve random sample records from the result of a function call
  • kusto_ingest_inline_into_table - Ingest inline CSV data into a specified table
  • kusto_get_shots - Retrieve semantically similar query examples from a shots table using AI embeddings

Eventstreams - 6 Tools:

  • list_eventstreams - List all Eventstreams in your Fabric workspace
  • get_eventstream - Get detailed information about a specific Eventstream
  • get_eventstream_definition - Retrieve complete JSON definition of an Eventstream

Getting Started

Prerequisites

  1. Install either the stable or Insiders release of VS Code:
  2. Install theGitHub Copilot andGitHub Copilot Chat extensions
  3. Installuv
powershell-ExecutionPolicyByPass-c"irmhttps://astral.sh/uv/install.ps1|iex"

or, check here forother install options

  1. Open VS Code in an empty folder

Install from PyPI (Pip)

The Fabric RTI MCP Server is available onPyPI, 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 Pip3. 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 yoursettings.json or yourmcp.json file.

settings.json

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

Note: All environment variables are optional. TheKUSTO_SERVICE_URI andKUSTO_SERVICE_DEFAULT_DB provide default cluster and database settings. TheAZ_OPENAI_EMBEDDING_ENDPOINT is only needed for semantic search functionality in thekusto_get_shots tool.

🔧 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 . oruv tool install .)
  4. Add the settings below into your vscodesettings.json or yourmcp.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"                }            }        }    }}

🐛 Debugging the MCP Server locally

Assuming you have python installed and the repo cloned:

Install locally

pip install -e".[dev]"

Configure

Follow theManual Install instructions.

Attach the debugger

Use thePython: Attach configuration in yourlaunch.json to attach to the running server.Once VS Code picks up the server and starts it, navigate to its output:

  1. Open command palette (Ctrl+Shift+P) and run the commandMCP: List Servers
  2. Navigate tofabric-rti-mcp and selectShow Output
  3. Pick up the process ID (PID) of the server from the output
  4. Run thePython: Attach configuration in yourlaunch.json file, and paste the PID of the server in the prompt
  5. The debugger will attach to the server process, and you can start debugging

🧪 Test the MCP Server

  1. Open GitHub Copilot in VS Code andswitch to Agent mode
  2. You should see the Fabric RTI MCP Server in the list of tools
  3. Try a prompt that tells the agent to use the Eventhouse tools, such as "List my Kusto tables"
  4. The agent should be able to use the Fabric RTI MCP Server tools to complete your query

⚙️ Configuration

The MCP server can be configured using the following environment variables:

Required Environment Variables

None - the server will work with default settings for demo purposes.

Optional Environment Variables

VariableServiceDescriptionDefaultExample
KUSTO_SERVICE_URIKustoDefault Kusto cluster URINonehttps://mycluster.westus.kusto.windows.net
KUSTO_SERVICE_DEFAULT_DBKustoDefault database name for Kusto queriesNetDefaultDBMyDatabase
AZ_OPENAI_EMBEDDING_ENDPOINTKustoAzure OpenAI embedding endpoint for semantic search inkusto_get_shotsNonehttps://your-resource.openai.azure.com/openai/deployments/text-embedding-ada-002/embeddings?api-version=2024-10-21;impersonate
KUSTO_KNOWN_SERVICESKustoJSON array of preconfigured Kusto servicesNone[{"service_uri":"https://cluster1.kusto.windows.net","default_database":"DB1","description":"Prod"}]
KUSTO_EAGER_CONNECTKustoWhether to eagerly connect to default service on startup (not recommended)falsetrue orfalse
KUSTO_ALLOW_UNKNOWN_SERVICESKustoSecurity setting to allow connections to services not inKUSTO_KNOWN_SERVICEStruetrue orfalse
FABRIC_API_BASEGlobalBase URL for Microsoft Fabric APIhttps://api.fabric.microsoft.com/v1https://api.fabric.microsoft.com/v1

Embedding Endpoint Configuration

TheAZ_OPENAI_EMBEDDING_ENDPOINT is used by the semantic search functionality (e.g.,kusto_get_shots function) to find similar query examples.

Format Requirements:

https://{your-openai-resource}.openai.azure.com/openai/deployments/{deployment-name}/embeddings?api-version={api-version};impersonate

Components:

  • {your-openai-resource}: Your Azure OpenAI resource name
  • {deployment-name}: Your text embedding deployment name (e.g.,text-embedding-ada-002)
  • {api-version}: API version (e.g.,2024-10-21,2023-05-15)
  • ;impersonate: Authentication method (you might use managed identity)

Authentication Requirements:

  • Your Azure identity must have access to the OpenAI resource
  • In case using managed identity, the OpenAI resource must should be configured to accept managed identity authentication
  • The deployment must exist and be accessible

Configuration of Shots Table

Thekusto_get_shots tool retrieves shots that are most similar to your prompt from the shots table. This function requires configuration of:

  • 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.
  • Azure OpenAI embedding endpoint: Used to create embedding vectors for your prompt. Note that this endpoint must use the same model that was used for creating the "EmbeddingVector" column in the shots table.

🔑 Authentication

The MCP Server seamlessly integrates with your host operating system's authentication mechanisms. We use Azure Identity viaDefaultAzureCredential, which tries these authentication methods in order:

  1. Environment Variables (EnvironmentCredential) - Perfect for CI/CD pipelines
  2. Visual Studio (VisualStudioCredential) - Uses your Visual Studio credentials
  3. Azure CLI (AzureCliCredential) - Uses your existing Azure CLI login
  4. Azure PowerShell (AzurePowerShellCredential) - Uses your Az PowerShell login
  5. Azure Developer CLI (AzureDeveloperCliCredential) - Uses your azd login
  6. Interactive Browser (InteractiveBrowserCredential) - Falls back to browser-based login if needed

If you're already logged in through any of these methods, the Fabric RTI MCP Server will automatically use those credentials.

HTTP Mode Configuration for MCP Server

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 thetests/live/test_kusto_tools_live_http.py file:

VariableDescriptionDefaultExample
FABRIC_RTI_TRANSPORTTransport mode for the serverstdiohttp
FABRIC_RTI_HTTP_HOSTHost address for HTTP server127.0.0.10.0.0.0
FABRIC_RTI_HTTP_PORTPort for HTTP server30008080
FABRIC_RTI_HTTP_PATHHTTP path for MCP endpoint/mcp/mcp
FABRIC_RTI_STATELESS_HTTPWhether to use stateless HTTP modefalsetrue

HTTP clients connecting to the server need to include the appropriate authentication token in the request headers:

# Example from test_kusto_tools_live_http.pyauth_header=f"Bearer{token.token}"headers= {"Content-Type":"application/json","Accept":"application/json, text/event-stream","Authorization":auth_header,}

OBO Flow Authentication

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:

VariableDescriptionDefaultExample
USE_OBO_FLOWEnable OBO flow for token exchangefalsetrue
FABRIC_RTI_MCP_AZURE_TENANT_ID72f988bf-86f1-41af-91ab-2d7cd011db47 (Microsoft)72f988bf-86f1-41af-91ab-2d7cd011db47
FABRIC_RTI_MCP_ENTRA_APP_CLIENT_IDEntra App (AAD) Client IDYour client ID
FABRIC_RTI_MCP_USER_MANAGED_IDENTITY_CLIENT_IDUser Managed Identity Client IDYour UMI client ID

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.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).Additionally, the Entra app must be granted Azure Data Explorer API permissions to successfully acquire an OBO token with the Kusto audience.

Remote Deployment

The MCP server can be deployed using the method of your choice. For example, you can follow the guide athttps://github.com/Azure-Samples/mcp-sdk-functions-hosting-python/blob/main/ExistingServer.md to deploy the MCP server to an Azure Function App.

🛡️ Security Note

Your credentials are always handled securely through the officialAzure Identity SDK -we never store or manage tokens directly.

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.

👥 Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to aContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant usthe rights to use your contribution. For details, visithttps://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to providea CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructionsprovided by the bot. You will only need to do this once across all repos using our CLA.

🤝 Code of Conduct

This project has adopted theMicrosoft Open Source Code of Conduct.For more information see theCode of Conduct FAQ orcontactopencode@microsoft.com with any additional questions or comments.

Data Collection

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 athttps://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.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsofttrademarks or logos is subject to and must followMicrosoft's Trademark & Brand Guidelines.Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.Any use of third-party trademarks or logos are subject to those third-party's policies.

About

Fabric Real-Time Intelligence logo

Fabric Real-Time Intelligence

Bymicrosoft·62

Query Eventhouse/ADX with KQL and manage Eventstreams.


[8]ページ先頭

©2009-2025 Movatter.jp