@azure/mcp 0.3.2 → 0.4.0
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 +7 -18
- package/index.js +57 -2
- package/package.json +11 -8
- package/scripts/post-install-script.js +13 -0
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ Here's a short (16 seconds) video to help you get the Azure MCP Server installed
|
|
|
21
21
|
| Name | Description | Read/Write Tools | Read Only Tools |
|
|
22
22
|
|--------------|-----------------------------------------------------------------------------------------------|-----------|-----------|
|
|
23
23
|
| All | All Azure MCP tools in a single server. | [](https://vscode.dev/redirect/mcp/install?name=Azure%20Server&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22@azure%2Fmcp%40latest%22%2C%22server%22%2C%22start%22%5D%7D) | [](https://vscode.dev/redirect/mcp/install?name=Azure%20Server%20Read%20Only&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22@azure%2Fmcp%40latest%22%2C%22server%22%2C%22start%22%2C%22--read-only%22%5D%7D) |
|
|
24
|
+
| Azure Kubernetes Service (AKS) | List and manage clusters. | [](https://insiders.vscode.dev/redirect/mcp/install?name=Azure%20AKS&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22@azure%2Fmcp%40latest%22%2C%22server%22%2C%22start%22%2C%22--namespace%22%2C%22aks%22%5D%7D) | [](https://insiders.vscode.dev/redirect/mcp/install?name=Azure%20AKS%20Read%20Only&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22@azure%2Fmcp%40latest%22%2C%22server%22%2C%22start%22%2C%22--namespace%22%2C%22aks%22%2C%22--read-only%22%5D%7D) |
|
|
24
25
|
| App Configuration | Manage configuration stores and key-value pairs. | [](https://vscode.dev/redirect/mcp/install?name=Azure%20App%20Config&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22@azure%2Fmcp%40latest%22%2C%22server%22%2C%22start%22%2C%22--namespace%22%2C%22appconfig%22%5D%7D) | [](https://vscode.dev/redirect/mcp/install?name=Azure%20App%20Config%20Read%20Only&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22@azure%2Fmcp%40latest%22%2C%22server%22%2C%22start%22%2C%22--namespace%22%2C%22appconfig%22%2C%22--read-only%22%5D%7D) |
|
|
25
26
|
| Azure Data Explorer | Query and manage clusters and databases. | [](https://vscode.dev/redirect/mcp/install?name=Azure%20Kusto&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22@azure%2Fmcp%40latest%22%2C%22server%22%2C%22start%22%2C%22--namespace%22%2C%22kusto%22%5D%7D) | [](https://vscode.dev/redirect/mcp/install?name=Azure%20Kusto%20Read%20Only&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22@azure%2Fmcp%40latest%22%2C%22server%22%2C%22start%22%2C%22--namespace%22%2C%22kusto%22%2C%22--read-only%22%5D%7D) |
|
|
26
27
|
| Best Practices | Secure, production-grade Azure SDK guidance. | [](https://vscode.dev/redirect/mcp/install?name=Azure%20Best%20Practices&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22@azure%2Fmcp%40latest%22%2C%22server%22%2C%22start%22%2C%22--namespace%22%2C%22bestpractices%22%5D%7D) | [](https://vscode.dev/redirect/mcp/install?name=Azure%20Best%20Practices%20Read%20Only&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22@azure%2Fmcp%40latest%22%2C%22server%22%2C%22start%22%2C%22--namespace%22%2C%22bestpractices%22%2C%22--read-only%22%5D%7D) |
|
|
@@ -57,6 +58,10 @@ The Azure MCP Server supercharges your agents with Azure context. Here are some
|
|
|
57
58
|
### ⚙️ Azure App Configuration
|
|
58
59
|
- "List my App Configuration stores"
|
|
59
60
|
|
|
61
|
+
### ☸️ Azure Kubernetes Service (AKS)
|
|
62
|
+
- "List my AKS clusters in my subscription"
|
|
63
|
+
- "Show me all my Azure Kubernetes Service clusters"
|
|
64
|
+
|
|
60
65
|
### 📊 Azure Cosmos DB
|
|
61
66
|
- "Show me all my Cosmos DB databases"
|
|
62
67
|
- "List containers in my Cosmos DB database"
|
|
@@ -99,7 +104,7 @@ The Azure MCP Server supercharges your agents with Azure context. Here are some
|
|
|
99
104
|
- Handle labeled configurations
|
|
100
105
|
- Lock/unlock configuration settings
|
|
101
106
|
|
|
102
|
-
###
|
|
107
|
+
### 🖥️ Azure CLI Extension
|
|
103
108
|
- Execute Azure CLI commands directly
|
|
104
109
|
- Support for all Azure CLI functionality
|
|
105
110
|
- JSON output formatting
|
|
@@ -241,7 +246,7 @@ AZURE_CLIENT_SECRET={YOUR_AZURE_CLIENT_SECRET}
|
|
|
241
246
|
Optionally, customers can use `--env` or `--volume` to pass authentication values.
|
|
242
247
|
|
|
243
248
|
#### 🤖 Custom MCP Client Install Steps (Optional)
|
|
244
|
-
You can easily configure your MCP client to use the Azure MCP Server. Have your client run the following command and access it via standard IO
|
|
249
|
+
You can easily configure your MCP client to use the Azure MCP Server. Have your client run the following command and access it via standard IO.
|
|
245
250
|
|
|
246
251
|
#### 🔧 Manual Install Steps (Optional)
|
|
247
252
|
For a step-by-step installation, follow these instructions:
|
|
@@ -288,22 +293,6 @@ You can optionally set the `--namespace <namespace>` flag to install tools for t
|
|
|
288
293
|
|
|
289
294
|
Configure the MCP client to execute: `npx -y @azure/mcp@latest server start`. For instructions on using , follow instructions in [Quick install with VS Code](#-quick-install-with-vs-code) or [Manual Install](#-manual-install).
|
|
290
295
|
|
|
291
|
-
### Using SSE
|
|
292
|
-
|
|
293
|
-
1. Open a terminal window and execute: `npx -y @azure/mcp@latest server start --transport sse`
|
|
294
|
-
2. The server starts up and is hosted at: http://localhost:5008. To use another port, append `--port {YOUR-PORT-NUMBER}`.
|
|
295
|
-
3. Open your MCP client and add the SSE configuration value. This may differ between MCP clients. In VS Code, it will look like:
|
|
296
|
-
```json
|
|
297
|
-
{
|
|
298
|
-
"servers": {
|
|
299
|
-
"Azure MCP Server": {
|
|
300
|
-
"type": "sse",
|
|
301
|
-
"url": "http://localhost:5008/sse"
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
```
|
|
306
|
-
|
|
307
296
|
More end-to-end MCP client/agent guides are coming soon!
|
|
308
297
|
</details>
|
|
309
298
|
|
package/index.js
CHANGED
|
@@ -33,8 +33,63 @@ try {
|
|
|
33
33
|
debugLog(`Attempting to require platform package: ${platformPackageName}`)
|
|
34
34
|
platformPackage = require(platformPackageName)
|
|
35
35
|
} catch (err) {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
debugLog(`Failed to require ${platformPackageName}, attempting auto-install: ${err.message}`)
|
|
37
|
+
|
|
38
|
+
// Try to automatically install the missing platform package
|
|
39
|
+
try {
|
|
40
|
+
const { execSync } = require('child_process')
|
|
41
|
+
|
|
42
|
+
console.error(`Installing missing platform package: ${platformPackageName}`)
|
|
43
|
+
|
|
44
|
+
// Try to install the platform package
|
|
45
|
+
try {
|
|
46
|
+
execSync(`npm install ${platformPackageName}@latest`, {
|
|
47
|
+
stdio: ['inherit', 'inherit', 'pipe'], // Only pipe stderr to capture errors
|
|
48
|
+
timeout: 60000 // 60 second timeout
|
|
49
|
+
})
|
|
50
|
+
} catch (npmErr) {
|
|
51
|
+
// If npm install fails, try with --no-save and different install strategies
|
|
52
|
+
debugLog(`npm install failed, trying alternative installation methods: ${npmErr.message}`)
|
|
53
|
+
|
|
54
|
+
// Try with --no-save and --prefer-online
|
|
55
|
+
execSync(`npm install ${platformPackageName}@latest --no-save --prefer-online`, {
|
|
56
|
+
stdio: ['inherit', 'inherit', 'pipe'],
|
|
57
|
+
timeout: 60000
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Clear module cache and try to require again after installation
|
|
62
|
+
Object.keys(require.cache).forEach(key => {
|
|
63
|
+
if (key.includes(platformPackageName)) {
|
|
64
|
+
delete require.cache[key]
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
platformPackage = require(platformPackageName)
|
|
69
|
+
|
|
70
|
+
console.error(`✅ Successfully installed and loaded ${platformPackageName}`)
|
|
71
|
+
|
|
72
|
+
} catch (installErr) {
|
|
73
|
+
debugLog(`Auto-install failed: ${installErr.message}`)
|
|
74
|
+
|
|
75
|
+
console.error(`\n❌ Failed to load platform specific package '${platformPackageName}'`)
|
|
76
|
+
console.error(`\n🔍 Troubleshooting steps:`)
|
|
77
|
+
console.error(`\n1. Clear npm cache and reinstall:`)
|
|
78
|
+
console.error(` npm cache clean --force`)
|
|
79
|
+
console.error(` npm uninstall -g @azure/mcp`)
|
|
80
|
+
console.error(` npm install -g @azure/mcp@latest`)
|
|
81
|
+
console.error(`\n2. If using npx, clear the cache:`)
|
|
82
|
+
console.error(` npx clear-npx-cache`)
|
|
83
|
+
console.error(` npx -y @azure/mcp@latest server start`)
|
|
84
|
+
console.error(`\n3. Manually install the platform package:`)
|
|
85
|
+
console.error(` npm install ${platformPackageName}@latest`)
|
|
86
|
+
console.error(`\n4. Check your internet connection and try again`)
|
|
87
|
+
console.error(`\n5. If the issue persists, please report it at:`)
|
|
88
|
+
console.error(` https://github.com/Azure/azure-mcp/issues`)
|
|
89
|
+
console.error(`\nOriginal error: ${err.message}`)
|
|
90
|
+
console.error(`Install error: ${installErr.message}`)
|
|
91
|
+
process.exit(1)
|
|
92
|
+
}
|
|
38
93
|
}
|
|
39
94
|
|
|
40
95
|
platformPackage.runExecutable(process.argv.slice(2))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Azure MCP Server - Model Context Protocol implementation for Azure",
|
|
5
5
|
"author": "Microsoft Corporation",
|
|
6
6
|
"homepage": "https://github.com/Azure/azure-mcp#readme",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"url": "git+https://github.com/Azure/azure-mcp.git"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
|
-
"node": ">=
|
|
21
|
+
"node": ">=22.0.0"
|
|
22
22
|
},
|
|
23
23
|
"bin": {
|
|
24
24
|
"azmcp": "./index.js"
|
|
@@ -33,11 +33,14 @@
|
|
|
33
33
|
"arm64"
|
|
34
34
|
],
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@azure/mcp-
|
|
37
|
-
"@azure/mcp-
|
|
38
|
-
"@azure/mcp-
|
|
39
|
-
"@azure/mcp-
|
|
40
|
-
"@azure/mcp-
|
|
41
|
-
"@azure/mcp-win32-arm64": "0.
|
|
36
|
+
"@azure/mcp-linux-x64": "0.4.0",
|
|
37
|
+
"@azure/mcp-darwin-x64": "0.4.0",
|
|
38
|
+
"@azure/mcp-linux-arm64": "0.4.0",
|
|
39
|
+
"@azure/mcp-darwin-arm64": "0.4.0",
|
|
40
|
+
"@azure/mcp-win32-x64": "0.4.0",
|
|
41
|
+
"@azure/mcp-win32-arm64": "0.4.0"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"postinstall": "node ./scripts/post-install-script.js"
|
|
42
45
|
}
|
|
43
46
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const os = require('os');
|
|
2
|
+
|
|
3
|
+
const platform = os.platform();
|
|
4
|
+
const arch = os.arch();
|
|
5
|
+
|
|
6
|
+
const requiredPackage = `@azure/mcp-${platform}-${arch}`;
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
require.resolve(requiredPackage);
|
|
10
|
+
} catch (err) {
|
|
11
|
+
console.error(`Missing required package: '${requiredPackage}'`);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|