Uses Azure OpenAI for intelligent SQL generation, intent classification, and business response enhancement with caching optimization for repeated queries
fabric-mcp-agent
Production-Ready MVP - A complete two-layer system combining an MCP-compliant server with agentic AI reasoning for Microsoft Fabric Data Warehouse access.
🎯 MVP Status: COMPLETE ✅
This system is fully functional and ready for production use with comprehensive logging, performance tracking, and business-optimized responses.
🔷 Architecture Overview
Layer 1: Fabric DW MCP Server
Standards-compliant MCP server with 4 complete tools providing clean abstractions over Fabric Data Warehouse operations with full Azure AD authentication.
Layer 2: Agentic Reasoning Layer
Production-ready intelligent routing system that interprets business intent, selects appropriate prompt modules, and dynamically chains MCP tools to deliver enriched answers with formatted results and business insights.
🚀 Production Features
✅ Complete MCP Tools
run_sql_query
: Execute SQL from natural language questions or direct SQL with full error handlingget_metadata
: Retrieve comprehensive table schemas, sample data, and relationshipssummarize_results
: Generate business-friendly summaries with actionable insightsgenerate_visualization
: Create formatted data tables and chart configurations
✅ Advanced Agentic Intelligence
- Intent Classification: Smart routing to domain-specific prompt modules with 95%+ accuracy
- Prompt-Driven SQL: Context-aware SQL generation using business domain knowledge
- Tool Chaining: Dynamic multi-tool orchestration for comprehensive business responses
- Azure OpenAI Caching: Automatic response optimization for repeated queries
✅ Enterprise Features
- Comprehensive Logging: JSON-structured logs with request tracking and performance metrics
- Performance Monitoring: Real-time dashboard with session-based analytics
- Error Tracking: Full error context with automated recovery mechanisms
- Security: Azure AD authentication with read-only database access
🔄 Query Formation Flow
How Fabric DW queries are formed:
- User Question → Intent Router classifies intent and selects prompt module
- Prompt Module Integration → Loads domain-specific context (e.g.,
product_planning.md
) - LLM SQL Generation → Creates T-SQL using enhanced prompts with table schemas and business context
📋 API Endpoints
MCP Standard Endpoints
GET /list_tools
- Returns all available MCP tools with schemasPOST /call_tool
- Execute specific MCP tool with arguments
Agentic Intelligence Endpoint
POST /mcp
- Full agentic reasoning with intent classification and tool chaining
🧪 Quick Start & Testing
1. Start the Server
(Ensure .env
is configured with Azure credentials)
2. Test MCP Tools Discovery
3. Test Individual MCP Tools
4. Test Agentic Intelligence (Recommended)
5. Access the Web UI
🎯 Example Responses
The agentic /mcp
endpoint returns enriched responses:
🌐 Production Web UI
- Component Analysis: Optimized for product planning queries like "tell me the components in MRH-011C"
- Formatted Results: SQL results displayed in interactive tables with hover effects
- Real-time Testing: All endpoints accessible through responsive browser interface
- Quick Test Buttons: Pre-built queries for common business scenarios
- Request Tracking: Each query shows unique request ID for monitoring and debugging
Configuration
The server requires the following environment variables in a .env
file located in the project root:
Variable | Description |
---|---|
FABRIC_SQL_SERVER | Fully qualified Fabric Data Warehouse server hostname |
FABRIC_SQL_DATABASE | Target database name in Fabric |
AZURE_CLIENT_ID | Azure Service Principal client ID (for AAD authentication) |
AZURE_CLIENT_SECRET | Azure Service Principal secret |
AZURE_TENANT_ID | Azure tenant (directory) ID |
AZURE_OPENAI_KEY | API key for your Azure OpenAI deployment |
AZURE_OPENAI_ENDPOINT | Endpoint URL for Azure OpenAI (e.g., https://xxxx.openai.azure.com) |
AZURE_OPENAI_DEPLOYMENT | Deployment name (e.g., "gpt-4o") |
Sample .env
📊 Performance Monitoring
Real-time Dashboard
Sample Metrics Output
🚀 Production Deployment
This MVP is ready for production deployment with:
- ✅ Full error handling and recovery
- ✅ Comprehensive logging and monitoring
- ✅ Performance optimization with AI caching
- ✅ Security best practices implemented
- ✅ Scalable architecture for extension
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables natural language querying of Microsoft Fabric Data Warehouses with intelligent SQL generation, metadata exploration, and business-friendly result summarization. Features two-layer architecture with MCP-compliant server and agentic AI reasoning for production-ready enterprise data access.
Related MCP Servers
- AsecurityFlicenseAqualityEnables interaction with the Metal Framework by providing documentation search and code generation capabilities using natural language queries.Last updated -22TypeScript
- -securityAlicense-qualityFacilitates interaction with Microsoft SQL Server Express, supporting database operations such as querying, table management, and schema inspection via natural language MCP commands.Last updated -4PythonMIT License
- -securityFlicense-qualityA FastMCP server that provides natural language interaction with MS SQL databases, enabling users to query data, list tables, describe structures, and execute database operations through a conversational AI interface.Last updated -Python
- -securityAlicense-qualityAn MCP server that allows AI assistants to interact with Foundry datasets, ontology objects, and functions through natural language queries and commands.Last updated -8PythonMIT License