@azure/mcp 3.0.0-beta.44 โ 3.0.0-beta.46
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/README.md +58 -1
- package/index.js +231 -35
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -330,6 +330,14 @@ Example prompts that generate Azure CLI commands:
|
|
|
330
330
|
* "Publish an event with data '{\"name\": \"test\"}' to topic 'my-topic' using CloudEvents schema"
|
|
331
331
|
* "Send custom event data to Event Grid topic 'analytics-events' with EventGrid schema"
|
|
332
332
|
|
|
333
|
+
### โก Azure Event Hubs
|
|
334
|
+
|
|
335
|
+
* "Get details for Event Hubs namespace 'my-namespace' in resource group 'my-rg'"
|
|
336
|
+
* "Update tags on Event Hubs namespace 'my-namespace' in resource group 'my-rg'"
|
|
337
|
+
* "Get details for Event Hub 'my-eventhub' in namespace 'my-namespace' of resource group 'my-rg'"
|
|
338
|
+
* "Get consumer group 'my-consumergroup' for Event Hub 'my-eventhub' in namespace 'my-namespace' of resource group 'my-rg'"
|
|
339
|
+
* "Delete consumer group 'my-consumergroup' from Event Hub 'my-eventhub' in namespace 'my-namespace' and resource group 'my-rg'"
|
|
340
|
+
|
|
333
341
|
### ๐ Azure File Shares
|
|
334
342
|
|
|
335
343
|
* "Get details about a specific file share in my resource group"
|
|
@@ -395,6 +403,11 @@ Example prompts that generate Azure CLI commands:
|
|
|
395
403
|
* "List the node pools for my AKS cluster"
|
|
396
404
|
* "Get details for the node pool 'np1' of my AKS cluster 'my-aks-cluster' in the 'my-resource-group' resource group"
|
|
397
405
|
|
|
406
|
+
### ๐ Azure Managed Grafana
|
|
407
|
+
|
|
408
|
+
* "List all Managed Grafana workspaces in my subscription"
|
|
409
|
+
* "Find Azure Managed Grafana workspaces available in subscription 'my-subscription'"
|
|
410
|
+
|
|
398
411
|
### โก Azure Managed Lustre
|
|
399
412
|
|
|
400
413
|
* "List the Azure Managed Lustre clusters in resource group 'my-resource-group'"
|
|
@@ -421,12 +434,34 @@ Example prompts that generate Azure CLI commands:
|
|
|
421
434
|
* "Continue to the next orchestration step after I complete the previous action"
|
|
422
435
|
* "Send brownfield analysis findings to continue migration planning"
|
|
423
436
|
|
|
437
|
+
### ๐ Azure Quota
|
|
438
|
+
|
|
439
|
+
* "Check resource usage and quota for 'Microsoft.App/containerApps' in region 'eastus'"
|
|
440
|
+
* "Check current quota and usage for 'Microsoft.Compute/virtualMachines,Microsoft.Storage/storageAccounts' in 'westeurope'"
|
|
441
|
+
* "List available regions for resource type 'Microsoft.Web/sites'"
|
|
442
|
+
* "Find available regions for cognitive service model 'gpt-4o' of type 'Microsoft.CognitiveServices/accounts'"
|
|
443
|
+
|
|
424
444
|
### ๐ง Azure Resource Management
|
|
425
445
|
|
|
426
446
|
* "List my resource groups"
|
|
427
447
|
* "List my Azure CDN endpoints"
|
|
428
448
|
* "Help me build an Azure application using Node.js"
|
|
429
449
|
|
|
450
|
+
### ๐ฉบ Azure Resource Health
|
|
451
|
+
|
|
452
|
+
* "Get availability status for resource '/subscriptions/my-sub/resourceGroups/my-rg/providers/Microsoft.Compute/virtualMachines/my-vm'"
|
|
453
|
+
* "Check current health and availability of my Azure resource 'my-vm'"
|
|
454
|
+
* "List active service health issues in my subscription"
|
|
455
|
+
* "List planned maintenance events affecting my Azure resources"
|
|
456
|
+
* "Find service health event details for tracking ID 'ABC1-XYZ'"
|
|
457
|
+
|
|
458
|
+
### ๐ฒ Azure Retail Pricing
|
|
459
|
+
|
|
460
|
+
* "Get retail pricing for SKU 'Standard_D2s_v5' in region 'eastus'"
|
|
461
|
+
* "Check pricing for Virtual Machines SKU 'Standard_E4s_v5' in region 'westeurope' with currency 'EUR'"
|
|
462
|
+
* "Get one-year and three-year reservation pricing for SKU 'Standard_B2s'"
|
|
463
|
+
* "Find retail prices for Azure App Service in region 'centralus'"
|
|
464
|
+
|
|
430
465
|
### ๐๏ธ Azure SQL Database
|
|
431
466
|
|
|
432
467
|
* "List all SQL servers in my subscription"
|
|
@@ -444,6 +479,12 @@ Example prompts that generate Azure CLI commands:
|
|
|
444
479
|
* "Show me details about my Azure SQL server 'myserver'"
|
|
445
480
|
* "Delete my Azure SQL server 'myserver'"
|
|
446
481
|
|
|
482
|
+
### ๐ถ Azure SignalR Service
|
|
483
|
+
|
|
484
|
+
* "List all SignalR services in my subscription"
|
|
485
|
+
* "List SignalR services in resource group 'my-resource-group'"
|
|
486
|
+
* "Get details for SignalR service 'my-signalr' in resource group 'my-resource-group'"
|
|
487
|
+
|
|
447
488
|
### ๐ค Azure SRE Agent
|
|
448
489
|
|
|
449
490
|
* "List my Azure SRE Agent resources"
|
|
@@ -498,6 +539,11 @@ Example prompts that generate Azure CLI commands:
|
|
|
498
539
|
* "List the recovery jobs of recovery plan 'my-recovery-plan' in service group 'my-service-group'"
|
|
499
540
|
* "Check whether recovery plan 'my-recovery-plan' and its protected resources are ready for recovery operations in service group 'my-service-group'"
|
|
500
541
|
* "Validate which resources in recovery plan 'my-recovery-plan' in service group 'my-service-group' can fail over from 'eastus'"
|
|
542
|
+
* "Fail over recovery plan 'my-recovery-plan' in service group 'my-service-group' from source location 'eastus'"
|
|
543
|
+
* "Reprotect resources for recovery plan 'my-recovery-plan' in service group 'my-service-group'"
|
|
544
|
+
* "Finalize recovery plan 'my-recovery-plan' in service group 'my-service-group'"
|
|
545
|
+
* "Resume paused recovery job 'my-job' for recovery plan 'my-recovery-plan' in service group 'my-service-group'"
|
|
546
|
+
* "Retry failed recovery job 'my-job' for recovery plan 'my-recovery-plan' in service group 'my-service-group'"
|
|
501
547
|
* "List all runs of drill 'my-drill' in service group 'my-service-group'"
|
|
502
548
|
* "Get drill run 'my-drill-run' for drill 'my-drill' in service group 'my-service-group'"
|
|
503
549
|
* "List all resources of drill run 'my-drill-run' for drill 'my-drill' in service group 'my-service-group'"
|
|
@@ -546,6 +592,14 @@ Example prompts that generate Azure CLI commands:
|
|
|
546
592
|
* "Get Well-Architected Framework guidance for App Service"
|
|
547
593
|
* "What's the architectural guidance for Azure Cosmos DB?"
|
|
548
594
|
|
|
595
|
+
### ๐ Azure Workbooks
|
|
596
|
+
|
|
597
|
+
* "List all workbooks in resource group 'my-resource-group'"
|
|
598
|
+
* "Show details and content of workbook with resource ID '<workbook_resource_id>'"
|
|
599
|
+
* "Create a new workbook named 'Cost Analysis' in resource group 'my-resource-group'"
|
|
600
|
+
* "Update workbook 'my-workbook-id' with new dashboard visualization content"
|
|
601
|
+
* "Delete workbook 'my-workbook-id' from resource group 'my-resource-group'"
|
|
602
|
+
|
|
549
603
|
## Complete List of Supported Azure Services
|
|
550
604
|
|
|
551
605
|
The Azure MCP Server provides tools for interacting with **45+ Azure service areas**:
|
|
@@ -571,6 +625,7 @@ The Azure MCP Server provides tools for interacting with **45+ Azure service are
|
|
|
571
625
|
- ๐ **Azure Database for PostgreSQL** - PostgreSQL database management
|
|
572
626
|
- ๐ญ **Azure Device Registry** - Device Registry namespace management
|
|
573
627
|
- ๐ **Azure Event Grid** - Event routing and management
|
|
628
|
+
- โก **Azure Event Hubs** - Namespace, event hub, and consumer group management
|
|
574
629
|
- ๐ **Azure File Shares** - Azure managed file share operations
|
|
575
630
|
- โก **Azure Functions** - Function App management and functions project files, language support, and templates source code
|
|
576
631
|
- ๐ก **Azure Insights** - Derive infrastructure insights from Azure Resource Graph patterns
|
|
@@ -588,13 +643,15 @@ The Azure MCP Server provides tools for interacting with **45+ Azure service are
|
|
|
588
643
|
- โ๏ธ **Azure Native ISV Services** - Third-party integrations
|
|
589
644
|
- ๐ก๏ธ **Azure Quick Review CLI** - Compliance scanning
|
|
590
645
|
- ๐ **Azure Quota** - Resource quota and usage management
|
|
646
|
+
- ๐ฒ **Azure Retail Pricing** - Retail pricing, reservation terms, and SKU cost lookup
|
|
591
647
|
- ๐ญ **Azure RBAC** - Access control management
|
|
592
648
|
- ๐ด **Azure Redis Cache** - In-memory data store
|
|
593
|
-
- ๐ก๏ธ **Azure Resilience Management** - Resilience goal templates, goal assignments, goal resources, usage plans, usage plan enrollments, recovery plans, recovery plan resources, recovery plan readiness checks, recovery jobs, recovery job resources, drills, drill resources, drill runs, drill run resources, and recovery plan failover validation
|
|
649
|
+
- ๐ก๏ธ **Azure Resilience Management** - Resilience goal templates, goal assignments, goal resources, usage plans, usage plan enrollments, recovery plans, recovery plan resources, recovery plan readiness checks, recovery jobs, recovery job resources, drills, drill resources, drill runs, drill run resources, recovery operations, and recovery plan failover validation
|
|
594
650
|
- ๐๏ธ **Azure Resource Groups** - Resource organization
|
|
595
651
|
- ๐ **Azure Service Bus** - Message queuing
|
|
596
652
|
- ๐งต **Azure Service Fabric** - Managed cluster node operations
|
|
597
653
|
- ๐ฅ **Azure Service Health** - Resource health status and availability
|
|
654
|
+
- ๐ถ **Azure SignalR Service** - SignalR service runtime management, network ACLs, and configuration
|
|
598
655
|
- ๐๏ธ **Azure SQL Database** - Relational database management
|
|
599
656
|
- ๐๏ธ **Azure SQL Elastic Pool** - Database resource sharing
|
|
600
657
|
- ๐๏ธ **Azure SQL Server** - Server administration
|
package/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
const fs = require('fs')
|
|
3
4
|
const os = require('os')
|
|
5
|
+
const path = require('path')
|
|
4
6
|
const packageJson = require('./package.json')
|
|
5
7
|
|
|
6
8
|
// Check if DEBUG environment variable is set
|
|
@@ -30,48 +32,239 @@ const packageName = packageJson.name
|
|
|
30
32
|
const packageVersion = packageJson.version
|
|
31
33
|
const platformPackageName = `${packageName}-${platform}-${arch}`
|
|
32
34
|
|
|
35
|
+
// Where the auto-install fallback below puts the platform package, in order of
|
|
36
|
+
// preference. It never goes in the caller's project: cwd is inherited from
|
|
37
|
+
// whoever spawned us - for an MCP client that is an unrelated user project -
|
|
38
|
+
// and a bare `npm install` resolves the nearest package.json from there and
|
|
39
|
+
// saves the platform package into it.
|
|
40
|
+
//
|
|
41
|
+
// The first choice lives inside this package, so it is tied to this version
|
|
42
|
+
// and goes away on uninstall. It is not writable for root-owned global installs
|
|
43
|
+
// or read-only filesystems, so the second is a per-user cache keyed by package
|
|
44
|
+
// and version. The OS temp directory is deliberately not used: on a shared
|
|
45
|
+
// machine another user could plant a package there for us to load.
|
|
46
|
+
//
|
|
47
|
+
// Neither directory has a package.json of its own: pointing npm at this
|
|
48
|
+
// package's manifest is a no-op, because the platform package is declared
|
|
49
|
+
// there as an optionalDependency that npm is already skipping (that skip is
|
|
50
|
+
// usually why we are in this code path at all).
|
|
51
|
+
//
|
|
52
|
+
// This only runs once the normal require has failed, so a working install never
|
|
53
|
+
// touches the home directory: os.homedir() throws when HOME is unset and the
|
|
54
|
+
// user has no passwd entry.
|
|
55
|
+
function getInstallDirs() {
|
|
56
|
+
const dirs = [path.join(__dirname, '.platform')]
|
|
57
|
+
try {
|
|
58
|
+
dirs.push(path.join(userCacheDir(), 'microsoft-mcp', platformPackageName, packageVersion))
|
|
59
|
+
} catch (err) {
|
|
60
|
+
debugLog(`No per-user cache directory available: ${err.message}`)
|
|
61
|
+
}
|
|
62
|
+
return dirs
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function userCacheDir() {
|
|
66
|
+
if (platform === 'win32') {
|
|
67
|
+
const localAppData = process.env.LOCALAPPDATA
|
|
68
|
+
return localAppData && path.isAbsolute(localAppData)
|
|
69
|
+
? localAppData
|
|
70
|
+
: path.join(os.homedir(), 'AppData', 'Local')
|
|
71
|
+
}
|
|
72
|
+
if (platform === 'darwin') {
|
|
73
|
+
return path.join(os.homedir(), 'Library', 'Caches')
|
|
74
|
+
}
|
|
75
|
+
// The XDG spec says to ignore a relative XDG_CACHE_HOME. Honoring one would
|
|
76
|
+
// put the cache under the caller's working directory.
|
|
77
|
+
const xdgCacheHome = process.env.XDG_CACHE_HOME
|
|
78
|
+
return xdgCacheHome && path.isAbsolute(xdgCacheHome) ? xdgCacheHome : path.join(os.homedir(), '.cache')
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function requireFromInstallDir(installDir) {
|
|
82
|
+
return require(path.join(installDir, 'node_modules', platformPackageName))
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function isWritableDir(dir) {
|
|
86
|
+
try {
|
|
87
|
+
fs.mkdirSync(dir, { recursive: true })
|
|
88
|
+
fs.accessSync(dir, fs.constants.W_OK)
|
|
89
|
+
return true
|
|
90
|
+
} catch (err) {
|
|
91
|
+
debugLog(`Cannot install platform package into ${dir}: ${err.message}`)
|
|
92
|
+
return false
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// MCP clients often start several copies of a server at once, and they all
|
|
97
|
+
// share one install directory. Concurrent npm installs into one prefix undo
|
|
98
|
+
// each other's work (one moves away the package another has just finished), so
|
|
99
|
+
// a lock file lets one process install while the others wait and then load
|
|
100
|
+
// what it installed.
|
|
101
|
+
const installLockName = '.install.lock'
|
|
102
|
+
// Longer than both npm attempts together. The PID check below catches a dead
|
|
103
|
+
// holder sooner; this is the backstop for a PID that has been reused.
|
|
104
|
+
const installLockStaleMs = 3 * 60 * 1000
|
|
105
|
+
const installLockPollMs = 250
|
|
106
|
+
|
|
107
|
+
// A holder that is killed - say, by an MCP client giving up on a slow first
|
|
108
|
+
// start - never releases its lock, so check whether it is still running rather
|
|
109
|
+
// than waiting the lock out.
|
|
110
|
+
function isStaleLock(lockPath) {
|
|
111
|
+
if (Date.now() - fs.statSync(lockPath).mtimeMs > installLockStaleMs) {
|
|
112
|
+
return true
|
|
113
|
+
}
|
|
114
|
+
const pid = Number(fs.readFileSync(lockPath, 'utf8'))
|
|
115
|
+
if (!pid) {
|
|
116
|
+
return false // created, but the holder has not written its PID yet
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
process.kill(pid, 0)
|
|
120
|
+
return false
|
|
121
|
+
} catch (err) {
|
|
122
|
+
return err.code === 'ESRCH'
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function isInstallInProgress(dir) {
|
|
127
|
+
try {
|
|
128
|
+
return !isStaleLock(path.join(dir, installLockName))
|
|
129
|
+
} catch {
|
|
130
|
+
return false // no lock
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function sleep(ms) {
|
|
135
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function acquireInstallLock(installDir) {
|
|
139
|
+
const lockPath = path.join(installDir, installLockName)
|
|
140
|
+
let announced = false
|
|
141
|
+
for (;;) {
|
|
142
|
+
try {
|
|
143
|
+
fs.writeFileSync(lockPath, String(process.pid), { flag: 'wx' })
|
|
144
|
+
return lockPath
|
|
145
|
+
} catch (err) {
|
|
146
|
+
if (err.code !== 'EEXIST') {
|
|
147
|
+
throw err
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
try {
|
|
152
|
+
if (isStaleLock(lockPath)) {
|
|
153
|
+
debugLog(`Removing stale install lock ${lockPath}`)
|
|
154
|
+
fs.rmSync(lockPath, { force: true })
|
|
155
|
+
continue
|
|
156
|
+
}
|
|
157
|
+
} catch (err) {
|
|
158
|
+
if (err.code !== 'ENOENT') {
|
|
159
|
+
throw err
|
|
160
|
+
}
|
|
161
|
+
continue // released between our attempt and the check
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (!announced) {
|
|
165
|
+
debugLog(`Waiting for another process to finish installing into ${installDir}`)
|
|
166
|
+
announced = true
|
|
167
|
+
}
|
|
168
|
+
sleep(installLockPollMs)
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Call with the install lock held.
|
|
173
|
+
function loadOrInstall(installDir) {
|
|
174
|
+
// Another process may have installed it while we waited for the lock.
|
|
175
|
+
try {
|
|
176
|
+
const installed = requireFromInstallDir(installDir)
|
|
177
|
+
debugLog(`Loaded ${platformPackageName} installed into ${installDir} by another process`)
|
|
178
|
+
return installed
|
|
179
|
+
} catch {
|
|
180
|
+
// Not installed yet
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const { execSync } = require('child_process')
|
|
184
|
+
|
|
185
|
+
console.error(`Installing missing platform package: ${platformPackageName}`)
|
|
186
|
+
debugLog(`Installing ${platformPackageName} into ${installDir}`)
|
|
187
|
+
|
|
188
|
+
// stdout is not inherited: for `server start` it carries the JSON-RPC
|
|
189
|
+
// protocol stream, and npm output written there would corrupt it.
|
|
190
|
+
const installOptions = {
|
|
191
|
+
cwd: installDir,
|
|
192
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
193
|
+
timeout: 60000 // 60 second timeout
|
|
194
|
+
}
|
|
195
|
+
// --prefix is relative to cwd so that no path goes through the shell, which
|
|
196
|
+
// would expand any `$` or backtick in it.
|
|
197
|
+
const installCommand = `npm install ${platformPackageName}@${packageVersion} --no-save --no-audit --no-fund --prefix .`
|
|
198
|
+
|
|
199
|
+
// Try to install the platform package
|
|
200
|
+
try {
|
|
201
|
+
execSync(installCommand, installOptions)
|
|
202
|
+
} catch (npmErr) {
|
|
203
|
+
// If npm install fails, try again against the registry
|
|
204
|
+
debugLog(`npm install failed, trying alternative installation methods: ${npmErr.message}`)
|
|
205
|
+
|
|
206
|
+
execSync(`${installCommand} --prefer-online`, installOptions)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Clear module cache and try to require again after installation
|
|
210
|
+
Object.keys(require.cache).forEach(key => {
|
|
211
|
+
if (key.includes(platformPackageName)) {
|
|
212
|
+
delete require.cache[key]
|
|
213
|
+
}
|
|
214
|
+
})
|
|
215
|
+
|
|
216
|
+
const installed = requireFromInstallDir(installDir)
|
|
217
|
+
console.error(`โ
Successfully installed and loaded ${platformPackageName}`)
|
|
218
|
+
return installed
|
|
219
|
+
}
|
|
220
|
+
|
|
33
221
|
// Try to load the platform package
|
|
34
222
|
let platformPackage
|
|
223
|
+
let loadErr
|
|
224
|
+
let installDirs
|
|
35
225
|
try {
|
|
36
226
|
debugLog(`Attempting to require platform package: ${platformPackageName}`)
|
|
37
227
|
platformPackage = require(platformPackageName)
|
|
38
228
|
} catch (err) {
|
|
39
|
-
|
|
229
|
+
loadErr = err
|
|
230
|
+
debugLog(`Failed to require ${platformPackageName}: ${err.message}`)
|
|
40
231
|
|
|
232
|
+
// Node never searches the install directories on its own, so an earlier
|
|
233
|
+
// auto-install is only found by looking there. Without this, every run would
|
|
234
|
+
// reinstall. A failed require (not installed, or a half-finished install)
|
|
235
|
+
// just falls through to installing again, and a directory another process is
|
|
236
|
+
// still installing into is left to the locked path below.
|
|
237
|
+
installDirs = getInstallDirs()
|
|
238
|
+
for (const dir of installDirs) {
|
|
239
|
+
if (isInstallInProgress(dir)) {
|
|
240
|
+
debugLog(`Skipping ${dir}: another process is installing into it`)
|
|
241
|
+
continue
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
platformPackage = requireFromInstallDir(dir)
|
|
245
|
+
debugLog(`Loaded previously installed ${platformPackageName} from ${dir}`)
|
|
246
|
+
break
|
|
247
|
+
} catch (cachedErr) {
|
|
248
|
+
debugLog(`No usable ${platformPackageName} in ${dir}: ${cachedErr.message}`)
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (!platformPackage) {
|
|
41
254
|
// Try to automatically install the missing platform package
|
|
255
|
+
let installDir
|
|
42
256
|
try {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
257
|
+
installDir = installDirs.find(isWritableDir)
|
|
258
|
+
if (!installDir) {
|
|
259
|
+
throw new Error(`No writable directory to install into (tried ${installDirs.join(', ')})`)
|
|
260
|
+
}
|
|
46
261
|
|
|
47
|
-
|
|
262
|
+
const lockPath = acquireInstallLock(installDir)
|
|
48
263
|
try {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
})
|
|
264
|
+
platformPackage = loadOrInstall(installDir)
|
|
265
|
+
} finally {
|
|
266
|
+
fs.rmSync(lockPath, { force: true })
|
|
62
267
|
}
|
|
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
268
|
} catch (installErr) {
|
|
76
269
|
debugLog(`Auto-install failed: ${installErr.message}`)
|
|
77
270
|
|
|
@@ -85,12 +278,15 @@ try {
|
|
|
85
278
|
console.error(`\n3. If using npx, clear the npx cache and try again:`)
|
|
86
279
|
console.error(` npx -y clear-npx-cache`)
|
|
87
280
|
console.error(` npx -y ${packageName}@latest --version`)
|
|
88
|
-
console.error(`\n4.
|
|
89
|
-
console.error(` npm install ${platformPackageName}
|
|
90
|
-
console.error(`\n5. Check your
|
|
91
|
-
console.error(
|
|
281
|
+
console.error(`\n4. Install the platform package manually to see npm's full output:`)
|
|
282
|
+
console.error(` npm install ${platformPackageName}@${packageVersion} --no-save --prefix "${installDir || installDirs[0]}"`)
|
|
283
|
+
console.error(`\n5. Check your Node version. npm silently skips the optional platform`)
|
|
284
|
+
console.error(` package when Node does not satisfy engines (${(packageJson.engines || {}).node}).`)
|
|
285
|
+
console.error(` You are running ${process.version}.`)
|
|
286
|
+
console.error(`\n6. Check your internet connection and try again`)
|
|
287
|
+
console.error(`\n7. If the issue persists, please report it at:`)
|
|
92
288
|
console.error(` https://github.com/microsoft/mcp/issues`)
|
|
93
|
-
console.error(`\nOriginal error: ${
|
|
289
|
+
console.error(`\nOriginal error: ${loadErr.message}`)
|
|
94
290
|
console.error(`Install error: ${installErr.message}`)
|
|
95
291
|
process.exit(1)
|
|
96
292
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/mcp",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.46",
|
|
4
4
|
"description": "Azure MCP Server - Model Context Protocol implementation for Azure",
|
|
5
5
|
"author": "Microsoft",
|
|
6
6
|
"homepage": "https://github.com/Microsoft/mcp/blob/main/servers/Azure.Mcp.Server#readme",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"url": "https://github.com/microsoft/mcp/issues"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
17
|
+
"url": "https://github.com/microsoft/mcp.git",
|
|
18
|
+
"type": "git"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=22.0.0"
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"arm64"
|
|
34
34
|
],
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@azure/mcp-darwin-arm64": "3.0.0-beta.
|
|
37
|
-
"@azure/mcp-
|
|
38
|
-
"@azure/mcp-
|
|
39
|
-
"@azure/mcp-
|
|
40
|
-
"@azure/mcp-
|
|
41
|
-
"@azure/mcp-
|
|
36
|
+
"@azure/mcp-darwin-arm64": "3.0.0-beta.46",
|
|
37
|
+
"@azure/mcp-linux-x64": "3.0.0-beta.46",
|
|
38
|
+
"@azure/mcp-linux-arm64": "3.0.0-beta.46",
|
|
39
|
+
"@azure/mcp-darwin-x64": "3.0.0-beta.46",
|
|
40
|
+
"@azure/mcp-win32-x64": "3.0.0-beta.46",
|
|
41
|
+
"@azure/mcp-win32-arm64": "3.0.0-beta.46"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"postinstall": "node ./scripts/post-install-script.js"
|