@microsoft/fabric-mcp 0.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +179 -0
- package/index.js +107 -0
- package/package.json +46 -0
- package/scripts/post-install-script.js +22 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright 2025 (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE
|
package/README.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# <img height="36" width="36" src="https://learn.microsoft.com/fabric/media/fabric-icon.png" alt="Microsoft Fabric Logo" /> Microsoft Fabric MCP Server NPM Package
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
A local, AI-friendly Model Context Protocol (MCP) server that packages Microsoft Fabric's OpenAPI specifications, schema definitions, examples, and curated guidance into a single context layer for AI agents and developer tools.
|
|
6
|
+
|
|
7
|
+
Why this project?
|
|
8
|
+
- Provide a reliable, local-first source of Fabric API context for AI assistants and code generation tools.
|
|
9
|
+
- Reduce the risk of leaking production credentials while enabling rich, example-driven development.
|
|
10
|
+
- Make Fabric API discovery, schema lookup, and best-practice retrieval reproducible and scriptable.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Table of Contents
|
|
15
|
+
- [What Can You Do?](#what-can-you-do)
|
|
16
|
+
- [Getting Started](#getting-started)
|
|
17
|
+
- [Available Tools](#available-tools)
|
|
18
|
+
- [Development and Contributing](#development-and-contributing)
|
|
19
|
+
- [Support](#support)
|
|
20
|
+
- [License](#license)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# What Can You Do?
|
|
25
|
+
|
|
26
|
+
The Fabric MCP Server unlocks practical developer workflows by providing local access to Fabric API context:
|
|
27
|
+
|
|
28
|
+
- Generate or scaffold Fabric resource definitions (Lakehouse, data pipelines, notebooks, reports).
|
|
29
|
+
- Retrieve official OpenAPI specs and JSON schema for validation and code generation.
|
|
30
|
+
- Get example request/response payloads to accelerate integration.
|
|
31
|
+
- Query curated best-practice guidance (pagination, LROs, authentication patterns).
|
|
32
|
+
|
|
33
|
+
<details>
|
|
34
|
+
<summary>Example prompts</summary>
|
|
35
|
+
|
|
36
|
+
- "Create a Lakehouse resource definition with a schema that enforces a string column and a datetime column."
|
|
37
|
+
- "Show me the OpenAPI operations for 'notebook' and give a sample creation body."
|
|
38
|
+
- "List recommended retry/backoff behavior for Fabric APIs when rate-limited."
|
|
39
|
+
- "What are the available Fabric workload types I can work with?"
|
|
40
|
+
- "Generate a data pipeline configuration with sample data sources."
|
|
41
|
+
- "Show me best practices for authenticating with Fabric APIs."
|
|
42
|
+
|
|
43
|
+
</details>
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
# Getting Started
|
|
48
|
+
|
|
49
|
+
## Prerequisites
|
|
50
|
+
- .NET 9.x SDK is recommended. Check `global.json` at the repository root for any pinned SDK version.
|
|
51
|
+
- If `global.json` pins a preview SDK not installed locally, either install the requested preview SDK or update `global.json` for local development.
|
|
52
|
+
- An MCP-compatible client (VS Code with an MCP extension, Claude Desktop, etc.).
|
|
53
|
+
|
|
54
|
+
## Installation Steps
|
|
55
|
+
|
|
56
|
+
1. **Clone the repository:**
|
|
57
|
+
```bash
|
|
58
|
+
git clone https://github.com/microsoft/mcp.git
|
|
59
|
+
cd mcp
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
2. **Build the project:**
|
|
63
|
+
```bash
|
|
64
|
+
dotnet build servers/Fabric.Mcp.Server/src/Fabric.Mcp.Server.csproj --configuration Release
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
3. **Locate your executable:**
|
|
68
|
+
The executable `fabmcp` will be created at:
|
|
69
|
+
```
|
|
70
|
+
servers/Fabric.Mcp.Server/src/bin/Release/fabmcp
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
> **Platform Notes:**
|
|
74
|
+
> - **macOS/Linux**: Use the path as-is: `/path/to/repo/servers/Fabric.Mcp.Server/src/bin/Release/fabmcp`
|
|
75
|
+
> - **Windows**: Use backslashes and may need `.exe` extension: `C:\path\to\repo\servers\Fabric.Mcp.Server\src\bin\Release\fabmcp`
|
|
76
|
+
> - For published builds, executables will be in platform-specific subdirectories with `.exe` extension on Windows
|
|
77
|
+
|
|
78
|
+
4. **Configure your MCP client:**
|
|
79
|
+
|
|
80
|
+
Example configuration for VS Code (.vscode/mcp.json):
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"servers": {
|
|
84
|
+
"Microsoft Fabric MCP": {
|
|
85
|
+
"command": "/path/to/executable",
|
|
86
|
+
"args": ["server", "start", "--mode", "all"]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
> **Notes:**
|
|
93
|
+
> - Replace `/path/to/executable` with the actual path from step 3
|
|
94
|
+
> - The `--mode all` argument enables all available tools
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## Common Issues
|
|
98
|
+
- **SDK mismatch:** If `dotnet` outputs an SDK resolution error, inspect `global.json` and align local SDKs or update the file.
|
|
99
|
+
- **Path issues:** Always use absolute paths in MCP configuration to avoid path resolution problems.
|
|
100
|
+
|
|
101
|
+
<!-- insert-section: vsix {{## Installation
|
|
102
|
+
|
|
103
|
+
The Fabric MCP Server extension is already installed! Simply start the server to begin using it.
|
|
104
|
+
|
|
105
|
+
### Starting the Server
|
|
106
|
+
|
|
107
|
+
1. Open the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`)
|
|
108
|
+
2. Run **MCP: List Servers**
|
|
109
|
+
3. Find **Fabric MCP Server** in the list and click the **Start** button
|
|
110
|
+
|
|
111
|
+
Once started, the Fabric MCP tools will be available in GitHub Copilot Chat.
|
|
112
|
+
|
|
113
|
+
### Configuration (Optional)
|
|
114
|
+
|
|
115
|
+
You can customize the server behavior in VS Code settings (search for "Fabric MCP"):
|
|
116
|
+
|
|
117
|
+
- **Server Mode**: Control how tools are exposed (`all` by default)
|
|
118
|
+
- **Server Arguments**: Add custom arguments to the server startup
|
|
119
|
+
|
|
120
|
+
Changes require restarting the MCP server from the **MCP: List Servers** view.
|
|
121
|
+
}} -->
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
# Available Tools
|
|
126
|
+
Use the server's CLI to query embedded data and examples. Commands are organized under a `publicapis` command group in code.
|
|
127
|
+
|
|
128
|
+
| Command | Purpose | Implementation |
|
|
129
|
+
|---|---|---|
|
|
130
|
+
| `publicapis list` | List supported workload names (e.g. notebook, report) | tools/Fabric.Mcp.Tools.PublicApi/src/Commands/PublicApis/ListWorkloadsCommand.cs |
|
|
131
|
+
| `publicapis get --workload-type <workload>` | Fetch OpenAPI & examples for a workload | tools/Fabric.Mcp.Tools.PublicApi/src/Commands/PublicApis/GetWorkloadApisCommand.cs |
|
|
132
|
+
| `publicapis platform get` | Retrieve platform-level API specs | tools/Fabric.Mcp.Tools.PublicApi/src/Commands/PublicApis/GetPlatformApisCommand.cs |
|
|
133
|
+
| `publicapis bestpractices get --workload-type <workload>` | Retrieve best-practice guidance for a workload | tools/Fabric.Mcp.Tools.PublicApi/src/Commands/BestPractices/GetBestPracticesCommand.cs |
|
|
134
|
+
| `publicapis examples get --workload-type <workload>` | Retrieve example request/response files for a workload | tools/Fabric.Mcp.Tools.PublicApi/src/Commands/BestPractices/GetExamplesCommand.cs |
|
|
135
|
+
| `publicapis itemdefinition get --workload-type <workload>` | Get JSON schema definitions for a workload | tools/Fabric.Mcp.Tools.PublicApi/src/Commands/BestPractices/GetWorkloadDefinitionCommand.cs |
|
|
136
|
+
|
|
137
|
+
> Always verify the available commands in your build via `--help` before scripting against them; command names and availability are code-driven and may change between releases.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
# Development and Contributing
|
|
142
|
+
|
|
143
|
+
We welcome contributions. Please follow the repository's contribution guidelines and the checklist below when preparing a PR.
|
|
144
|
+
|
|
145
|
+
**Contributor checklist**
|
|
146
|
+
- Create a focused branch for your changes.
|
|
147
|
+
- Run a local build and unit tests for affected projects.
|
|
148
|
+
- Update `CHANGELOG.md` for user-visible changes.
|
|
149
|
+
- Run `eng` validation scripts where applicable (spelling, linters).
|
|
150
|
+
- Provide a clear PR description and link relevant issues.
|
|
151
|
+
|
|
152
|
+
See [CONTRIBUTING](https://github.com/microsoft/mcp/blob/main/CONTRIBUTING.md) for full guidance.
|
|
153
|
+
|
|
154
|
+
<!-- insert-section: vsix {{Interested in contributing to the Fabric MCP Server? Visit the [GitHub repository](https://github.com/microsoft/mcp) to get started.
|
|
155
|
+
|
|
156
|
+
See [CONTRIBUTING](https://github.com/microsoft/mcp/blob/main/CONTRIBUTING.md) for full contribution guidelines.
|
|
157
|
+
}} -->
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
# Support
|
|
162
|
+
If you encounter issues:
|
|
163
|
+
1. Search existing issues.
|
|
164
|
+
2. If none match, file a new issue with:
|
|
165
|
+
- OS and `.NET` SDK version (`dotnet --info`).
|
|
166
|
+
- The command used to start the server.
|
|
167
|
+
- Server logs and MCP client config (redact secrets).
|
|
168
|
+
- Steps to reproduce.
|
|
169
|
+
<!-- insert-section: vsix {{ - Your OS and VS Code version
|
|
170
|
+
- Server logs from the **MCP: List Servers** view
|
|
171
|
+
- Steps to reproduce the issue
|
|
172
|
+
}} -->
|
|
173
|
+
|
|
174
|
+
For troubleshooting steps, see [TROUBLESHOOTING](https://github.com/microsoft/mcp/blob/main/servers/Fabric.Mcp.Server/TROUBLESHOOTING.md).
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
# License
|
|
179
|
+
This project is licensed under the MIT License ā see the [LICENSE](https://github.com/microsoft/mcp/blob/main/LICENSE) file for details.
|
package/index.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const os = require('os')
|
|
4
|
+
const packageJson = require('./package.json')
|
|
5
|
+
|
|
6
|
+
// Check if DEBUG environment variable is set
|
|
7
|
+
const isDebugMode = process.env.DEBUG && (
|
|
8
|
+
process.env.DEBUG.toLowerCase() === 'true' ||
|
|
9
|
+
process.env.DEBUG.includes('mcp') ||
|
|
10
|
+
process.env.DEBUG === '*'
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
// Helper function for debug logging
|
|
14
|
+
function debugLog(...args) {
|
|
15
|
+
if (isDebugMode) {
|
|
16
|
+
console.error(...args)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
debugLog('\nWrapper package starting')
|
|
21
|
+
debugLog('All args:')
|
|
22
|
+
process.argv.forEach((val, index) => {
|
|
23
|
+
debugLog(`${index}: ${val}`)
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const platform = os.platform()
|
|
27
|
+
const arch = os.arch()
|
|
28
|
+
|
|
29
|
+
const packageName = packageJson.name
|
|
30
|
+
const packageVersion = packageJson.version
|
|
31
|
+
const platformPackageName = `${packageName}-${platform}-${arch}`
|
|
32
|
+
|
|
33
|
+
// Try to load the platform package
|
|
34
|
+
let platformPackage
|
|
35
|
+
try {
|
|
36
|
+
debugLog(`Attempting to require platform package: ${platformPackageName}`)
|
|
37
|
+
platformPackage = require(platformPackageName)
|
|
38
|
+
} catch (err) {
|
|
39
|
+
debugLog(`Failed to require ${platformPackageName}, attempting auto-install: ${err.message}`)
|
|
40
|
+
|
|
41
|
+
// Try to automatically install the missing platform package
|
|
42
|
+
try {
|
|
43
|
+
const { execSync } = require('child_process')
|
|
44
|
+
|
|
45
|
+
console.error(`Installing missing platform package: ${platformPackageName}`)
|
|
46
|
+
|
|
47
|
+
// Try to install the platform package
|
|
48
|
+
try {
|
|
49
|
+
execSync(`npm install ${platformPackageName}@${packageVersion}`, {
|
|
50
|
+
stdio: ['inherit', 'inherit', 'pipe'], // Only pipe stderr to capture errors
|
|
51
|
+
timeout: 60000 // 60 second timeout
|
|
52
|
+
})
|
|
53
|
+
} catch (npmErr) {
|
|
54
|
+
// If npm install fails, try with --no-save and different install strategies
|
|
55
|
+
debugLog(`npm install failed, trying alternative installation methods: ${npmErr.message}`)
|
|
56
|
+
|
|
57
|
+
// Try with --no-save and --prefer-online
|
|
58
|
+
execSync(`npm install ${platformPackageName}@${packageVersion} --no-save --prefer-online`, {
|
|
59
|
+
stdio: ['inherit', 'inherit', 'pipe'],
|
|
60
|
+
timeout: 60000
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Clear module cache and try to require again after installation
|
|
65
|
+
Object.keys(require.cache).forEach(key => {
|
|
66
|
+
if (key.includes(platformPackageName)) {
|
|
67
|
+
delete require.cache[key]
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
platformPackage = require(platformPackageName)
|
|
72
|
+
|
|
73
|
+
console.error(`ā
Successfully installed and loaded ${platformPackageName}`)
|
|
74
|
+
|
|
75
|
+
} catch (installErr) {
|
|
76
|
+
debugLog(`Auto-install failed: ${installErr.message}`)
|
|
77
|
+
|
|
78
|
+
console.error(`\nā Failed to load platform specific package '${platformPackageName}'`)
|
|
79
|
+
console.error(`\nš Troubleshooting steps:`)
|
|
80
|
+
console.error(`\n1. Clear npm cache:`)
|
|
81
|
+
console.error(` npm cache clean --force`)
|
|
82
|
+
console.error(`\n2. If installing as a global tool, uninstall and reinstall:`)
|
|
83
|
+
console.error(` npm uninstall -g ${packageName}`)
|
|
84
|
+
console.error(` npm install -g ${packageName}`)
|
|
85
|
+
console.error(`\n3. If using npx, clear the npx cache and try again:`)
|
|
86
|
+
console.error(` npx -y clear-npx-cache`)
|
|
87
|
+
console.error(` npx -y ${packageName}@latest --version`)
|
|
88
|
+
console.error(`\n4. Manually install the platform package to check compatibility:`)
|
|
89
|
+
console.error(` npm install ${platformPackageName}@latest`)
|
|
90
|
+
console.error(`\n5. Check your internet connection and try again`)
|
|
91
|
+
console.error(`\n6. If the issue persists, please report it at:`)
|
|
92
|
+
console.error(` https://github.com/microsoft/mcp/issues`)
|
|
93
|
+
console.error(`\nOriginal error: ${err.message}`)
|
|
94
|
+
console.error(`Install error: ${installErr.message}`)
|
|
95
|
+
process.exit(1)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
platformPackage.runExecutable(process.argv.slice(2))
|
|
100
|
+
.then((code) => {
|
|
101
|
+
debugLog(`Process exited with code: ${code}`)
|
|
102
|
+
process.exit(code)
|
|
103
|
+
})
|
|
104
|
+
.catch((err) => {
|
|
105
|
+
console.error(`Error: ${err.message}`)
|
|
106
|
+
process.exit(1)
|
|
107
|
+
})
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@microsoft/fabric-mcp",
|
|
3
|
+
"version": "0.0.0-beta.1",
|
|
4
|
+
"description": "Microsoft Fabric MCP Server - Model Context Protocol implementation for Fabric",
|
|
5
|
+
"author": "Microsoft",
|
|
6
|
+
"homepage": "https://github.com/Microsoft/mcp/blob/main/servers/Fabric.Mcp.Server#readme",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"fabric",
|
|
10
|
+
"mcp",
|
|
11
|
+
"model-context-protocol"
|
|
12
|
+
],
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/microsoft/mcp/issues"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/microsoft/mcp.git"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=20.0.0"
|
|
22
|
+
},
|
|
23
|
+
"bin": {
|
|
24
|
+
"fabmcp": "./index.js"
|
|
25
|
+
},
|
|
26
|
+
"os": [
|
|
27
|
+
"linux",
|
|
28
|
+
"darwin",
|
|
29
|
+
"win32"
|
|
30
|
+
],
|
|
31
|
+
"cpu": [
|
|
32
|
+
"x64",
|
|
33
|
+
"arm64"
|
|
34
|
+
],
|
|
35
|
+
"optionalDependencies": {
|
|
36
|
+
"@microsoft/fabric-mcp-darwin-x64": "0.0.0-beta.1",
|
|
37
|
+
"@microsoft/fabric-mcp-darwin-arm64": "0.0.0-beta.1",
|
|
38
|
+
"@microsoft/fabric-mcp-win32-x64": "0.0.0-beta.1",
|
|
39
|
+
"@microsoft/fabric-mcp-linux-x64": "0.0.0-beta.1",
|
|
40
|
+
"@microsoft/fabric-mcp-linux-arm64": "0.0.0-beta.1",
|
|
41
|
+
"@microsoft/fabric-mcp-win32-arm64": "0.0.0-beta.1"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"postinstall": "node ./scripts/post-install-script.js"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const os = require('os');
|
|
2
|
+
|
|
3
|
+
const platform = os.platform();
|
|
4
|
+
const arch = os.arch();
|
|
5
|
+
|
|
6
|
+
let baseName = '';
|
|
7
|
+
try{
|
|
8
|
+
const packageJson = require('../package.json');
|
|
9
|
+
baseName = packageJson.name;
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
console.error('Unable to verify platform package installation. Error reading package.json.');
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const requiredPackage = `${baseName}-${platform}-${arch}`;
|
|
17
|
+
try {
|
|
18
|
+
require.resolve(requiredPackage);
|
|
19
|
+
} catch (err) {
|
|
20
|
+
console.error(`Missing required package: '${requiredPackage}'. Follow the troubleshooting steps - https://aka.ms/azmcp/troubleshooting#platform-package-installation-issues`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|