-
Notifications
You must be signed in to change notification settings - Fork 306
Add Fabric OneLake MCP toolset with docs #1113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add Fabric OneLake MCP toolset with docs #1113
Conversation
…/onelakemcptools
…MCP tools - Add FileDeleteCommand for individual file deletion from OneLake storage - Add DirectoryDeleteCommand with recursive deletion support for directories - Implement DeleteDirectoryAsync in OneLakeService using blob API endpoints - Update command registration in FabricOneLakeSetup - Add JSON serialization contexts for new command results - Create comprehensive README.md with: - Complete documentation for all 9 OneLake commands with usage examples - Multi-environment support (PROD, DAILY, DXT, MSIT) configuration - Cross-platform environment variable setup instructions - Common usage patterns for data pipelines and analytics workflows - Error handling guidance and MCP client integration examples - Practical PowerShell scripting examples for bulk operations All delete functionality tested and working correctly with proper error handling.
…leanup ✨ Major Features: - Add complete test suite with 74 tests (100% passing) - Implement all 11 OneLake MCP command tests with ExecuteAsync patterns - Add testable service architecture patterns demonstration - Clean up service interfaces removing redundant methods 🧪 Test Implementation: - 68 command tests covering all OneLake MCP commands - 6 service architecture tests demonstrating dependency injection patterns - Comprehensive ExecuteAsync testing with service mocking - Constructor validation, error handling, and parameter binding tests 🔧 Interface Cleanup: - Remove redundant Fabric API methods from IOneLakeService and OneLakeService - Keep OneLake-specific methods (ListOneLakeWorkspacesAsync, ListOneLakeItemsAsync, etc.) - Add private GetWorkspaceAsync helper for internal use - Maintain backward compatibility for existing commands 📚 Documentation: - Add comprehensive test documentation (README.md, TestImplementationSummary.md) - Update main README.md with development guidelines and test information - Document testable architecture patterns for future development 🏗️ Architecture: - Demonstrate testable service patterns with dependency injection - Show parameter validation before API calls approach - Provide examples for future service layer refactoring - Maintain production reliability while enabling comprehensive testing ✅ Verification: - All tests pass (74/74) with sub-2-second execution - Clean build with no compilation errors - Production-ready with comprehensive error handling - Follows established MCP command patterns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces comprehensive OneLake MCP Tools for Microsoft Fabric, adding 11 new commands to manage OneLake data lake storage through AI agents and MCP clients. The implementation includes full test coverage (74 passing tests), support for multiple Fabric environments (PROD, DAILY, DXT, MSIT), and extensive documentation.
Key Changes:
- Added 11 OneLake commands (workspace, item, file, and directory operations)
- Implemented comprehensive test suite with 100% command coverage
- Added support for friendly-name identifiers alongside GUIDs
- Created extensive documentation and troubleshooting guides
Reviewed Changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated 31 comments.
Show a summary per file
| File | Description |
|---|---|
| upload_files_simple.ps1 | PowerShell script for bulk file uploads (contains hardcoded user path) |
| upload_files.ps1 | Enhanced PowerShell upload script (contains hardcoded user path) |
| tools/Fabric.Mcp.Tools.OneLake/upload_files_simple.ps1 | Duplicate of root upload script |
| tools/Fabric.Mcp.Tools.OneLake/upload_files.ps1 | Duplicate of root upload script |
| tools/Fabric.Mcp.Tools.OneLake/tests/TestImplementationSummary.md | Documentation of test implementation and coverage |
| tools/Fabric.Mcp.Tools.OneLake/tests/Services/OneLakeServiceTests.cs | Service layer test demonstrating testable architecture patterns |
| tools/Fabric.Mcp.Tools.OneLake/tests/README.md | Test configuration and execution documentation |
| tools/Fabric.Mcp.Tools.OneLake/tests/FabricOneLakeSetupTests.cs | Setup and registration tests |
| tools/Fabric.Mcp.Tools.OneLake/tests/Fabric.Mcp.Tools.OneLake.Tests.csproj | Test project configuration |
| tools/Fabric.Mcp.Tools.OneLake/tests/Commands/*.cs | Comprehensive command tests for all 11 OneLake commands |
| tools/Fabric.Mcp.Tools.OneLake/src/Services/OneLakeService.cs | Core service implementation for OneLake operations |
| tools/Fabric.Mcp.Tools.OneLake/src/Services/IOneLakeService.cs | Service interface definition |
| tools/Fabric.Mcp.Tools.OneLake/src/Options/*.cs | Option definitions for commands |
| tools/Fabric.Mcp.Tools.OneLake/src/Models/*.cs | Model definitions for OneLake entities |
| tools/Fabric.Mcp.Tools.OneLake/src/Commands/**/*.cs | Implementation of all 11 OneLake commands |
| tools/Fabric.Mcp.Tools.OneLake/README.md | Comprehensive usage documentation |
| servers/Fabric.Mcp.Server/src/Program.cs | Registration of OneLake setup |
| servers/Fabric.Mcp.Server/*.md | Documentation updates for OneLake tools |
| AzureMcp.sln | Solution file updates |
Comments suppressed due to low confidence (1)
tools/Fabric.Mcp.Tools.OneLake/tests/TestImplementationSummary.md:1
- Duplicate entries in the commands table. Lines 208-209 repeat the same Directory Create and Directory Delete entries that appear in lines 206-207. Remove the duplicate rows.
| foreach (var prefix in blobPrefixes) | ||
| { | ||
| var nameElement = prefix.Element(ns + "Name"); | ||
| if (nameElement?.Value != null) | ||
| { | ||
| var dirName = nameElement.Value.TrimEnd('/'); | ||
| files.Add(new OneLakeFileInfo | ||
| { | ||
| Name = Path.GetFileName(dirName), | ||
| Path = dirName, | ||
| Size = 0, | ||
| LastModified = null, | ||
| ContentType = "application/x-directory", | ||
| IsDirectory = true | ||
| }); | ||
| } | ||
| } |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This foreach loop immediately maps its iteration variable to another variable - consider mapping the sequence explicitly using '.Select(...)'.
| catch (Exception ex) | ||
| { | ||
| throw new InvalidOperationException($"Failed to parse OneLake items list response: {ex.Message}", ex); | ||
| } |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generic catch clause.
| catch (Exception ex) | ||
| { | ||
| allResponses.Add($"<!-- Error accessing folder {folder}: {ex.Message} -->"); | ||
| } |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generic catch clause.
| catch (Exception ex) | ||
| { | ||
| allResponses.Add($"/* Error accessing folder {folder}: {ex.Message} */"); | ||
| } |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generic catch clause.
@microsoft-github-policy-service agree company="Microsoft" |
cad82bc to
ec91e11
Compare
What does this PR do?
`Add Fabric OneLake MCP toolset with friendly-name support and docs
PR Description
Summary
Add a dedicated Fabric OneLake toolset with commands for workspaces, items, paths, and files, backed by a new service layer, option definitions, and JSON models.
Expand the test suite with command, service, and integration-style coverage to validate both GUID and friendly-name identifier flows, plus supporting scripts and fixtures.
Refresh Fabric MCP documentation to explain friendly-name behavior, clean up obsolete debug wiring, and restore local MCP client configuration for development.
Testing
dotnet build
dotnet test tools/Fabric.Mcp.Tools.OneLake/tests/Fabric.Mcp.Tools.OneLake.Tests.csproj
GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/CHANGELOG.mdand/orservers/Fabric.Mcp.Server/CHANGELOG.mdfor product changes (features, bug fixes, UI/UX, updated dependencies)servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationeng/scripts/Process-PackageReadMe.ps1. See Package README/servers/Azure.Mcp.Server/docs/azmcp-commands.mdand/or/docs/fabric-commands.md.\eng\scripts\Update-AzCommandsMetadata.ps1to update tool metadata in azmcp-commands.md (required for CI)ToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test prompts/servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline