How sanketagnihotrishorthillsai/fabricmcp_server works
Project type and purpose
• This is a backend API server (“FabricMCP Server”) written in Python.
• Its purpose is to expose Microsoft Fabric operations (“tools”) over an MCP (Multi‐Cover Protocol) interface so that an LLM can invoke Fabric functions (create lakehouses, pipelines, notebooks, etc.) programmatically.
File structure
• Top‐level:
• .env.example / .gitignore / pyproject.toml / uv.lock – environment, packaging, lock files
• README.md – project overview & setup
• src/fabricmcp_server:
• app.py – ASGI entrypoint (FastAPI or similar)
• fabric_api_client.py – wraps calls to Microsoft Fabric REST APIs
• sessions.py – manages HTTP sessions, authentication (service principal)
• common_schemas.py, copy_activity_schemas.py, activity_types.py – Pydantic schemas and enums defining data models
• fabric_models.py – domain models mapping Fabric entities
• tools/ – one module per Fabric “tool” (lakehouses.py, notebooks.py, pipelines.py, items.py, datasets.py, connections.py, connection_manager.py, universal_copy_activity.py, configure_copy_activity.py)
README for additional insights
• Uses Python 3.10+, Uvicorn CLI (uv venv, uv pip install, etc.) as ASGI server
• Exposes Fabric functionality through an MCP client interface
• No built‐in persistent store – the Fabric service is the primary external dependency
a. Main components
• LLM/MCP Client – issues natural‐language‐driven MCP calls
• FabricMCP Server – ASGI application (FastAPI)
– API Layer (app.py, route definitions)
– Tool Layer (modules under tools/, each implementing a Fabric operation)
– Schema Layer (Pydantic models + enums)
– Fabric API Client (sessions.py + fabric_api_client.py)
• Microsoft Fabric Service (external REST API)
b. Relationships and interactions
1. LLM/MCP Client → HTTP/gRPC call → FabricMCP Server (app.py)
2. Server routes invoke appropriate tool module
3. Tool modules validate input against Pydantic schemas, then call Fabric API Client
4. Fabric API Client opens an authenticated session → Microsoft Fabric REST API
5. Response flows back through the same path
c. Architectural patterns & design principles
• Layered architecture (API → tools → client → external)
• Plugin‐style “tool” modules for each Fabric domain
• Dependency injection via FastAPI for sessions & config
• Use of Pydantic for schema validation
• Externalization of secrets/config in .env
d. Key technologies & libraries
• Python 3.10+
• FastAPI (or similar ASGI framework) + Uvicorn (“uv” CLI)
• Pydantic for schemas
• Requests or HTTPX for REST calls (sessions.py)
• Microsoft Fabric REST API
• MCP protocol / client integration
Diagramming recommendations
– Rectangles for in‐process components (API, tools, client modules)
• With protocols/tech: “HTTP/JSON over MCP”, “HTTPX + OAuth2/SPN session”, “Pydantic validation”