@mcp-consultant-tools/service-bus 1.0.0 → 1.0.2
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/build/index.d.ts +1 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +471 -6
- package/build/index.js.map +1 -1
- package/package.json +39 -9
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { ServiceBusService } from "./ServiceBusService.js";
|
|
3
|
-
export declare function registerServiceBusTools(server: any,
|
|
4
|
-
export { ServiceBusService } from "./ServiceBusService.js";
|
|
3
|
+
export declare function registerServiceBusTools(server: any, servicebusService?: ServiceBusService): void;
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAK3D,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,GAAG,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,QA6jBzF"}
|
package/build/index.js
CHANGED
|
@@ -1,17 +1,482 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
3
|
import { createMcpServer, createEnvLoader } from "@mcp-consultant-tools/core";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { ServiceBusService } from "./ServiceBusService.js";
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { formatMessagesAsMarkdown, formatDeadLetterAnalysisAsMarkdown, formatNamespaceOverviewAsMarkdown, formatMessageInspectionAsMarkdown, getQueueHealthStatus } from './utils/servicebus-formatters.js';
|
|
7
|
+
export function registerServiceBusTools(server, servicebusService) {
|
|
8
|
+
let service = servicebusService || null;
|
|
9
|
+
function getServiceBusService() {
|
|
10
|
+
if (!service) {
|
|
11
|
+
const missingConfig = [];
|
|
12
|
+
let resources = [];
|
|
13
|
+
if (process.env.SERVICEBUS_RESOURCES) {
|
|
14
|
+
try {
|
|
15
|
+
resources = JSON.parse(process.env.SERVICEBUS_RESOURCES);
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
throw new Error("Failed to parse SERVICEBUS_RESOURCES JSON");
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
else if (process.env.SERVICEBUS_NAMESPACE) {
|
|
22
|
+
resources = [{
|
|
23
|
+
id: 'default',
|
|
24
|
+
name: 'Default Service Bus',
|
|
25
|
+
namespace: process.env.SERVICEBUS_NAMESPACE,
|
|
26
|
+
active: true,
|
|
27
|
+
connectionString: process.env.SERVICEBUS_CONNECTION_STRING || '',
|
|
28
|
+
}];
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
missingConfig.push("SERVICEBUS_RESOURCES or SERVICEBUS_NAMESPACE");
|
|
32
|
+
}
|
|
33
|
+
if (missingConfig.length > 0) {
|
|
34
|
+
throw new Error(`Missing Service Bus configuration: ${missingConfig.join(", ")}`);
|
|
35
|
+
}
|
|
36
|
+
const config = {
|
|
37
|
+
resources,
|
|
38
|
+
authMethod: (process.env.SERVICEBUS_AUTH_METHOD || 'entra-id'),
|
|
39
|
+
tenantId: process.env.SERVICEBUS_TENANT_ID || '',
|
|
40
|
+
clientId: process.env.SERVICEBUS_CLIENT_ID || '',
|
|
41
|
+
clientSecret: process.env.SERVICEBUS_CLIENT_SECRET || '',
|
|
42
|
+
};
|
|
43
|
+
service = new ServiceBusService(config);
|
|
44
|
+
console.error("Service Bus service initialized");
|
|
45
|
+
}
|
|
46
|
+
return service;
|
|
47
|
+
}
|
|
48
|
+
// ========================================
|
|
49
|
+
// PROMPTS
|
|
50
|
+
// ========================================
|
|
51
|
+
server.prompt("servicebus-namespace-overview", "Generate comprehensive overview of Service Bus namespace with all queues and health metrics", {
|
|
52
|
+
resourceId: z.string().describe("Service Bus resource ID"),
|
|
53
|
+
}, async ({ resourceId }) => {
|
|
54
|
+
const service = getServiceBusService();
|
|
55
|
+
const resource = service.getResourceById(resourceId);
|
|
56
|
+
// Get namespace properties
|
|
57
|
+
const namespaceProps = await service.getNamespaceProperties(resourceId);
|
|
58
|
+
// Get all queues
|
|
59
|
+
const queues = await service.listQueues(resourceId);
|
|
60
|
+
// Format as markdown
|
|
61
|
+
const output = formatNamespaceOverviewAsMarkdown({
|
|
62
|
+
namespace: resource.namespace,
|
|
63
|
+
tier: namespaceProps.tier,
|
|
64
|
+
queues,
|
|
65
|
+
});
|
|
66
|
+
return {
|
|
67
|
+
messages: [
|
|
68
|
+
{
|
|
69
|
+
role: "user",
|
|
70
|
+
content: {
|
|
71
|
+
type: "text",
|
|
72
|
+
text: output,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
server.prompt("servicebus-queue-health", "Generate detailed health report for a specific queue with recommendations", {
|
|
79
|
+
resourceId: z.string().describe("Service Bus resource ID"),
|
|
80
|
+
queueName: z.string().describe("Queue name"),
|
|
81
|
+
}, async ({ resourceId, queueName }) => {
|
|
82
|
+
const service = getServiceBusService();
|
|
83
|
+
const resource = service.getResourceById(resourceId);
|
|
84
|
+
// Get queue info (runtime metrics)
|
|
85
|
+
const queueInfo = await service.getQueueProperties(resourceId, queueName);
|
|
86
|
+
// Get queue config (configuration properties)
|
|
87
|
+
const queueConfig = await service.getQueueConfigProperties(resourceId, queueName);
|
|
88
|
+
// Get health status
|
|
89
|
+
const health = getQueueHealthStatus(queueInfo);
|
|
90
|
+
// Peek recent messages
|
|
91
|
+
const messages = await service.peekMessages(resourceId, queueName, 10);
|
|
92
|
+
// Peek dead letter messages
|
|
93
|
+
const deadLetterMessages = await service.peekDeadLetterMessages(resourceId, queueName, 10);
|
|
94
|
+
let output = `# Queue Health Report: ${queueName}\n\n`;
|
|
95
|
+
output += `**Namespace:** ${resource.namespace}\n`;
|
|
96
|
+
output += `**Date:** ${new Date().toISOString()}\n\n`;
|
|
97
|
+
output += `## Health Status\n\n`;
|
|
98
|
+
output += `${health.icon} **${health.status.toUpperCase()}**\n\n`;
|
|
99
|
+
output += `**Reason:** ${health.reason}\n\n`;
|
|
100
|
+
output += `## Queue Metrics\n\n`;
|
|
101
|
+
output += `| Metric | Value |\n`;
|
|
102
|
+
output += `|--------|-------|\n`;
|
|
103
|
+
output += `| Active Messages | ${queueInfo.activeMessageCount || 0} |\n`;
|
|
104
|
+
output += `| Dead Letter Messages | ${queueInfo.deadLetterMessageCount || 0} |\n`;
|
|
105
|
+
output += `| Scheduled Messages | ${queueInfo.scheduledMessageCount || 0} |\n`;
|
|
106
|
+
output += `| Size (bytes) | ${queueInfo.sizeInBytes?.toLocaleString() || 0} |\n`;
|
|
107
|
+
output += `| Max Size (MB) | ${queueConfig.maxSizeInMegabytes || 0} |\n\n`;
|
|
108
|
+
output += `## Configuration\n\n`;
|
|
109
|
+
output += `| Setting | Value |\n`;
|
|
110
|
+
output += `|---------|-------|\n`;
|
|
111
|
+
output += `| Lock Duration | ${queueConfig.lockDuration || 'N/A'} |\n`;
|
|
112
|
+
output += `| Max Delivery Count | ${queueConfig.maxDeliveryCount || 0} |\n`;
|
|
113
|
+
output += `| Duplicate Detection | ${queueConfig.requiresDuplicateDetection ? 'Yes' : 'No'} |\n`;
|
|
114
|
+
output += `| Sessions Enabled | ${queueInfo.requiresSession ? 'Yes' : 'No'} |\n`;
|
|
115
|
+
output += `| Partitioning Enabled | ${queueConfig.enablePartitioning ? 'Yes' : 'No'} |\n\n`;
|
|
116
|
+
output += `## Recommendations\n\n`;
|
|
117
|
+
if (health.status === 'critical') {
|
|
118
|
+
output += `⚠️ **CRITICAL**: Immediate action required\n`;
|
|
119
|
+
output += `- Investigate dead letter messages immediately\n`;
|
|
120
|
+
output += `- Check consumer health and processing capacity\n`;
|
|
121
|
+
output += `- Consider scaling out consumers\n\n`;
|
|
122
|
+
}
|
|
123
|
+
else if (health.status === 'warning') {
|
|
124
|
+
output += `⚠️ **WARNING**: Monitor closely\n`;
|
|
125
|
+
output += `- Review message processing times\n`;
|
|
126
|
+
output += `- Check for processing bottlenecks\n`;
|
|
127
|
+
output += `- Monitor dead letter queue growth\n\n`;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
output += `✅ Queue is healthy\n`;
|
|
131
|
+
output += `- Continue regular monitoring\n`;
|
|
132
|
+
output += `- Maintain current processing capacity\n\n`;
|
|
133
|
+
}
|
|
134
|
+
if (messages.length > 0) {
|
|
135
|
+
output += `## Recent Messages (${messages.length})\n\n`;
|
|
136
|
+
output += formatMessagesAsMarkdown(messages, false);
|
|
137
|
+
}
|
|
138
|
+
if (deadLetterMessages.length > 0) {
|
|
139
|
+
output += `\n## Dead Letter Messages (${deadLetterMessages.length})\n\n`;
|
|
140
|
+
output += formatMessagesAsMarkdown(deadLetterMessages, false);
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
messages: [
|
|
144
|
+
{
|
|
145
|
+
role: "user",
|
|
146
|
+
content: {
|
|
147
|
+
type: "text",
|
|
148
|
+
text: output,
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
};
|
|
153
|
+
});
|
|
154
|
+
server.prompt("servicebus-deadletter-analysis", "Analyze dead letter queue with pattern detection and actionable recommendations", {
|
|
155
|
+
resourceId: z.string().describe("Service Bus resource ID"),
|
|
156
|
+
queueName: z.string().describe("Queue name"),
|
|
157
|
+
maxMessages: z.string().optional().describe("Maximum messages to analyze (default: 50)"),
|
|
158
|
+
}, async ({ resourceId, queueName, maxMessages }) => {
|
|
159
|
+
const service = getServiceBusService();
|
|
160
|
+
const resource = service.getResourceById(resourceId);
|
|
161
|
+
// Parse maxMessages to number
|
|
162
|
+
const maxMsgs = maxMessages ? parseInt(maxMessages, 10) : 50;
|
|
163
|
+
// Peek dead letter messages
|
|
164
|
+
const deadLetterMessages = await service.peekDeadLetterMessages(resourceId, queueName, maxMsgs);
|
|
165
|
+
if (deadLetterMessages.length === 0) {
|
|
166
|
+
return {
|
|
167
|
+
messages: [
|
|
168
|
+
{
|
|
169
|
+
role: "user",
|
|
170
|
+
content: {
|
|
171
|
+
type: "text",
|
|
172
|
+
text: `# Dead Letter Queue Analysis: ${queueName}\n\n✅ **No dead letter messages found**\n\nThe dead letter queue is empty. This indicates healthy message processing.`,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
// Analyze dead letter messages
|
|
179
|
+
const { markdown } = formatDeadLetterAnalysisAsMarkdown(deadLetterMessages);
|
|
180
|
+
let output = `# Dead Letter Queue Analysis: ${queueName}\n\n`;
|
|
181
|
+
output += `**Namespace:** ${resource.namespace}\n`;
|
|
182
|
+
output += `**Date:** ${new Date().toISOString()}\n`;
|
|
183
|
+
output += `**Messages Analyzed:** ${deadLetterMessages.length}\n\n`;
|
|
184
|
+
output += markdown;
|
|
185
|
+
return {
|
|
186
|
+
messages: [
|
|
187
|
+
{
|
|
188
|
+
role: "user",
|
|
189
|
+
content: {
|
|
190
|
+
type: "text",
|
|
191
|
+
text: output,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
};
|
|
196
|
+
});
|
|
197
|
+
server.prompt("servicebus-message-inspection", "Inspect a single message in detail with cross-service troubleshooting recommendations", {
|
|
198
|
+
resourceId: z.string().describe("Service Bus resource ID"),
|
|
199
|
+
queueName: z.string().describe("Queue name"),
|
|
200
|
+
messageId: z.string().optional().describe("Message ID to inspect (if not provided, inspects first message)"),
|
|
201
|
+
isDeadLetter: z.string().optional().describe("Inspect dead letter queue (default: false)"),
|
|
202
|
+
}, async ({ resourceId, queueName, messageId, isDeadLetter }) => {
|
|
203
|
+
const service = getServiceBusService();
|
|
204
|
+
const resource = service.getResourceById(resourceId);
|
|
205
|
+
// Parse isDeadLetter to boolean
|
|
206
|
+
const isDLQ = isDeadLetter === 'true';
|
|
207
|
+
// Peek messages
|
|
208
|
+
const messages = isDLQ
|
|
209
|
+
? await service.peekDeadLetterMessages(resourceId, queueName, 100)
|
|
210
|
+
: await service.peekMessages(resourceId, queueName, 100);
|
|
211
|
+
if (messages.length === 0) {
|
|
212
|
+
return {
|
|
213
|
+
messages: [
|
|
214
|
+
{
|
|
215
|
+
role: "user",
|
|
216
|
+
content: {
|
|
217
|
+
type: "text",
|
|
218
|
+
text: `# Message Inspection: ${queueName}\n\n**No messages found** in ${isDLQ ? 'dead letter queue' : 'queue'}.`,
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
// Find specific message or use first
|
|
225
|
+
const message = messageId
|
|
226
|
+
? messages.find((m) => m.messageId === messageId)
|
|
227
|
+
: messages[0];
|
|
228
|
+
if (!message) {
|
|
229
|
+
return {
|
|
230
|
+
messages: [
|
|
231
|
+
{
|
|
232
|
+
role: "user",
|
|
233
|
+
content: {
|
|
234
|
+
type: "text",
|
|
235
|
+
text: `# Message Inspection: ${queueName}\n\n**Message not found** with ID: ${messageId}\n\nAvailable message IDs:\n${messages.slice(0, 10).map((m) => `- ${m.messageId}`).join('\n')}`,
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
// Format message inspection
|
|
242
|
+
const output = formatMessageInspectionAsMarkdown(message, isDLQ);
|
|
243
|
+
return {
|
|
244
|
+
messages: [
|
|
245
|
+
{
|
|
246
|
+
role: "user",
|
|
247
|
+
content: {
|
|
248
|
+
type: "text",
|
|
249
|
+
text: `# Message Inspection: ${queueName}\n\n**Namespace:** ${resource.namespace}\n**Queue:** ${queueName}\n**Date:** ${new Date().toISOString()}\n\n${output}`,
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
};
|
|
254
|
+
});
|
|
255
|
+
// ========================================
|
|
256
|
+
// TOOLS
|
|
257
|
+
// ========================================
|
|
258
|
+
server.tool("servicebus-list-namespaces", "List all configured Service Bus namespaces (active and inactive)", {}, async () => {
|
|
259
|
+
try {
|
|
260
|
+
const service = getServiceBusService();
|
|
261
|
+
const resources = service.getAllResources();
|
|
262
|
+
return {
|
|
263
|
+
content: [{
|
|
264
|
+
type: "text",
|
|
265
|
+
text: JSON.stringify(resources, null, 2),
|
|
266
|
+
}],
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
console.error("Error listing Service Bus namespaces:", error);
|
|
271
|
+
return {
|
|
272
|
+
content: [{
|
|
273
|
+
type: "text",
|
|
274
|
+
text: `Failed to list namespaces: ${error.message}`,
|
|
275
|
+
}],
|
|
276
|
+
isError: true,
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
server.tool("servicebus-test-connection", "Test connectivity to a Service Bus namespace and verify permissions (Data Receiver + Reader roles)", {
|
|
281
|
+
resourceId: z.string().describe("Service Bus resource ID (use servicebus-list-namespaces to find IDs)"),
|
|
282
|
+
}, async ({ resourceId }) => {
|
|
283
|
+
try {
|
|
284
|
+
const service = getServiceBusService();
|
|
285
|
+
const result = await service.testConnection(resourceId);
|
|
286
|
+
return {
|
|
287
|
+
content: [{
|
|
288
|
+
type: "text",
|
|
289
|
+
text: JSON.stringify(result, null, 2),
|
|
290
|
+
}],
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
console.error("Error testing Service Bus connection:", error);
|
|
295
|
+
return {
|
|
296
|
+
content: [{
|
|
297
|
+
type: "text",
|
|
298
|
+
text: `Failed to test connection: ${error.message}`,
|
|
299
|
+
}],
|
|
300
|
+
isError: true,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
server.tool("servicebus-list-queues", "List all queues in a Service Bus namespace with message counts and session info (cached for 5 minutes)", {
|
|
305
|
+
resourceId: z.string().describe("Service Bus resource ID"),
|
|
306
|
+
}, async ({ resourceId }) => {
|
|
307
|
+
try {
|
|
308
|
+
const service = getServiceBusService();
|
|
309
|
+
const queues = await service.listQueues(resourceId);
|
|
310
|
+
return {
|
|
311
|
+
content: [{
|
|
312
|
+
type: "text",
|
|
313
|
+
text: JSON.stringify(queues, null, 2),
|
|
314
|
+
}],
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
catch (error) {
|
|
318
|
+
console.error("Error listing Service Bus queues:", error);
|
|
319
|
+
return {
|
|
320
|
+
content: [{
|
|
321
|
+
type: "text",
|
|
322
|
+
text: `Failed to list queues: ${error.message}`,
|
|
323
|
+
}],
|
|
324
|
+
isError: true,
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
server.tool("servicebus-peek-messages", "Peek messages in a queue without removing them (read-only, max 100 messages)", {
|
|
329
|
+
resourceId: z.string().describe("Service Bus resource ID"),
|
|
330
|
+
queueName: z.string().describe("Queue name"),
|
|
331
|
+
maxMessages: z.number().optional().describe("Maximum messages to peek (default: 10, max: 100)"),
|
|
332
|
+
sessionId: z.string().optional().describe("Session ID for session-enabled queues"),
|
|
333
|
+
}, async ({ resourceId, queueName, maxMessages, sessionId }) => {
|
|
334
|
+
try {
|
|
335
|
+
const service = getServiceBusService();
|
|
336
|
+
const messages = await service.peekMessages(resourceId, queueName, maxMessages || 10, sessionId);
|
|
337
|
+
return {
|
|
338
|
+
content: [{
|
|
339
|
+
type: "text",
|
|
340
|
+
text: JSON.stringify(messages, null, 2),
|
|
341
|
+
}],
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
catch (error) {
|
|
345
|
+
console.error("Error peeking messages:", error);
|
|
346
|
+
return {
|
|
347
|
+
content: [{
|
|
348
|
+
type: "text",
|
|
349
|
+
text: `Failed to peek messages: ${error.message}`,
|
|
350
|
+
}],
|
|
351
|
+
isError: true,
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
server.tool("servicebus-peek-deadletter", "Peek dead letter queue messages with failure reasons (read-only, max 100 messages)", {
|
|
356
|
+
resourceId: z.string().describe("Service Bus resource ID"),
|
|
357
|
+
queueName: z.string().describe("Queue name"),
|
|
358
|
+
maxMessages: z.number().optional().describe("Maximum messages to peek (default: 10, max: 100)"),
|
|
359
|
+
sessionId: z.string().optional().describe("Session ID for session-enabled queues"),
|
|
360
|
+
}, async ({ resourceId, queueName, maxMessages, sessionId }) => {
|
|
361
|
+
try {
|
|
362
|
+
const service = getServiceBusService();
|
|
363
|
+
const messages = await service.peekDeadLetterMessages(resourceId, queueName, maxMessages || 10, sessionId);
|
|
364
|
+
return {
|
|
365
|
+
content: [{
|
|
366
|
+
type: "text",
|
|
367
|
+
text: JSON.stringify(messages, null, 2),
|
|
368
|
+
}],
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
catch (error) {
|
|
372
|
+
console.error("Error peeking dead letter messages:", error);
|
|
373
|
+
return {
|
|
374
|
+
content: [{
|
|
375
|
+
type: "text",
|
|
376
|
+
text: `Failed to peek dead letter messages: ${error.message}`,
|
|
377
|
+
}],
|
|
378
|
+
isError: true,
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
server.tool("servicebus-get-queue-properties", "Get detailed queue properties, metrics, and configuration including session info", {
|
|
383
|
+
resourceId: z.string().describe("Service Bus resource ID"),
|
|
384
|
+
queueName: z.string().describe("Queue name"),
|
|
385
|
+
}, async ({ resourceId, queueName }) => {
|
|
386
|
+
try {
|
|
387
|
+
const service = getServiceBusService();
|
|
388
|
+
const properties = await service.getQueueProperties(resourceId, queueName);
|
|
389
|
+
return {
|
|
390
|
+
content: [{
|
|
391
|
+
type: "text",
|
|
392
|
+
text: JSON.stringify(properties, null, 2),
|
|
393
|
+
}],
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
catch (error) {
|
|
397
|
+
console.error("Error getting queue properties:", error);
|
|
398
|
+
return {
|
|
399
|
+
content: [{
|
|
400
|
+
type: "text",
|
|
401
|
+
text: `Failed to get queue properties: ${error.message}`,
|
|
402
|
+
}],
|
|
403
|
+
isError: true,
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
server.tool("servicebus-search-messages", "Search messages by content or properties (loads into memory, max 500 messages)", {
|
|
408
|
+
resourceId: z.string().describe("Service Bus resource ID"),
|
|
409
|
+
queueName: z.string().describe("Queue name"),
|
|
410
|
+
bodyContains: z.string().optional().describe("Search for text in message body (case-insensitive)"),
|
|
411
|
+
correlationId: z.string().optional().describe("Filter by correlation ID"),
|
|
412
|
+
messageId: z.string().optional().describe("Filter by message ID"),
|
|
413
|
+
propertyKey: z.string().optional().describe("Application property key to filter by"),
|
|
414
|
+
propertyValue: z.any().optional().describe("Application property value to match"),
|
|
415
|
+
sessionId: z.string().optional().describe("Session ID for session-enabled queues"),
|
|
416
|
+
maxMessages: z.number().optional().describe("Maximum messages to search (default: 50, max: 500)"),
|
|
417
|
+
}, async ({ resourceId, queueName, bodyContains, correlationId, messageId, propertyKey, propertyValue, sessionId, maxMessages }) => {
|
|
418
|
+
try {
|
|
419
|
+
const service = getServiceBusService();
|
|
420
|
+
const result = await service.searchMessages(resourceId, queueName, { bodyContains, correlationId, messageId, propertyKey, propertyValue, sessionId }, maxMessages || 50);
|
|
421
|
+
return {
|
|
422
|
+
content: [{
|
|
423
|
+
type: "text",
|
|
424
|
+
text: JSON.stringify(result, null, 2),
|
|
425
|
+
}],
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
catch (error) {
|
|
429
|
+
console.error("Error searching messages:", error);
|
|
430
|
+
return {
|
|
431
|
+
content: [{
|
|
432
|
+
type: "text",
|
|
433
|
+
text: `Failed to search messages: ${error.message}`,
|
|
434
|
+
}],
|
|
435
|
+
isError: true,
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
server.tool("servicebus-get-namespace-properties", "Get namespace-level properties and quotas (tier, max message size)", {
|
|
440
|
+
resourceId: z.string().describe("Service Bus resource ID"),
|
|
441
|
+
}, async ({ resourceId }) => {
|
|
442
|
+
try {
|
|
443
|
+
const service = getServiceBusService();
|
|
444
|
+
const properties = await service.getNamespaceProperties(resourceId);
|
|
445
|
+
return {
|
|
446
|
+
content: [{
|
|
447
|
+
type: "text",
|
|
448
|
+
text: JSON.stringify(properties, null, 2),
|
|
449
|
+
}],
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
catch (error) {
|
|
453
|
+
console.error("Error getting namespace properties:", error);
|
|
454
|
+
return {
|
|
455
|
+
content: [{
|
|
456
|
+
type: "text",
|
|
457
|
+
text: `Failed to get namespace properties: ${error.message}`,
|
|
458
|
+
}],
|
|
459
|
+
isError: true,
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
console.error("service-bus tools registered: 8 tools, 4 prompts");
|
|
464
|
+
console.error("Service Bus tools registered: 8 tools, 4 prompts");
|
|
6
465
|
}
|
|
7
|
-
export { ServiceBusService } from "./ServiceBusService.js";
|
|
8
466
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
9
467
|
const loadEnv = createEnvLoader();
|
|
10
468
|
loadEnv();
|
|
11
|
-
const server = createMcpServer({
|
|
469
|
+
const server = createMcpServer({
|
|
470
|
+
name: "mcp-service-bus",
|
|
471
|
+
version: "1.0.0",
|
|
472
|
+
capabilities: { tools: {}, prompts: {} }
|
|
473
|
+
});
|
|
12
474
|
registerServiceBusTools(server);
|
|
13
475
|
const transport = new StdioServerTransport();
|
|
14
|
-
server.connect(transport).catch((error) => {
|
|
15
|
-
|
|
476
|
+
server.connect(transport).catch((error) => {
|
|
477
|
+
console.error("Failed to start Service Bus MCP server:", error);
|
|
478
|
+
process.exit(1);
|
|
479
|
+
});
|
|
480
|
+
console.error("Service Bus MCP server running");
|
|
16
481
|
}
|
|
17
482
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG9E,MAAM,UAAU,uBAAuB,CAAC,MAAW,EAAE,OAA2B;IAC9E,OAAO,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;AAC1E,CAAC;AAED,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACpD,MAAM,OAAO,GAAG,eAAe,EAAE,CAAC;IAClC,OAAO,EAAE,CAAC;IACV,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,IAAI,EAAE,mCAAmC,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7H,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAChC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,KAAY,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrI,OAAO,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACpE,CAAC"}
|
|
1
|
+
{"version":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AAC,KAAY,EAAE,EAAE;QAC/C,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;AAClD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-consultant-tools/service-bus",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "MCP server for Azure Service Bus - read-only message inspection and queue monitoring",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/index.js",
|
|
7
7
|
"types": "./build/index.d.ts",
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./build/index.js",
|
|
11
|
+
"types": "./build/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"build",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc",
|
|
20
|
+
"clean": "rm -rf build *.tsbuildinfo",
|
|
21
|
+
"prepublishOnly": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"mcp",
|
|
25
|
+
"model-context-protocol",
|
|
26
|
+
"azure",
|
|
27
|
+
"service-bus",
|
|
28
|
+
"messaging",
|
|
29
|
+
"queues"
|
|
30
|
+
],
|
|
13
31
|
"author": "Michal Sobieraj",
|
|
14
32
|
"license": "MIT",
|
|
15
|
-
"repository": {
|
|
16
|
-
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/klemensms/mcp-consultant-tools.git",
|
|
36
|
+
"directory": "packages/service-bus"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=16.0.0"
|
|
40
|
+
},
|
|
17
41
|
"dependencies": {
|
|
18
42
|
"@azure/identity": "^4.0.0",
|
|
19
43
|
"@azure/msal-node": "^3.3.0",
|
|
@@ -22,5 +46,11 @@
|
|
|
22
46
|
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
23
47
|
"zod": "^3.24.1"
|
|
24
48
|
},
|
|
25
|
-
"devDependencies": {
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/node": "^22.10.5",
|
|
51
|
+
"typescript": "^5.8.2"
|
|
52
|
+
},
|
|
53
|
+
"bin": {
|
|
54
|
+
"mcp-sb": "./build/index.js"
|
|
55
|
+
}
|
|
26
56
|
}
|