@mcp-consultant-tools/azure-storage 26.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/README.md +201 -0
- package/build/AzureStorageService.d.ts +94 -0
- package/build/AzureStorageService.d.ts.map +1 -0
- package/build/AzureStorageService.js +331 -0
- package/build/AzureStorageService.js.map +1 -0
- package/build/index.d.ts +15 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +1193 -0
- package/build/index.js.map +1 -0
- package/build/services/BlobService.d.ts +70 -0
- package/build/services/BlobService.d.ts.map +1 -0
- package/build/services/BlobService.js +613 -0
- package/build/services/BlobService.js.map +1 -0
- package/build/services/FileService.d.ts +68 -0
- package/build/services/FileService.d.ts.map +1 -0
- package/build/services/FileService.js +600 -0
- package/build/services/FileService.js.map +1 -0
- package/build/services/QueueService.d.ts +57 -0
- package/build/services/QueueService.d.ts.map +1 -0
- package/build/services/QueueService.js +431 -0
- package/build/services/QueueService.js.map +1 -0
- package/build/services/TableService.d.ts +64 -0
- package/build/services/TableService.d.ts.map +1 -0
- package/build/services/TableService.js +499 -0
- package/build/services/TableService.js.map +1 -0
- package/build/types/storage-types.d.ts +239 -0
- package/build/types/storage-types.d.ts.map +1 -0
- package/build/types/storage-types.js +7 -0
- package/build/types/storage-types.js.map +1 -0
- package/build/utils/storage-formatters.d.ts +51 -0
- package/build/utils/storage-formatters.d.ts.map +1 -0
- package/build/utils/storage-formatters.js +339 -0
- package/build/utils/storage-formatters.js.map +1 -0
- package/build/utils/tool-examples.d.ts +94 -0
- package/build/utils/tool-examples.d.ts.map +1 -0
- package/build/utils/tool-examples.js +144 -0
- package/build/utils/tool-examples.js.map +1 -0
- package/package.json +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# @mcp-consultant-tools/azure-storage
|
|
2
|
+
|
|
3
|
+
MCP server for Azure Storage - comprehensive access to Blob, Files, Queues, and Tables.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **47 tools** for storage operations
|
|
8
|
+
- **8 prompts** for analysis and troubleshooting
|
|
9
|
+
- Multi-account support
|
|
10
|
+
- Entra ID and connection string authentication
|
|
11
|
+
- Blob index tag search
|
|
12
|
+
- Table OData queries
|
|
13
|
+
- Queue message management
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @mcp-consultant-tools/azure-storage
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or use directly with npx:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx @mcp-consultant-tools/azure-storage
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
### 1. Create Azure App Registration
|
|
30
|
+
|
|
31
|
+
1. Go to Azure Portal > Microsoft Entra ID > App registrations
|
|
32
|
+
2. Create a new registration
|
|
33
|
+
3. Note the Application (client) ID and Directory (tenant) ID
|
|
34
|
+
4. Create a client secret under Certificates & secrets
|
|
35
|
+
|
|
36
|
+
### 2. Assign Storage Roles
|
|
37
|
+
|
|
38
|
+
On your storage account, assign roles to the app:
|
|
39
|
+
|
|
40
|
+
| Service | Role |
|
|
41
|
+
|---------|------|
|
|
42
|
+
| Blob | Storage Blob Data Contributor |
|
|
43
|
+
| Queue | Storage Queue Data Contributor |
|
|
44
|
+
| Table | Storage Table Data Contributor |
|
|
45
|
+
| Files | Storage File Data SMB Share Contributor |
|
|
46
|
+
|
|
47
|
+
### 3. Configure MCP Client
|
|
48
|
+
|
|
49
|
+
Add to your Claude Desktop config (`claude_desktop_config.json`):
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"mcpServers": {
|
|
54
|
+
"azure-storage": {
|
|
55
|
+
"command": "npx",
|
|
56
|
+
"args": ["-y", "--package=@mcp-consultant-tools/azure-storage", "mcp-storage"],
|
|
57
|
+
"env": {
|
|
58
|
+
"AZURE_STORAGE_AUTH_METHOD": "entra-id",
|
|
59
|
+
"AZURE_STORAGE_TENANT_ID": "your-tenant-id",
|
|
60
|
+
"AZURE_STORAGE_CLIENT_ID": "your-client-id",
|
|
61
|
+
"AZURE_STORAGE_CLIENT_SECRET": "your-client-secret",
|
|
62
|
+
"AZURE_STORAGE_ACCOUNTS": "[{\"id\":\"prod\",\"name\":\"Production\",\"accountName\":\"mystorageaccount\",\"active\":true}]"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Environment Variables
|
|
70
|
+
|
|
71
|
+
### Authentication
|
|
72
|
+
|
|
73
|
+
| Variable | Description |
|
|
74
|
+
|----------|-------------|
|
|
75
|
+
| `AZURE_STORAGE_AUTH_METHOD` | `entra-id` (recommended) or `connection-string` |
|
|
76
|
+
| `AZURE_STORAGE_TENANT_ID` | Azure AD tenant ID |
|
|
77
|
+
| `AZURE_STORAGE_CLIENT_ID` | App registration client ID |
|
|
78
|
+
| `AZURE_STORAGE_CLIENT_SECRET` | App registration secret |
|
|
79
|
+
|
|
80
|
+
### Account Configuration
|
|
81
|
+
|
|
82
|
+
| Variable | Description |
|
|
83
|
+
|----------|-------------|
|
|
84
|
+
| `AZURE_STORAGE_ACCOUNTS` | JSON array of account configs |
|
|
85
|
+
| `AZURE_STORAGE_ACCOUNT_NAME` | Single account fallback |
|
|
86
|
+
| `AZURE_STORAGE_CONNECTION_STRING` | Connection string fallback |
|
|
87
|
+
|
|
88
|
+
### Limits
|
|
89
|
+
|
|
90
|
+
| Variable | Default | Description |
|
|
91
|
+
|----------|---------|-------------|
|
|
92
|
+
| `AZURE_STORAGE_MAX_BLOB_SIZE_MB` | 100 | Max blob upload size |
|
|
93
|
+
| `AZURE_STORAGE_MAX_LIST_RESULTS` | 1000 | Max items in list operations |
|
|
94
|
+
|
|
95
|
+
## Tools
|
|
96
|
+
|
|
97
|
+
### Blob Storage (15 tools)
|
|
98
|
+
|
|
99
|
+
| Tool | Description |
|
|
100
|
+
|------|-------------|
|
|
101
|
+
| `blob-list-accounts` | List configured storage accounts |
|
|
102
|
+
| `blob-test-connection` | Test connectivity and permissions |
|
|
103
|
+
| `blob-list-containers` | List containers with metadata |
|
|
104
|
+
| `blob-get-container` | Get container properties |
|
|
105
|
+
| `blob-create-container` | Create container |
|
|
106
|
+
| `blob-delete-container` | Delete container |
|
|
107
|
+
| `blob-list-blobs` | List blobs with prefix filter |
|
|
108
|
+
| `blob-get-blob` | Get blob properties/metadata/tags |
|
|
109
|
+
| `blob-download-blob` | Download blob content |
|
|
110
|
+
| `blob-upload-blob` | Upload content |
|
|
111
|
+
| `blob-delete-blob` | Delete blob |
|
|
112
|
+
| `blob-copy-blob` | Copy blob |
|
|
113
|
+
| `blob-set-metadata` | Set blob metadata |
|
|
114
|
+
| `blob-set-tags` | Set index tags |
|
|
115
|
+
| `blob-search-tags` | Search by tags |
|
|
116
|
+
|
|
117
|
+
### File Shares (12 tools)
|
|
118
|
+
|
|
119
|
+
| Tool | Description |
|
|
120
|
+
|------|-------------|
|
|
121
|
+
| `file-list-shares` | List file shares |
|
|
122
|
+
| `file-get-share` | Get share properties |
|
|
123
|
+
| `file-create-share` | Create share |
|
|
124
|
+
| `file-delete-share` | Delete share |
|
|
125
|
+
| `file-list-items` | List files/directories |
|
|
126
|
+
| `file-create-directory` | Create directory |
|
|
127
|
+
| `file-delete-directory` | Delete directory |
|
|
128
|
+
| `file-get-file` | Get file properties |
|
|
129
|
+
| `file-download-file` | Download content |
|
|
130
|
+
| `file-upload-file` | Upload content |
|
|
131
|
+
| `file-delete-file` | Delete file |
|
|
132
|
+
| `file-copy-file` | Copy file |
|
|
133
|
+
|
|
134
|
+
### Queue Storage (10 tools)
|
|
135
|
+
|
|
136
|
+
| Tool | Description |
|
|
137
|
+
|------|-------------|
|
|
138
|
+
| `queue-list-queues` | List queues |
|
|
139
|
+
| `queue-get-queue` | Get queue properties |
|
|
140
|
+
| `queue-create-queue` | Create queue |
|
|
141
|
+
| `queue-delete-queue` | Delete queue |
|
|
142
|
+
| `queue-send-message` | Send message |
|
|
143
|
+
| `queue-peek-messages` | Peek messages (read-only) |
|
|
144
|
+
| `queue-receive-messages` | Receive and hide messages |
|
|
145
|
+
| `queue-delete-message` | Delete message |
|
|
146
|
+
| `queue-update-message` | Update message |
|
|
147
|
+
| `queue-clear-messages` | Clear all messages |
|
|
148
|
+
|
|
149
|
+
### Table Storage (10 tools)
|
|
150
|
+
|
|
151
|
+
| Tool | Description |
|
|
152
|
+
|------|-------------|
|
|
153
|
+
| `table-list-tables` | List tables |
|
|
154
|
+
| `table-create-table` | Create table |
|
|
155
|
+
| `table-delete-table` | Delete table |
|
|
156
|
+
| `table-get-entity` | Get entity by keys |
|
|
157
|
+
| `table-query-entities` | Query with OData filter |
|
|
158
|
+
| `table-insert-entity` | Insert entity |
|
|
159
|
+
| `table-update-entity` | Update entity |
|
|
160
|
+
| `table-upsert-entity` | Upsert entity |
|
|
161
|
+
| `table-delete-entity` | Delete entity |
|
|
162
|
+
| `table-batch-operation` | Batch operations |
|
|
163
|
+
|
|
164
|
+
## Prompts
|
|
165
|
+
|
|
166
|
+
| Prompt | Description |
|
|
167
|
+
|--------|-------------|
|
|
168
|
+
| `storage-account-overview` | Complete account overview |
|
|
169
|
+
| `blob-container-analysis` | Container analysis |
|
|
170
|
+
| `blob-search-guide` | How to find blobs |
|
|
171
|
+
| `queue-health-check` | Queue health analysis |
|
|
172
|
+
| `table-schema-discovery` | Discover entity structure |
|
|
173
|
+
| `file-share-audit` | Audit share contents |
|
|
174
|
+
| `storage-migration-verification` | Verify migration |
|
|
175
|
+
| `storage-troubleshooting-guide` | Troubleshooting guide |
|
|
176
|
+
|
|
177
|
+
## Examples
|
|
178
|
+
|
|
179
|
+
### Search blobs by tags
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
Use blob-search-tags with accountId="prod" and tagFilter="\"Department\"='Finance' AND \"Year\"='2024'"
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Query table entities
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
Use table-query-entities with accountId="prod", tableName="Orders", filter="Status eq 'Pending' and Amount gt 1000"
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Process queue messages
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
1. Use queue-receive-messages to get messages
|
|
195
|
+
2. Process each message
|
|
196
|
+
3. Use queue-delete-message with messageId and popReceipt
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
MIT
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Azure Storage Service
|
|
3
|
+
*
|
|
4
|
+
* Main orchestrator service for Azure Storage operations.
|
|
5
|
+
* Handles multi-account configuration, authentication, and delegates to sub-services.
|
|
6
|
+
*
|
|
7
|
+
* Supports:
|
|
8
|
+
* - Entra ID authentication (recommended)
|
|
9
|
+
* - Connection string authentication (per-account)
|
|
10
|
+
* - Multiple storage accounts
|
|
11
|
+
*/
|
|
12
|
+
import { BlobServiceClient } from '@azure/storage-blob';
|
|
13
|
+
import { ShareServiceClient } from '@azure/storage-file-share';
|
|
14
|
+
import { QueueServiceClient } from '@azure/storage-queue';
|
|
15
|
+
import { TableServiceClient } from '@azure/data-tables';
|
|
16
|
+
import type { AzureStorageConfig, StorageAccountConfig, ConnectionTestResult } from './types/storage-types.js';
|
|
17
|
+
import { BlobService } from './services/BlobService.js';
|
|
18
|
+
import { QueueService } from './services/QueueService.js';
|
|
19
|
+
import { TableService } from './services/TableService.js';
|
|
20
|
+
import { FileService } from './services/FileService.js';
|
|
21
|
+
/**
|
|
22
|
+
* Main Azure Storage Service
|
|
23
|
+
*/
|
|
24
|
+
export declare class AzureStorageService {
|
|
25
|
+
private config;
|
|
26
|
+
private blobClients;
|
|
27
|
+
private queueClients;
|
|
28
|
+
private tableClients;
|
|
29
|
+
private fileClients;
|
|
30
|
+
private blobServices;
|
|
31
|
+
private queueServices;
|
|
32
|
+
private tableServices;
|
|
33
|
+
private fileServices;
|
|
34
|
+
private credential;
|
|
35
|
+
constructor(config: AzureStorageConfig);
|
|
36
|
+
/**
|
|
37
|
+
* Get BlobServiceClient for an account
|
|
38
|
+
*/
|
|
39
|
+
getBlobClient(accountId: string): BlobServiceClient;
|
|
40
|
+
/**
|
|
41
|
+
* Get QueueServiceClient for an account
|
|
42
|
+
*/
|
|
43
|
+
getQueueClient(accountId: string): QueueServiceClient;
|
|
44
|
+
/**
|
|
45
|
+
* Get TableServiceClient for an account
|
|
46
|
+
*/
|
|
47
|
+
getTableClient(accountId: string): TableServiceClient;
|
|
48
|
+
/**
|
|
49
|
+
* Get ShareServiceClient for an account
|
|
50
|
+
*/
|
|
51
|
+
getFileClient(accountId: string): ShareServiceClient;
|
|
52
|
+
/**
|
|
53
|
+
* Get BlobService for an account
|
|
54
|
+
*/
|
|
55
|
+
getBlobService(accountId: string): BlobService;
|
|
56
|
+
/**
|
|
57
|
+
* Get QueueService for an account
|
|
58
|
+
*/
|
|
59
|
+
getQueueService(accountId: string): QueueService;
|
|
60
|
+
/**
|
|
61
|
+
* Get TableService for an account
|
|
62
|
+
*/
|
|
63
|
+
getTableService(accountId: string): TableService;
|
|
64
|
+
/**
|
|
65
|
+
* Get FileService for an account
|
|
66
|
+
*/
|
|
67
|
+
getFileService(accountId: string): FileService;
|
|
68
|
+
/**
|
|
69
|
+
* Get all configured accounts
|
|
70
|
+
*/
|
|
71
|
+
getAllAccounts(): StorageAccountConfig[];
|
|
72
|
+
/**
|
|
73
|
+
* Get active accounts only
|
|
74
|
+
*/
|
|
75
|
+
getActiveAccounts(): StorageAccountConfig[];
|
|
76
|
+
/**
|
|
77
|
+
* Get account by ID (with validation)
|
|
78
|
+
*/
|
|
79
|
+
getAccountById(accountId: string): StorageAccountConfig;
|
|
80
|
+
/**
|
|
81
|
+
* Test connection to a storage account
|
|
82
|
+
*/
|
|
83
|
+
testConnection(accountId: string): Promise<ConnectionTestResult>;
|
|
84
|
+
/**
|
|
85
|
+
* Get maximum blob size in MB
|
|
86
|
+
*/
|
|
87
|
+
getMaxBlobSizeMB(): number;
|
|
88
|
+
/**
|
|
89
|
+
* Get maximum list results
|
|
90
|
+
*/
|
|
91
|
+
getMaxListResults(): number;
|
|
92
|
+
}
|
|
93
|
+
export type { AzureStorageConfig, StorageAccountConfig };
|
|
94
|
+
//# sourceMappingURL=AzureStorageService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AzureStorageService.d.ts","sourceRoot":"","sources":["../src/AzureStorageService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAIxD,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAA+B;IAG7C,OAAO,CAAC,WAAW,CAA6C;IAChE,OAAO,CAAC,YAAY,CAA8C;IAClE,OAAO,CAAC,YAAY,CAA8C;IAClE,OAAO,CAAC,WAAW,CAA8C;IAGjE,OAAO,CAAC,YAAY,CAAuC;IAC3D,OAAO,CAAC,aAAa,CAAwC;IAC7D,OAAO,CAAC,aAAa,CAAwC;IAC7D,OAAO,CAAC,YAAY,CAAuC;IAG3D,OAAO,CAAC,UAAU,CAAgE;gBAEtE,MAAM,EAAE,kBAAkB;IAgCtC;;OAEG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,iBAAiB;IAwBnD;;OAEG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB;IAwBrD;;OAEG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB;IAwBrD;;OAEG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB;IA4BpD;;OAEG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW;IAW9C;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY;IAQhD;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY;IAQhD;;OAEG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW;IAY9C;;OAEG;IACH,cAAc,IAAI,oBAAoB,EAAE;IAIxC;;OAEG;IACH,iBAAiB,IAAI,oBAAoB,EAAE;IAI3C;;OAEG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,oBAAoB;IAuBvD;;OAEG;IACG,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA6FtE;;OAEG;IACH,gBAAgB,IAAI,MAAM;IAI1B;;OAEG;IACH,iBAAiB,IAAI,MAAM;CAG5B;AAED,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Azure Storage Service
|
|
3
|
+
*
|
|
4
|
+
* Main orchestrator service for Azure Storage operations.
|
|
5
|
+
* Handles multi-account configuration, authentication, and delegates to sub-services.
|
|
6
|
+
*
|
|
7
|
+
* Supports:
|
|
8
|
+
* - Entra ID authentication (recommended)
|
|
9
|
+
* - Connection string authentication (per-account)
|
|
10
|
+
* - Multiple storage accounts
|
|
11
|
+
*/
|
|
12
|
+
import { BlobServiceClient } from '@azure/storage-blob';
|
|
13
|
+
import { ShareServiceClient } from '@azure/storage-file-share';
|
|
14
|
+
import { QueueServiceClient } from '@azure/storage-queue';
|
|
15
|
+
import { TableServiceClient } from '@azure/data-tables';
|
|
16
|
+
import { ClientSecretCredential, DefaultAzureCredential } from '@azure/identity';
|
|
17
|
+
import { auditLogger } from '@mcp-consultant-tools/core';
|
|
18
|
+
import { BlobService } from './services/BlobService.js';
|
|
19
|
+
import { QueueService } from './services/QueueService.js';
|
|
20
|
+
import { TableService } from './services/TableService.js';
|
|
21
|
+
import { FileService } from './services/FileService.js';
|
|
22
|
+
/**
|
|
23
|
+
* Main Azure Storage Service
|
|
24
|
+
*/
|
|
25
|
+
export class AzureStorageService {
|
|
26
|
+
config;
|
|
27
|
+
// Service clients (lazy-initialized)
|
|
28
|
+
blobClients = new Map();
|
|
29
|
+
queueClients = new Map();
|
|
30
|
+
tableClients = new Map();
|
|
31
|
+
fileClients = new Map();
|
|
32
|
+
// Sub-services
|
|
33
|
+
blobServices = new Map();
|
|
34
|
+
queueServices = new Map();
|
|
35
|
+
tableServices = new Map();
|
|
36
|
+
fileServices = new Map();
|
|
37
|
+
// Credential for Entra ID auth
|
|
38
|
+
credential = null;
|
|
39
|
+
constructor(config) {
|
|
40
|
+
// Apply defaults
|
|
41
|
+
this.config = {
|
|
42
|
+
accounts: config.accounts || [],
|
|
43
|
+
authMethod: config.authMethod || 'entra-id',
|
|
44
|
+
tenantId: config.tenantId || '',
|
|
45
|
+
clientId: config.clientId || '',
|
|
46
|
+
clientSecret: config.clientSecret || '',
|
|
47
|
+
maxBlobSizeMB: config.maxBlobSizeMB || 100,
|
|
48
|
+
maxListResults: config.maxListResults || 1000,
|
|
49
|
+
cacheTTL: config.cacheTTL || 300,
|
|
50
|
+
};
|
|
51
|
+
// Initialize credential for Entra ID auth
|
|
52
|
+
if (this.config.authMethod === 'entra-id') {
|
|
53
|
+
if (this.config.tenantId && this.config.clientId && this.config.clientSecret) {
|
|
54
|
+
this.credential = new ClientSecretCredential(this.config.tenantId, this.config.clientId, this.config.clientSecret);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// Fall back to DefaultAzureCredential (uses environment or managed identity)
|
|
58
|
+
this.credential = new DefaultAzureCredential();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// ==========================================================================
|
|
63
|
+
// Client Accessors
|
|
64
|
+
// ==========================================================================
|
|
65
|
+
/**
|
|
66
|
+
* Get BlobServiceClient for an account
|
|
67
|
+
*/
|
|
68
|
+
getBlobClient(accountId) {
|
|
69
|
+
const account = this.getAccountById(accountId);
|
|
70
|
+
if (!this.blobClients.has(accountId)) {
|
|
71
|
+
let client;
|
|
72
|
+
if (account.connectionString) {
|
|
73
|
+
client = BlobServiceClient.fromConnectionString(account.connectionString);
|
|
74
|
+
}
|
|
75
|
+
else if (this.credential) {
|
|
76
|
+
const url = `https://${account.accountName}.blob.core.windows.net`;
|
|
77
|
+
client = new BlobServiceClient(url, this.credential);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
throw new Error(`No authentication configured for account '${accountId}'. ` +
|
|
81
|
+
'Provide connection string or Entra ID credentials.');
|
|
82
|
+
}
|
|
83
|
+
this.blobClients.set(accountId, client);
|
|
84
|
+
}
|
|
85
|
+
return this.blobClients.get(accountId);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get QueueServiceClient for an account
|
|
89
|
+
*/
|
|
90
|
+
getQueueClient(accountId) {
|
|
91
|
+
const account = this.getAccountById(accountId);
|
|
92
|
+
if (!this.queueClients.has(accountId)) {
|
|
93
|
+
let client;
|
|
94
|
+
if (account.connectionString) {
|
|
95
|
+
client = QueueServiceClient.fromConnectionString(account.connectionString);
|
|
96
|
+
}
|
|
97
|
+
else if (this.credential) {
|
|
98
|
+
const url = `https://${account.accountName}.queue.core.windows.net`;
|
|
99
|
+
client = new QueueServiceClient(url, this.credential);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
throw new Error(`No authentication configured for account '${accountId}'. ` +
|
|
103
|
+
'Provide connection string or Entra ID credentials.');
|
|
104
|
+
}
|
|
105
|
+
this.queueClients.set(accountId, client);
|
|
106
|
+
}
|
|
107
|
+
return this.queueClients.get(accountId);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Get TableServiceClient for an account
|
|
111
|
+
*/
|
|
112
|
+
getTableClient(accountId) {
|
|
113
|
+
const account = this.getAccountById(accountId);
|
|
114
|
+
if (!this.tableClients.has(accountId)) {
|
|
115
|
+
let client;
|
|
116
|
+
if (account.connectionString) {
|
|
117
|
+
client = TableServiceClient.fromConnectionString(account.connectionString);
|
|
118
|
+
}
|
|
119
|
+
else if (this.credential) {
|
|
120
|
+
const url = `https://${account.accountName}.table.core.windows.net`;
|
|
121
|
+
client = new TableServiceClient(url, this.credential);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
throw new Error(`No authentication configured for account '${accountId}'. ` +
|
|
125
|
+
'Provide connection string or Entra ID credentials.');
|
|
126
|
+
}
|
|
127
|
+
this.tableClients.set(accountId, client);
|
|
128
|
+
}
|
|
129
|
+
return this.tableClients.get(accountId);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Get ShareServiceClient for an account
|
|
133
|
+
*/
|
|
134
|
+
getFileClient(accountId) {
|
|
135
|
+
const account = this.getAccountById(accountId);
|
|
136
|
+
if (!this.fileClients.has(accountId)) {
|
|
137
|
+
let client;
|
|
138
|
+
if (account.connectionString) {
|
|
139
|
+
client = ShareServiceClient.fromConnectionString(account.connectionString);
|
|
140
|
+
}
|
|
141
|
+
else if (this.credential) {
|
|
142
|
+
const url = `https://${account.accountName}.file.core.windows.net`;
|
|
143
|
+
client = new ShareServiceClient(url, this.credential);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
throw new Error(`No authentication configured for account '${accountId}'. ` +
|
|
147
|
+
'Provide connection string or Entra ID credentials.');
|
|
148
|
+
}
|
|
149
|
+
this.fileClients.set(accountId, client);
|
|
150
|
+
}
|
|
151
|
+
return this.fileClients.get(accountId);
|
|
152
|
+
}
|
|
153
|
+
// ==========================================================================
|
|
154
|
+
// Sub-Service Accessors
|
|
155
|
+
// ==========================================================================
|
|
156
|
+
/**
|
|
157
|
+
* Get BlobService for an account
|
|
158
|
+
*/
|
|
159
|
+
getBlobService(accountId) {
|
|
160
|
+
if (!this.blobServices.has(accountId)) {
|
|
161
|
+
const client = this.getBlobClient(accountId);
|
|
162
|
+
this.blobServices.set(accountId, new BlobService(client, accountId, this.config.maxBlobSizeMB, this.config.maxListResults));
|
|
163
|
+
}
|
|
164
|
+
return this.blobServices.get(accountId);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Get QueueService for an account
|
|
168
|
+
*/
|
|
169
|
+
getQueueService(accountId) {
|
|
170
|
+
if (!this.queueServices.has(accountId)) {
|
|
171
|
+
const client = this.getQueueClient(accountId);
|
|
172
|
+
this.queueServices.set(accountId, new QueueService(client, accountId, this.config.maxListResults));
|
|
173
|
+
}
|
|
174
|
+
return this.queueServices.get(accountId);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Get TableService for an account
|
|
178
|
+
*/
|
|
179
|
+
getTableService(accountId) {
|
|
180
|
+
if (!this.tableServices.has(accountId)) {
|
|
181
|
+
const client = this.getTableClient(accountId);
|
|
182
|
+
this.tableServices.set(accountId, new TableService(client, accountId, this.config.maxListResults));
|
|
183
|
+
}
|
|
184
|
+
return this.tableServices.get(accountId);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Get FileService for an account
|
|
188
|
+
*/
|
|
189
|
+
getFileService(accountId) {
|
|
190
|
+
if (!this.fileServices.has(accountId)) {
|
|
191
|
+
const client = this.getFileClient(accountId);
|
|
192
|
+
this.fileServices.set(accountId, new FileService(client, accountId, this.config.maxListResults));
|
|
193
|
+
}
|
|
194
|
+
return this.fileServices.get(accountId);
|
|
195
|
+
}
|
|
196
|
+
// ==========================================================================
|
|
197
|
+
// Account Management
|
|
198
|
+
// ==========================================================================
|
|
199
|
+
/**
|
|
200
|
+
* Get all configured accounts
|
|
201
|
+
*/
|
|
202
|
+
getAllAccounts() {
|
|
203
|
+
return this.config.accounts;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Get active accounts only
|
|
207
|
+
*/
|
|
208
|
+
getActiveAccounts() {
|
|
209
|
+
return this.config.accounts.filter((a) => a.active);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Get account by ID (with validation)
|
|
213
|
+
*/
|
|
214
|
+
getAccountById(accountId) {
|
|
215
|
+
const account = this.config.accounts.find((a) => a.id === accountId);
|
|
216
|
+
if (!account) {
|
|
217
|
+
const available = this.config.accounts.map((a) => a.id).join(', ');
|
|
218
|
+
throw new Error(`Storage account '${accountId}' not found. Available accounts: ${available || 'none'}`);
|
|
219
|
+
}
|
|
220
|
+
if (!account.active) {
|
|
221
|
+
throw new Error(`Storage account '${accountId}' is inactive. Set active: true in configuration.`);
|
|
222
|
+
}
|
|
223
|
+
return account;
|
|
224
|
+
}
|
|
225
|
+
// ==========================================================================
|
|
226
|
+
// Connection Testing
|
|
227
|
+
// ==========================================================================
|
|
228
|
+
/**
|
|
229
|
+
* Test connection to a storage account
|
|
230
|
+
*/
|
|
231
|
+
async testConnection(accountId) {
|
|
232
|
+
const timer = auditLogger.startTimer();
|
|
233
|
+
const account = this.getAccountById(accountId);
|
|
234
|
+
const result = {
|
|
235
|
+
connected: false,
|
|
236
|
+
accountName: account.accountName,
|
|
237
|
+
blobServiceAvailable: false,
|
|
238
|
+
queueServiceAvailable: false,
|
|
239
|
+
tableServiceAvailable: false,
|
|
240
|
+
fileServiceAvailable: false,
|
|
241
|
+
authMethod: account.connectionString ? 'connection-string' : this.config.authMethod,
|
|
242
|
+
};
|
|
243
|
+
try {
|
|
244
|
+
// Test Blob service
|
|
245
|
+
try {
|
|
246
|
+
const blobClient = this.getBlobClient(accountId);
|
|
247
|
+
const iter = blobClient.listContainers();
|
|
248
|
+
await iter.next();
|
|
249
|
+
result.blobServiceAvailable = true;
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
console.error(`Blob service test failed: ${error.message}`);
|
|
253
|
+
}
|
|
254
|
+
// Test Queue service
|
|
255
|
+
try {
|
|
256
|
+
const queueClient = this.getQueueClient(accountId);
|
|
257
|
+
const iter = queueClient.listQueues();
|
|
258
|
+
await iter.next();
|
|
259
|
+
result.queueServiceAvailable = true;
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
console.error(`Queue service test failed: ${error.message}`);
|
|
263
|
+
}
|
|
264
|
+
// Test Table service
|
|
265
|
+
try {
|
|
266
|
+
const tableClient = this.getTableClient(accountId);
|
|
267
|
+
const iter = tableClient.listTables();
|
|
268
|
+
await iter.next();
|
|
269
|
+
result.tableServiceAvailable = true;
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
console.error(`Table service test failed: ${error.message}`);
|
|
273
|
+
}
|
|
274
|
+
// Test File service
|
|
275
|
+
try {
|
|
276
|
+
const fileClient = this.getFileClient(accountId);
|
|
277
|
+
const iter = fileClient.listShares();
|
|
278
|
+
await iter.next();
|
|
279
|
+
result.fileServiceAvailable = true;
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
console.error(`File service test failed: ${error.message}`);
|
|
283
|
+
}
|
|
284
|
+
result.connected =
|
|
285
|
+
result.blobServiceAvailable ||
|
|
286
|
+
result.queueServiceAvailable ||
|
|
287
|
+
result.tableServiceAvailable ||
|
|
288
|
+
result.fileServiceAvailable;
|
|
289
|
+
auditLogger.log({
|
|
290
|
+
operation: 'test-connection',
|
|
291
|
+
operationType: 'READ',
|
|
292
|
+
componentType: 'StorageAccount',
|
|
293
|
+
componentName: account.accountName,
|
|
294
|
+
parameters: { accountId },
|
|
295
|
+
success: result.connected,
|
|
296
|
+
executionTimeMs: timer(),
|
|
297
|
+
});
|
|
298
|
+
return result;
|
|
299
|
+
}
|
|
300
|
+
catch (error) {
|
|
301
|
+
auditLogger.log({
|
|
302
|
+
operation: 'test-connection',
|
|
303
|
+
operationType: 'READ',
|
|
304
|
+
componentType: 'StorageAccount',
|
|
305
|
+
componentName: account.accountName,
|
|
306
|
+
parameters: { accountId },
|
|
307
|
+
success: false,
|
|
308
|
+
error: error.message,
|
|
309
|
+
executionTimeMs: timer(),
|
|
310
|
+
});
|
|
311
|
+
result.error = error.message;
|
|
312
|
+
return result;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
// ==========================================================================
|
|
316
|
+
// Configuration Accessors
|
|
317
|
+
// ==========================================================================
|
|
318
|
+
/**
|
|
319
|
+
* Get maximum blob size in MB
|
|
320
|
+
*/
|
|
321
|
+
getMaxBlobSizeMB() {
|
|
322
|
+
return this.config.maxBlobSizeMB;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Get maximum list results
|
|
326
|
+
*/
|
|
327
|
+
getMaxListResults() {
|
|
328
|
+
return this.config.maxListResults;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
//# sourceMappingURL=AzureStorageService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AzureStorageService.js","sourceRoot":"","sources":["../src/AzureStorageService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;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M,CAAC,qBAAqB;oBAC5B,MAAM,CAAC,oBAAoB,CAAC;YAE9B,WAAW,CAAC,GAAG,CAAC;gBACd,SAAS,EAAE,iBAAiB;gBAC5B,aAAa,EAAE,MAAM;gBACrB,aAAa,EAAE,gBAAgB;gBAC/B,aAAa,EAAE,OAAO,CAAC,WAAW;gBAClC,UAAU,EAAE,EAAE,SAAS,EAAE;gBACzB,OAAO,EAAE,MAAM,CAAC,SAAS;gBACzB,eAAe,EAAE,KAAK,EAAE;aACzB,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,WAAW,CAAC,GAAG,CAAC;gBACd,SAAS,EAAE,iBAAiB;gBAC5B,aAAa,EAAE,MAAM;gBACrB,aAAa,EAAE,gBAAgB;gBAC/B,aAAa,EAAE,OAAO,CAAC,WAAW;gBAClC,UAAU,EAAE,EAAE,SAAS,EAAE;gBACzB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,CAAC,OAAO;gBACpB,eAAe,EAAE,KAAK,EAAE;aACzB,CAAC,CAAC;YAEH,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC;YAC7B,OAAO,MAAM,CAAC;QAChB,CAAC;IACH,CAAC;IAED,6EAA6E;IAC7E,0BAA0B;IAC1B,6EAA6E;IAE7E;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;IACpC,CAAC;CACF"}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Azure Storage MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Provides comprehensive access to Azure Storage services:
|
|
6
|
+
* - Blob Storage (containers, blobs, tags)
|
|
7
|
+
* - File Shares (shares, directories, files)
|
|
8
|
+
* - Queue Storage (queues, messages)
|
|
9
|
+
* - Table Storage (tables, entities)
|
|
10
|
+
*
|
|
11
|
+
* 47 tools + 8 prompts
|
|
12
|
+
*/
|
|
13
|
+
import { AzureStorageService } from "./AzureStorageService.js";
|
|
14
|
+
export declare function registerAzureStorageTools(server: any, storageService?: AzureStorageService): void;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AAMH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AA4B/D,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,GAAG,EAAE,cAAc,CAAC,EAAE,mBAAmB,QA6+C1F"}
|