bitbucket-mcp-server 1.0.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.
@@ -0,0 +1,305 @@
1
+ /**
2
+ * Webhook management for the Bitbucket MCP server
3
+ */
4
+ /**
5
+ * Available webhook events for Bitbucket repositories
6
+ */
7
+ export const WEBHOOK_EVENTS = {
8
+ // Repository events
9
+ 'repo:push': 'Repository push',
10
+ 'repo:fork': 'Repository fork',
11
+ 'repo:updated': 'Repository updated',
12
+ 'repo:commit_comment_created': 'Commit comment created',
13
+ 'repo:commit_status_created': 'Commit status created',
14
+ 'repo:commit_status_updated': 'Commit status updated',
15
+ // Pull request events
16
+ 'pullrequest:created': 'Pull request created',
17
+ 'pullrequest:updated': 'Pull request updated',
18
+ 'pullrequest:approved': 'Pull request approved',
19
+ 'pullrequest:unapproved': 'Pull request unapproved',
20
+ 'pullrequest:fulfilled': 'Pull request merged',
21
+ 'pullrequest:rejected': 'Pull request declined',
22
+ 'pullrequest:comment_created': 'Pull request comment created',
23
+ 'pullrequest:comment_updated': 'Pull request comment updated',
24
+ 'pullrequest:comment_deleted': 'Pull request comment deleted',
25
+ // Issue events
26
+ 'issue:created': 'Issue created',
27
+ 'issue:updated': 'Issue updated',
28
+ 'issue:comment_created': 'Issue comment created',
29
+ // Wiki events
30
+ 'wiki:created': 'Wiki page created',
31
+ 'wiki:updated': 'Wiki page updated',
32
+ };
33
+ /**
34
+ * Webhook validation utilities
35
+ */
36
+ export class WebhookValidator {
37
+ /**
38
+ * Validate webhook URL
39
+ */
40
+ static isValidUrl(url) {
41
+ try {
42
+ const parsed = new URL(url);
43
+ return ['http:', 'https:'].includes(parsed.protocol);
44
+ }
45
+ catch {
46
+ return false;
47
+ }
48
+ }
49
+ /**
50
+ * Validate webhook events
51
+ */
52
+ static validateEvents(events) {
53
+ const validEvents = Object.keys(WEBHOOK_EVENTS);
54
+ const invalidEvents = events.filter(event => !validEvents.includes(event));
55
+ return {
56
+ valid: invalidEvents.length === 0,
57
+ invalidEvents,
58
+ };
59
+ }
60
+ /**
61
+ * Validate webhook creation request
62
+ */
63
+ static validateCreateRequest(request) {
64
+ const errors = [];
65
+ if (!request.description || request.description.trim().length === 0) {
66
+ errors.push('Description is required');
67
+ }
68
+ if (!request.url || !this.isValidUrl(request.url)) {
69
+ errors.push('Valid URL is required');
70
+ }
71
+ if (!request.events || request.events.length === 0) {
72
+ errors.push('At least one event is required');
73
+ }
74
+ else {
75
+ const eventValidation = this.validateEvents(request.events);
76
+ if (!eventValidation.valid) {
77
+ errors.push(`Invalid events: ${eventValidation.invalidEvents.join(', ')}`);
78
+ }
79
+ }
80
+ return {
81
+ valid: errors.length === 0,
82
+ errors,
83
+ };
84
+ }
85
+ }
86
+ /**
87
+ * Webhook template generator
88
+ */
89
+ export class WebhookTemplates {
90
+ /**
91
+ * Get common webhook templates
92
+ */
93
+ static getTemplates() {
94
+ return {
95
+ 'ci-cd': {
96
+ description: 'CI/CD Pipeline Integration',
97
+ events: ['repo:push', 'pullrequest:created', 'pullrequest:updated'],
98
+ example_url: 'https://your-ci-server.com/hooks/bitbucket',
99
+ },
100
+ 'notifications': {
101
+ description: 'Team Notifications',
102
+ events: [
103
+ 'pullrequest:created',
104
+ 'pullrequest:approved',
105
+ 'pullrequest:fulfilled',
106
+ 'issue:created',
107
+ 'issue:updated',
108
+ ],
109
+ example_url: 'https://your-notification-service.com/webhooks/bitbucket',
110
+ },
111
+ 'security': {
112
+ description: 'Security Monitoring',
113
+ events: [
114
+ 'repo:push',
115
+ 'repo:fork',
116
+ 'pullrequest:created',
117
+ 'repo:commit_status_created',
118
+ ],
119
+ example_url: 'https://your-security-service.com/webhooks/bitbucket',
120
+ },
121
+ 'documentation': {
122
+ description: 'Documentation Updates',
123
+ events: ['repo:push', 'wiki:created', 'wiki:updated'],
124
+ example_url: 'https://your-docs-service.com/webhooks/bitbucket',
125
+ },
126
+ 'code-review': {
127
+ description: 'Code Review Automation',
128
+ events: [
129
+ 'pullrequest:created',
130
+ 'pullrequest:updated',
131
+ 'pullrequest:comment_created',
132
+ 'pullrequest:approved',
133
+ 'pullrequest:unapproved',
134
+ ],
135
+ example_url: 'https://your-review-bot.com/webhooks/bitbucket',
136
+ },
137
+ };
138
+ }
139
+ /**
140
+ * Get template by name
141
+ */
142
+ static getTemplate(name) {
143
+ const templates = this.getTemplates();
144
+ return templates[name] || null;
145
+ }
146
+ /**
147
+ * Get all template names
148
+ */
149
+ static getTemplateNames() {
150
+ return Object.keys(this.getTemplates());
151
+ }
152
+ }
153
+ /**
154
+ * Webhook management utilities
155
+ */
156
+ export class WebhookManager {
157
+ /**
158
+ * Format webhook for display
159
+ */
160
+ static formatWebhook(webhook) {
161
+ const status = webhook.active ? '✅ Active' : '❌ Inactive';
162
+ const eventCount = webhook.events.length;
163
+ return [
164
+ `**${webhook.description}**`,
165
+ ` UUID: ${webhook.uuid}`,
166
+ ` URL: ${webhook.url}`,
167
+ ` Status: ${status}`,
168
+ ` Events: ${eventCount} configured`,
169
+ ` Subject: ${webhook.subject.full_name}`,
170
+ ` Created: ${new Date(webhook.created_at).toLocaleString()}`,
171
+ '',
172
+ '**Configured Events:**',
173
+ ...webhook.events.map(event => ` • ${event}: ${WEBHOOK_EVENTS[event] || 'Unknown event'}`),
174
+ ].join('\n');
175
+ }
176
+ /**
177
+ * Format webhook list for display
178
+ */
179
+ static formatWebhookList(webhooks) {
180
+ if (webhooks.length === 0) {
181
+ return 'No webhooks configured.';
182
+ }
183
+ return webhooks.map((webhook, index) => [
184
+ `## Webhook ${index + 1}: ${webhook.description}`,
185
+ `**Status:** ${webhook.active ? '✅ Active' : '❌ Inactive'}`,
186
+ `**URL:** ${webhook.url}`,
187
+ `**Events:** ${webhook.events.length} configured`,
188
+ `**UUID:** ${webhook.uuid}`,
189
+ `**Created:** ${new Date(webhook.created_at).toLocaleString()}`,
190
+ '',
191
+ ].join('\n')).join('\n');
192
+ }
193
+ /**
194
+ * Format webhook delivery for display
195
+ */
196
+ static formatWebhookDelivery(delivery) {
197
+ const status = delivery.success ? '✅ Success' : '❌ Failed';
198
+ return [
199
+ `**Delivery ${delivery.uuid}**`,
200
+ ` Event: ${delivery.event}`,
201
+ ` Status: ${status} (${delivery.status_code})`,
202
+ ` Delivered: ${new Date(delivery.delivered_at).toLocaleString()}`,
203
+ ` Attempts: ${delivery.attempts}`,
204
+ ` Webhook: ${delivery.webhook.uuid}`,
205
+ ].join('\n');
206
+ }
207
+ /**
208
+ * Generate webhook creation summary
209
+ */
210
+ static generateCreationSummary(request, webhook) {
211
+ return [
212
+ '# ✅ Webhook Created Successfully',
213
+ '',
214
+ `**Description:** ${webhook.description}`,
215
+ `**URL:** ${webhook.url}`,
216
+ `**Status:** ${webhook.active ? '✅ Active' : '❌ Inactive'}`,
217
+ `**UUID:** ${webhook.uuid}`,
218
+ `**Created:** ${new Date(webhook.created_at).toLocaleString()}`,
219
+ '',
220
+ '**Configured Events:**',
221
+ ...webhook.events.map(event => `• ${event}: ${WEBHOOK_EVENTS[event] || 'Unknown event'}`),
222
+ '',
223
+ '**Next Steps:**',
224
+ '• Test your webhook endpoint to ensure it can receive requests',
225
+ '• Monitor webhook deliveries for any failures',
226
+ '• Update webhook configuration as needed using update-webhook tool',
227
+ ].join('\n');
228
+ }
229
+ /**
230
+ * Generate webhook update summary
231
+ */
232
+ static generateUpdateSummary(oldWebhook, newWebhook, changes) {
233
+ return [
234
+ '# ✅ Webhook Updated Successfully',
235
+ '',
236
+ `**Description:** ${newWebhook.description}`,
237
+ `**UUID:** ${newWebhook.uuid}`,
238
+ '',
239
+ '**Changes Applied:**',
240
+ ...changes.map(change => `• ${change}`),
241
+ '',
242
+ '**Current Configuration:**',
243
+ `• **URL:** ${newWebhook.url}`,
244
+ `• **Status:** ${newWebhook.active ? '✅ Active' : '❌ Inactive'}`,
245
+ `• **Events:** ${newWebhook.events.length} configured`,
246
+ '',
247
+ '**Configured Events:**',
248
+ ...newWebhook.events.map(event => `• ${event}: ${WEBHOOK_EVENTS[event] || 'Unknown event'}`),
249
+ ].join('\n');
250
+ }
251
+ /**
252
+ * Generate webhook test summary
253
+ */
254
+ static generateTestSummary(webhook, testResult) {
255
+ return [
256
+ '# 🧪 Webhook Test Results',
257
+ '',
258
+ `**Webhook:** ${webhook.description}`,
259
+ `**URL:** ${webhook.url}`,
260
+ `**UUID:** ${webhook.uuid}`,
261
+ '',
262
+ '**Test Details:**',
263
+ `• **Test Event:** repo:push (test event)`,
264
+ `• **Response Code:** ${testResult.status_code || 'N/A'}`,
265
+ `• **Success:** ${testResult.success ? '✅ Yes' : '❌ No'}`,
266
+ `• **Response Time:** ${testResult.response_time || 'N/A'}ms`,
267
+ '',
268
+ testResult.success
269
+ ? '✅ **Webhook is working correctly!**'
270
+ : '❌ **Webhook test failed. Please check your endpoint.**',
271
+ ].join('\n');
272
+ }
273
+ }
274
+ /**
275
+ * Webhook security utilities
276
+ */
277
+ export class WebhookSecurity {
278
+ /**
279
+ * Generate secure random secret for webhook
280
+ */
281
+ static generateSecret(length = 32) {
282
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
283
+ let result = '';
284
+ for (let i = 0; i < length; i++) {
285
+ result += chars.charAt(Math.floor(Math.random() * chars.length));
286
+ }
287
+ return result;
288
+ }
289
+ /**
290
+ * Get security recommendations for webhook setup
291
+ */
292
+ static getSecurityRecommendations() {
293
+ return [
294
+ 'Use HTTPS URLs only for webhook endpoints',
295
+ 'Implement webhook signature verification using the secret',
296
+ 'Validate webhook payloads before processing',
297
+ 'Implement rate limiting on your webhook endpoint',
298
+ 'Log webhook deliveries for debugging and monitoring',
299
+ 'Use specific events instead of subscribing to all events',
300
+ 'Implement timeout handling for webhook processing',
301
+ 'Set up monitoring and alerting for webhook failures',
302
+ ];
303
+ }
304
+ }
305
+ //# sourceMappingURL=webhooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/webhooks.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C,CAAC,CAAC,wDAAwD;SAC7D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,eAAe;IAC1B;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,SAAiB,EAAE;QACvC,MAAM,KAAK,GAAG,gEAAgE,CAAC;QAC/E,IAAI,MAAM,GAAG,EAAE,CAAC;QAEhB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QACnE,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,0BAA0B;QAC/B,OAAO;YACL,2CAA2C;YAC3C,2DAA2D;YAC3D,6CAA6C;YAC7C,kDAAkD;YAClD,qDAAqD;YACrD,0DAA0D;YAC1D,mDAAmD;YACnD,qDAAqD;SACtD,CAAC;IACJ,CAAC;CACF"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "bitbucket-mcp-server",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for Bitbucket tools and integration",
5
+ "type": "module",
6
+ "main": "./build/index.js",
7
+ "bin": {
8
+ "bitbucket-mcp": "./build/index.js"
9
+ },
10
+ "scripts": {
11
+ "build": "tsc && chmod +x build/index.js",
12
+ "start": "npm run build && node build/index.js",
13
+ "dev": "tsc --watch",
14
+ "test": "vitest",
15
+ "test:ui": "vitest --ui",
16
+ "test:run": "vitest run",
17
+ "test:coverage": "vitest run --coverage"
18
+ },
19
+ "files": [
20
+ "build/",
21
+ "README.md",
22
+ "LICENSE"
23
+ ],
24
+ "keywords": [
25
+ "mcp",
26
+ "bitbucket",
27
+ "model-context-protocol"
28
+ ],
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/WilliamLINWEN/bitbucket-mcp.git"
32
+ },
33
+ "homepage": "https://github.com/WilliamLINWEN/bitbucket-mcp",
34
+ "author": "WilliamLin",
35
+ "license": "ISC",
36
+ "devDependencies": {
37
+ "typescript": "^5.8.3",
38
+ "vitest": "^2.1.8",
39
+ "@vitest/ui": "^2.1.8",
40
+ "happy-dom": "^15.11.7"
41
+ },
42
+ "dependencies": {
43
+ "@modelcontextprotocol/sdk": "^1.12.0",
44
+ "@types/node": "^22.15.21",
45
+ "node-fetch": "^3.3.2",
46
+ "zod": "^3.25.28"
47
+ }
48
+ }