How microsoft/fabric-rti-mcp works
Project Type & Purpose
• Type: Full-stack Python MCP server (Model Context Protocol)
• Purpose: Acts as a bridge between AI agents (e.g., in VS Code via the UV/UVX tool) and Microsoft Fabric Real-Time Intelligence services. Exposes Fabric RTI tooling (Kusto/Eventstreams) over the MCP interface.
Key Components
1. Client Layer
– AI Agent / VS Code extension (UV/UVX)
• Sends MCP requests (JSON RPC)
• Receives tool responses
2. MCP Server (fabric_rti_mcp/server.py)
– Protocol Handler
• Parses incoming MCP messages
• Dispatches calls to tool implementations
3. Tool Modules
A. Kusto Tools (fabric_rti_mcp/kusto/*.py)
• kusto_service.py: Orchestrates Kusto operations
• kusto_connection.py: Manages low-level ADX/Eventhouse REST or SDK calls
• kusto_response_formatter.py: Normalizes Kusto results for MCP
• kusto_tools.py: Exposes individual “tools” (kusto_query, kusto_list_databases, etc.)
B. Eventstream Tools (fabric_rti_mcp/eventstream/*.py)
• eventstream_service.py: Business logic for listing and describing Eventstreams
• eventstream_connection.py: Handles HTTP/SDK calls to the Microsoft Fabric Eventstream API
• eventstream_tools.py: Exposes MCP tools (list_eventstreams, get_eventstream, etc.)
4. Common Utilities (fabric_rti_mcp/common.py)
– Shared helpers, error handling, configuration loading
5. Infrastructure & Configuration
– Environment variables (KUSTO_SERVICE_URI, AZ_OPENAI_EMBEDDING_ENDPOINT, etc.)
– Azure Identity (DefaultAzureCredential) for secure auth
– pyproject.toml / setup.cfg for packaging
– scripts/ and Makefile for local build/deploy
External Systems
• Microsoft Fabric RTI
– Eventhouse (Azure Data Explorer / Kusto)
– Eventstreams service
• Azure Identity Endpoints (for authentication)
• (Optional) Azure OpenAI embeddings endpoint for semantic-search shots
Relationships & Data Flows
1. The AI Agent issues a tool request (e.g., “kusto_query”) → MCP Server
2. MCP Server’s Protocol Handler → Appropriate tool in kusto_tools.py or eventstream_tools.py
3. Tool calls its Service (e.g., KustoService) → Service calls its Connection (KustoConnection)
4. Connection uses Azure SDK/REST → Fabric RTI service → returns raw response
5. Service passes data to ResponseFormatter → structured result
6. Protocol Handler wraps result → returns to AI Agent
Architectural Patterns & Principles
• Layered Architecture
– Protocol Layer → Tool Layer → Service Layer → Connection Layer → External API
• Separation of Concerns
– Each tool focuses on one Fabric RTI capability
– Service vs. Connection vs. Formatting are distinct
• Dependency Injection via environment variables & config files
• Plug-in style: new services (e.g., “Activator”) can be added under fabric_rti_mcp/