Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
20655d2
Add DataFactory.MCP.Core as submodule reference in Fabric.Mcp.Server
May 5, 2026
64ed49e
Update DataFactory submodule ref after Core→Fabric.Mcp.Tools.DataFact…
May 6, 2026
d84da2c
Rename submodule folder from DataFactory.MCP to Fabric.Mcp.Tools.Data…
May 6, 2026
c3e349f
Update DataFactory submodule to include Fabric adapter project
May 6, 2026
a9cc7e0
Remove redundant wrapper; use DataFactory.MCP.Fabric adapter from sub…
May 6, 2026
53b45a3
Move DataFactory.MCP.Fabric to tools/Fabric.Mcp.Tools.DataFactory
May 6, 2026
36b2455
Update DataFactory commands to use domain handlers
May 6, 2026
7dd454a
Switch DataFactory.MCP.Core from project reference to NuGet package
May 7, 2026
2f56ce8
Remove DataFactory.MCP submodule
May 7, 2026
2373c1a
Remove .gitmodules and CONTRIBUTING.md
May 7, 2026
77fdd40
Restore CONTRIBUTING.md from main
May 7, 2026
a534e07
Replace placeholder command IDs with proper GUIDs
May 7, 2026
4267ed2
Add execute-query command and update NuGet to 0.19.1-beta
May 7, 2026
6b79eb0
chore: bump Microsoft.DataFactory.MCP.Core to 0.20.0-beta
May 7, 2026
d2c5e42
Use DataFactory.MCP.Core 0.19.1-beta (available on DevOps feed)
May 7, 2026
7ad4416
Bump DataFactory.MCP.Core to 0.20.0-beta
May 7, 2026
fd459b9
Fix smoke test: redirect console logs to stderr
May 7, 2026
216f729
Fix analyze: update solution files and import ordering
May 7, 2026
d721b92
Add unit tests for DataFactory tools
May 7, 2026
cf30cfa
docs: add DataFactory README, update CHANGELOG and server README
May 11, 2026
0737bd5
docs: fix broken relative link, remove PR refs from CHANGELOG
May 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Apache.Arrow" Version="22.1.0" />
<PackageVersion Include="Azure.Containers.ContainerRegistry" Version="1.2.0" />
<PackageVersion Include="Azure.Communication.Sms" Version="1.0.2" />
<PackageVersion Include="Azure.Communication.Email" Version="1.0.2" />
Expand Down Expand Up @@ -83,6 +84,7 @@
<PackageVersion Include="Microsoft.HybridRow" Version="1.1.0-preview4" />
<PackageVersion Include="Microsoft.Azure.Cosmos.Aot" Version="0.1.4-preview.2" />
<PackageVersion Include="Microsoft.Azure.Mcp.AzTypes.Internal.Compact" Version="0.2.804" />
<PackageVersion Include="Microsoft.DataFactory.MCP.Core" Version="0.20.0-beta" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.2" />
<PackageVersion Include="ModelContextProtocol" Version="1.1.0" />
Expand Down
7 changes: 7 additions & 0 deletions Microsoft.Mcp.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,13 @@
<Folder Name="/tools/Fabric.Mcp.Tools.Core/tests/">
<Project Path="tools/Fabric.Mcp.Tools.Core/tests/Fabric.Mcp.Tools.Core.UnitTests.csproj" />
</Folder>
<Folder Name="/tools/Fabric.Mcp.Tools.DataFactory/" />
<Folder Name="/tools/Fabric.Mcp.Tools.DataFactory/src/">
<Project Path="tools/Fabric.Mcp.Tools.DataFactory/src/Fabric.Mcp.Tools.DataFactory.csproj" />
</Folder>
<Folder Name="/tools/Fabric.Mcp.Tools.DataFactory/tests/">
<Project Path="tools/Fabric.Mcp.Tools.DataFactory/tests/Fabric.Mcp.Tools.DataFactory.UnitTests/Fabric.Mcp.Tools.DataFactory.UnitTests.csproj" />
</Folder>
<Folder Name="/tools/Fabric.Mcp.Tools.Docs/" />
<Folder Name="/tools/Fabric.Mcp.Tools.Docs/src/">
<Project Path="tools/Fabric.Mcp.Tools.Docs/src/Fabric.Mcp.Tools.Docs.csproj" />
Expand Down
4 changes: 4 additions & 0 deletions servers/Fabric.Mcp.Server/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features Added

- **Data Factory Tools**: Added 7 new commands for managing Microsoft Fabric Data Factory resources through MCP. Includes pipeline operations (list, create, get, run) and Dataflow Gen2 operations (list, create, execute query). Powered by the [Microsoft.DataFactory.MCP.Core](https://www.nuget.org/packages/Microsoft.DataFactory.MCP.Core) NuGet package.

### Breaking Changes

### Bugs Fixed

- Fixed console logging polluting stdout which caused smoke test failures on macOS. Console logs are now redirected to stderr via `LogToStandardErrorThreshold`.

### Other Changes

## 1.0.0 (2026-04-14)
Expand Down
7 changes: 7 additions & 0 deletions servers/Fabric.Mcp.Server/Fabric.Mcp.Server.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
<Folder Name="/tools/Fabric.Mcp.Tools.Core/tests/">
<Project Path="../../tools/Fabric.Mcp.Tools.Core/tests/Fabric.Mcp.Tools.Core.UnitTests.csproj" />
</Folder>
<Folder Name="/tools/Fabric.Mcp.Tools.DataFactory/" />
<Folder Name="/tools/Fabric.Mcp.Tools.DataFactory/src/">
<Project Path="../../tools/Fabric.Mcp.Tools.DataFactory/src/Fabric.Mcp.Tools.DataFactory.csproj" />
</Folder>
<Folder Name="/tools/Fabric.Mcp.Tools.DataFactory/tests/">
<Project Path="../../tools/Fabric.Mcp.Tools.DataFactory/tests/Fabric.Mcp.Tools.DataFactory.UnitTests/Fabric.Mcp.Tools.DataFactory.UnitTests.csproj" />
</Folder>
<Folder Name="/tools/Fabric.Mcp.Tools.Docs/" />
<Folder Name="/tools/Fabric.Mcp.Tools.Docs/src/">
<Project Path="../../tools/Fabric.Mcp.Tools.Docs/src/Fabric.Mcp.Tools.Docs.csproj" />
Expand Down
14 changes: 14 additions & 0 deletions servers/Fabric.Mcp.Server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ A local-first Model Context Protocol (MCP) server that provides AI agents with c
- [API Documentation & Best Practices](#api-documentation--best-practices)
- [OneLake Data Operations](#onelake-data-operations)
- [Core Fabric Operations](#core-fabric-operations)
- [Data Factory Operations](#data-factory-operations)
- [Support and Reference](#support-and-reference)
- [Documentation](#documentation)
- [Feedback and Support](#feedback-and-support)
Expand All @@ -53,6 +54,7 @@ Key capabilities:
- **Item Definition Knowledge**: JSON schemas for every Fabric item type (Lakehouses, pipelines, semantic models, notebooks, etc.)
- **Built-in Best Practices**: Embedded guidance on pagination, error handling, and recommended patterns
- **Local-First Security**: Runs entirely on your machine—never connects to your Fabric environment
- **Data Factory Integration**: Pipeline and Dataflow Gen2 management with M query execution

# Installation
<!-- insert-section: vsix {{- Install the [Fabric MCP Server Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=fabric.vscode-fabric-mcp-server)}} -->
Expand Down Expand Up @@ -260,6 +262,18 @@ The Fabric MCP Server exposes tools organized into three categories:
|-----------|-------------|
| `core_create-item` | Creates new Fabric items (Lakehouses, Notebooks, etc.). |

### Data Factory Operations

| Tool Name | Description |
|-----------|-------------|
| `datafactory_list-pipelines` | Lists all pipelines in a Microsoft Fabric workspace. |
| `datafactory_create-pipeline` | Creates a new pipeline in a workspace. |
| `datafactory_get-pipeline` | Gets details of a specific pipeline. |
| `datafactory_run-pipeline` | Runs a pipeline on demand. |
| `datafactory_list-dataflows` | Lists all Dataflow Gen2 items in a workspace. |
| `datafactory_create-dataflow` | Creates a new Dataflow Gen2 item. |
| `datafactory_execute-query` | Executes an M (Power Query) query against a dataflow. |

> Always verify available commands via `--help`. Command names and availability may change between releases.
<!-- remove-section: end remove_available_tools_section -->

Expand Down
3 changes: 2 additions & 1 deletion servers/Fabric.Mcp.Server/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private static async Task<int> Main(string[] args)

services.AddLogging(builder =>
{
builder.AddConsole();
builder.AddConsole(options => options.LogToStandardErrorThreshold = LogLevel.Trace);
builder.SetMinimumLevel(LogLevel.Information);
});
Comment thread
Ebram-Tawfik marked this conversation as resolved.

Expand Down Expand Up @@ -77,6 +77,7 @@ private static IAreaSetup[] RegisterAreas()
new Fabric.Mcp.Tools.Docs.FabricDocsSetup(),
new Fabric.Mcp.Tools.OneLake.FabricOneLakeSetup(),
new Fabric.Mcp.Tools.Core.FabricCoreSetup(),
new Fabric.Mcp.Tools.DataFactory.DataFactoryAreaSetup(),
];
}

Expand Down
112 changes: 112 additions & 0 deletions tools/Fabric.Mcp.Tools.DataFactory/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Fabric.Mcp.Tools.DataFactory

Microsoft Fabric Data Factory MCP (Model Context Protocol) Tools — Manage pipelines and dataflows through AI agents and MCP clients.

## Overview

Data Factory is Microsoft Fabric's cloud-scale data integration service for creating, scheduling, and orchestrating ETL/ELT workflows. This MCP tool provides operations for working with Data Factory resources, enabling AI agents to:

- List, create, and get pipeline details
- Run pipelines on demand
- List and create Dataflow Gen2 items
- Execute M (Power Query) queries against dataflows

**Features:**
- 7 Data Factory commands with full MCP integration
- Pipeline management: list, create, get, run
- Dataflow Gen2 management: list, create
- Dataflow query execution with M/Power Query support
- Robust error handling via `ToolResult<T>` pattern
- Unit tested with 45 tests covering metadata, constructors, and options

## Prerequisites

- Microsoft Fabric workspace with Data Factory capabilities
- Azure authentication (Azure CLI or managed identity)
- Access to the target Fabric workspace

## Authentication

The tool uses Azure authentication via the Fabric MCP Server's authentication infrastructure. Ensure you're logged in:

```bash
az login
```

## Available Commands

### Pipeline Commands

| Command | Description | Read Only |
|---------|-------------|-----------|
| `datafactory_list-pipelines` | Lists all pipelines in a workspace | ✓ |
| `datafactory_create-pipeline` | Creates a new pipeline | ✗ |
| `datafactory_get-pipeline` | Gets details of a specific pipeline | ✓ |
| `datafactory_run-pipeline` | Runs a pipeline on demand | ✗ |

### Dataflow Commands

| Command | Description | Read Only |
|---------|-------------|-----------|
| `datafactory_list-dataflows` | Lists all Dataflow Gen2 items in a workspace | ✓ |
| `datafactory_create-dataflow` | Creates a new Dataflow Gen2 item | ✗ |
| `datafactory_execute-query` | Executes an M query against a dataflow | ✓ |

## Example Prompts

- "List all pipelines in my workspace"
- "Create a new pipeline called 'Daily ETL'"
- "Run the pipeline with ID abc-123 in workspace xyz"
- "List all dataflows in my workspace"
- "Execute this M query against my dataflow: `let Source = Sql.Database(\"server\", \"db\") in Source`"

## Architecture

The DataFactory tools are built on the [Microsoft.DataFactory.MCP.Core](https://www.nuget.org/packages/Microsoft.DataFactory.MCP.Core) NuGet package, which provides:

- **Handlers**: `PipelineHandler`, `DataflowHandler`, `DataflowQueryHandler` — business logic with comprehensive error handling
- **Services**: HTTP clients for Fabric REST API communication
- **Models**: Strongly-typed DTOs for API request/response

Commands follow the MCP framework pattern:
```
Command (MCP schema + validation) → Handler (business logic + error handling) → Service (HTTP API call)
```

## Development

### Building

```bash
cd tools/Fabric.Mcp.Tools.DataFactory
dotnet build src/Fabric.Mcp.Tools.DataFactory.csproj
```

### Testing

```bash
dotnet test tests/Fabric.Mcp.Tools.DataFactory.UnitTests/Fabric.Mcp.Tools.DataFactory.UnitTests.csproj
```

### Project Structure

```
tools/Fabric.Mcp.Tools.DataFactory/
├── src/
│ ├── Commands/
│ │ ├── Pipeline/ # Pipeline CRUD + run commands
│ │ └── Dataflow/ # Dataflow CRUD + query commands
│ ├── Models/ # Result DTOs and JSON context
│ ├── Options/ # Command option definitions
│ └── DataFactoryAreaSetup.cs # DI registration
└── tests/
└── Fabric.Mcp.Tools.DataFactory.UnitTests/
├── DataFactoryAreaSetupTests.cs
└── Commands/ # Per-command unit tests
```

## Related

- [Microsoft Fabric Data Factory documentation](https://learn.microsoft.com/fabric/data-factory/)
- [DataFactory.MCP.Core NuGet package](https://www.nuget.org/packages/Microsoft.DataFactory.MCP.Core)
- [Fabric MCP Server](https://github.com/microsoft/mcp/tree/main/servers/Fabric.Mcp.Server)
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using Fabric.Mcp.Tools.DataFactory.Models;
using Fabric.Mcp.Tools.DataFactory.Options;
using Fabric.Mcp.Tools.DataFactory.Options.Dataflow;
using global::DataFactory.MCP.Handlers.Dataflow;
using Microsoft.Extensions.Logging;
using Microsoft.Mcp.Core.Commands;
using Microsoft.Mcp.Core.Extensions;
using Microsoft.Mcp.Core.Models.Command;
using Microsoft.Mcp.Core.Models.Option;
using Microsoft.Mcp.Core.Options;

namespace Fabric.Mcp.Tools.DataFactory.Commands.Dataflow;

[CommandMetadata(
Id = "98c74b3b-1813-40db-9abe-30ad90beb236",
Name = "create-dataflow",
Title = "Create Dataflow",
Description = "Creates a new dataflow in a specified Microsoft Fabric workspace.",
Destructive = false,
Idempotent = false,
ReadOnly = false,
OpenWorld = false)]
public sealed class CreateDataflowCommand(
ILogger<CreateDataflowCommand> logger,
DataflowHandler handler) : GlobalCommand<CreateDataflowOptions>()
{
private readonly ILogger<CreateDataflowCommand> _logger = logger ?? throw new ArgumentNullException(nameof(logger));
private readonly DataflowHandler _handler = handler ?? throw new ArgumentNullException(nameof(handler));

protected override void RegisterOptions(Command command)
{
base.RegisterOptions(command);
command.Options.Add(DataFactoryOptionDefinitions.WorkspaceId.AsRequired());
command.Options.Add(DataFactoryOptionDefinitions.DisplayName.AsRequired());
command.Options.Add(DataFactoryOptionDefinitions.Description.AsOptional());
}

protected override CreateDataflowOptions BindOptions(ParseResult parseResult)
{
var options = base.BindOptions(parseResult);
options.WorkspaceId = parseResult.GetValueOrDefault<string>(DataFactoryOptionDefinitions.WorkspaceIdName) ?? string.Empty;
options.DisplayName = parseResult.GetValueOrDefault<string>(DataFactoryOptionDefinitions.DisplayNameName) ?? string.Empty;
options.Description = parseResult.GetValueOrDefault<string>(DataFactoryOptionDefinitions.DescriptionName);
return options;
}

public override async Task<CommandResponse> ExecuteAsync(CommandContext context, ParseResult parseResult, CancellationToken cancellationToken)
{
if (!Validate(parseResult.CommandResult, context.Response).IsValid)
{
return context.Response;
}

var options = BindOptions(parseResult);
var result = await _handler.CreateAsync(options.WorkspaceId, options.DisplayName, options.Description);
if (result.IsSuccess)
{
_logger.LogInformation("Successfully created dataflow '{DisplayName}' in workspace {WorkspaceId}",
options.DisplayName, options.WorkspaceId);

// Map CreateDataflowResponse to Dataflow for the result
var response = result.Value!.Dataflow;
var dataflow = new global::DataFactory.MCP.Models.Dataflow.Dataflow
{
Id = response.Id,
DisplayName = response.DisplayName,
Description = response.Description,
Type = response.Type,
WorkspaceId = response.WorkspaceId,
FolderId = response.FolderId
};

var commandResult = new CreateDataflowCommandResult(dataflow);
context.Response.Results = ResponseResult.Create(commandResult, DataFactoryJsonContext.Default.CreateDataflowCommandResult);
}
else
{
_logger.LogError("Error creating dataflow '{DisplayName}' in workspace {WorkspaceId}: {Error}",
options.DisplayName, options.WorkspaceId, result.Error);
HandleException(context, new Exception(result.Error));
Comment thread
Ebram-Tawfik marked this conversation as resolved.
}

return context.Response;
}
}
Loading