Repository navigation
Expand file tree
/
Copy pathgithub-copilot-capabilities.js
More file actions
321 lines (296 loc) · 10.7 KB
/
Copy pathgithub-copilot-capabilities.js
File metadata and controls
321 lines (296 loc) · 10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
/**
* GitHub Copilot Test Suite for MCP Fabric Analytics Server
*
* This file demonstrates the capabilities of the MCP server with 47 enterprise tools
* for Microsoft Fabric analytics, Spark monitoring, and workspace management.
*
* @fileoverview Comprehensive test suite for validating MCP Fabric Analytics integration
* @version 1.0.0
* @author Microsoft Fabric Analytics Team
*/
// Tool Categories Available in MCP Fabric Analytics Server
const TOOL_CATEGORIES = {
// Authentication and Health Monitoring (5 tools)
authentication: [
'validate-azure-cli-auth', // Validate Azure CLI authentication
'check-azure-cli-auth', // Check current auth status
'health-check', // Server health check
'server-status', // Get server status
'get-metrics' // Get server metrics
],
// Workspace Management (8 tools)
workspaceManagement: [
'list-fabric-workspaces', // List all accessible workspaces
'create-fabric-workspace', // Create new workspace
'get-workspace-details', // Get detailed workspace info
'update-workspace', // Update workspace properties
'delete-workspace', // Delete workspace
'list-workspace-users', // List workspace users
'add-workspace-user', // Add user to workspace
'remove-workspace-user' // Remove user from workspace
],
// Item Management (5 tools)
itemManagement: [
'list-fabric-items', // List items in workspace
'create-fabric-item', // Create new Fabric item
'get-item-details', // Get item details
'update-item', // Update item properties
'delete-item' // Delete Fabric item
],
// Capacity Management (4 tools)
capacityManagement: [
'list-fabric-capacities', // List available capacities
'get-capacity-details', // Get capacity details
'assign-workspace-to-capacity', // Assign workspace to capacity
'unassign-workspace-from-capacity' // Unassign workspace from capacity
],
// Data Pipeline Management (6 tools)
pipelineManagement: [
'list-data-pipelines', // List data pipelines
'create-data-pipeline', // Create new pipeline
'get-pipeline-details', // Get pipeline details
'run-pipeline', // Execute pipeline
'get-pipeline-run-status', // Check pipeline run status
'cancel-pipeline-run' // Cancel running pipeline
],
// Environment Management (5 tools)
environmentManagement: [
'list-fabric-environments', // List Fabric environments
'create-fabric-environment', // Create new environment
'get-environment-details', // Get environment details
'publish-environment', // Publish environment
'get-environment-staging-libraries' // Get staging libraries
],
// Power BI Integration (4 tools)
powerBIIntegration: [
'list-powerbi-dashboards', // List Power BI dashboards
'get-dashboard-details', // Get dashboard details
'create-dashboard', // Create new dashboard
'delete-dashboard' // Delete dashboard
],
// Advanced Spark History Server Analytics (5 tools)
sparkHistoryAnalytics: [
'mcp_fabric-analyt2_analyze-spark-history-job', // Analyze historical Spark jobs
'mcp_fabric-analyt2_analyze-spark-job-logs', // AI-powered log analysis
'mcp_fabric-analyt2_analyze-spark-job-performance', // Performance analysis
'mcp_fabric-analyt2_detect-spark-bottlenecks', // Bottleneck detection
'mcp_fabric-analyt2_spark-performance-recommendations' // AI recommendations
],
// Real-time Spark Monitoring (5 tools)
sparkMonitoring: [
'get-notebook-spark-applications', // List Spark applications
'get-spark-application-details', // Get application details
'cancel-spark-application', // Cancel Spark application
'get-spark-monitoring-dashboard', // Get monitoring dashboard
'analyze-spark-performance' // Real-time performance analysis
]
};
/**
* Sample usage scenarios for GitHub Copilot to understand the capabilities
*/
const USAGE_SCENARIOS = {
// Workspace Analytics Scenario
workspaceAnalytics: {
description: "Analyze workspace utilization and performance",
tools: [
'list-fabric-workspaces',
'get-workspace-details',
'list-fabric-items',
'get-capacity-details'
],
workflow: [
"1. List all workspaces to get overview",
"2. Get detailed info for specific workspaces",
"3. Analyze items in each workspace",
"4. Check capacity utilization"
]
},
// Spark Performance Optimization Scenario
sparkOptimization: {
description: "Comprehensive Spark job performance analysis and optimization",
tools: [
'get-notebook-spark-applications',
'get-spark-application-details',
'mcp_fabric-analyt2_analyze-spark-job-performance',
'mcp_fabric-analyt2_detect-spark-bottlenecks',
'mcp_fabric-analyt2_spark-performance-recommendations'
],
workflow: [
"1. List all running Spark applications",
"2. Get detailed metrics for specific applications",
"3. Analyze performance using AI-powered tools",
"4. Detect bottlenecks in CPU, memory, I/O, shuffle",
"5. Get AI-generated optimization recommendations"
]
},
// Data Pipeline Management Scenario
pipelineManagement: {
description: "End-to-end data pipeline lifecycle management",
tools: [
'list-data-pipelines',
'create-data-pipeline',
'run-pipeline',
'get-pipeline-run-status',
'cancel-pipeline-run'
],
workflow: [
"1. List existing pipelines",
"2. Create new pipeline for data processing",
"3. Execute pipeline with monitoring",
"4. Track run status and performance",
"5. Cancel if needed and analyze results"
]
},
// Power BI Dashboard Integration Scenario
dashboardIntegration: {
description: "Integrate and manage Power BI dashboards with Fabric",
tools: [
'list-powerbi-dashboards',
'get-dashboard-details',
'create-dashboard',
'list-fabric-items'
],
workflow: [
"1. List existing Power BI dashboards",
"2. Get detailed dashboard information",
"3. Create new dashboards from Fabric data",
"4. Link with Fabric items for real-time updates"
]
}
};
/**
* Authentication patterns for GitHub Copilot to understand
*/
const AUTHENTICATION_PATTERNS = {
azureCLI: {
method: "azure-cli",
description: "Uses Azure CLI authentication (recommended for enterprise)",
setup: "az login",
benefits: [
"No credential management required",
"Enterprise SSO integration",
"Multi-factor authentication support",
"Automatic token refresh"
]
},
bearerToken: {
method: "bearer-token",
description: "Direct bearer token authentication",
setup: "Set FABRIC_BEARER_TOKEN environment variable",
benefits: [
"Simple setup for development",
"Direct API access",
"Custom token management"
]
}
};
/**
* Error handling and fallback patterns
*/
const ERROR_HANDLING_PATTERNS = {
simulation: {
description: "Graceful fallback to simulation mode when APIs are unavailable",
triggers: [
"Network connectivity issues",
"API endpoint unavailability",
"Authentication failures",
"Rate limiting"
],
behavior: "Returns realistic sample data for continued development"
},
authentication: {
description: "Robust authentication with timeout protection",
features: [
"Automatic retry logic",
"Timeout protection for Claude Desktop",
"Cached authentication results",
"Multiple auth method support"
]
}
};
/**
* Performance characteristics for GitHub Copilot analysis
*/
const PERFORMANCE_CHARACTERISTICS = {
scalability: {
concurrent_requests: "Supports multiple concurrent tool invocations",
caching: "Intelligent caching of authentication and API responses",
timeout_handling: "Protected against hanging operations"
},
monitoring: {
health_endpoints: ["/health", "/ready", "/metrics"],
logging: "Structured logging with timestamps and context",
error_tracking: "Comprehensive error reporting and analysis"
},
spark_analytics: {
real_time: "Live monitoring of Spark applications",
historical: "Analysis of completed jobs via History Server",
ai_powered: "Machine learning-based performance recommendations",
bottleneck_detection: "Automated identification of performance issues"
}
};
/**
* Integration patterns for Claude Desktop
*/
const CLAUDE_INTEGRATION = {
configuration: {
file: "claude_desktop_config.json",
location: {
windows: "%APPDATA%\\Claude\\claude_desktop_config.json",
macos: "~/Library/Application Support/Claude/claude_desktop_config.json",
linux: "~/.config/claude/claude_desktop_config.json"
}
},
sample_queries: [
"List all my Fabric workspaces and their current capacity usage",
"Show me the performance analysis for Spark application app-12345",
"Create a new workspace for the analytics team",
"What are the top 5 performance bottlenecks in my Spark jobs?",
"Get AI recommendations for optimizing my data pipeline performance",
"Show me all Power BI dashboards connected to my lakehouse",
"Cancel the long-running Spark application and analyze why it's slow"
]
};
/**
* Export configuration for GitHub Copilot understanding
*/
module.exports = {
TOOL_CATEGORIES,
USAGE_SCENARIOS,
AUTHENTICATION_PATTERNS,
ERROR_HANDLING_PATTERNS,
PERFORMANCE_CHARACTERISTICS,
CLAUDE_INTEGRATION,
// Summary for quick reference
SUMMARY: {
total_tools: 47,
categories: 9,
authentication_methods: 2,
enterprise_features: [
"Advanced Spark Analytics",
"Workspace Management",
"Capacity Optimization",
"Pipeline Automation",
"Power BI Integration",
"Health Monitoring"
],
production_ready: true,
claude_desktop_compatible: true
}
};
/**
* GitHub Copilot: This MCP server provides comprehensive Microsoft Fabric analytics
* capabilities with 47 enterprise-grade tools across 9 categories. It supports
* real-time Spark monitoring, AI-powered performance analysis, workspace management,
* and seamless integration with Claude Desktop using Azure CLI authentication.
*
* Key capabilities:
* - Real-time Spark job monitoring and optimization
* - AI-powered performance recommendations
* - Complete workspace and item lifecycle management
* - Data pipeline automation and monitoring
* - Power BI dashboard integration
* - Enterprise authentication with Azure CLI
* - Production-ready health monitoring
* - Graceful error handling and simulation modes
*/