@webhooks-cc/mcp 0.1.0 → 0.3.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/dist/bin/mcp.js +83 -13
- package/dist/index.js +83 -13
- package/dist/index.mjs +83 -13
- package/package.json +3 -3
package/dist/bin/mcp.js
CHANGED
|
@@ -91,19 +91,44 @@ function registerTools(server, client) {
|
|
|
91
91
|
slug: import_zod.z.string().describe("The endpoint slug to send to"),
|
|
92
92
|
method: import_zod.z.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]).default("POST").describe("HTTP method (default: POST)"),
|
|
93
93
|
headers: import_zod.z.record(import_zod.z.string()).optional().describe("HTTP headers to include"),
|
|
94
|
-
body: import_zod.z.unknown().optional().describe("Request body (will be JSON-serialized)")
|
|
94
|
+
body: import_zod.z.unknown().optional().describe("Request body (will be JSON-serialized)"),
|
|
95
|
+
provider: import_zod.z.enum(["stripe", "github", "shopify", "twilio", "standard-webhooks"]).optional().describe("Optional provider template to send with signed headers"),
|
|
96
|
+
template: import_zod.z.string().optional().describe("Optional provider-specific template preset (for example: pull_request.opened)"),
|
|
97
|
+
event: import_zod.z.string().optional().describe("Optional provider event/topic name when provider template is used"),
|
|
98
|
+
secret: import_zod.z.string().optional().describe(
|
|
99
|
+
"Shared secret for provider signature generation (required when provider is set)"
|
|
100
|
+
)
|
|
95
101
|
},
|
|
96
|
-
withErrorHandling(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
withErrorHandling(
|
|
103
|
+
async ({ slug, method, headers, body, provider, template, event, secret }) => {
|
|
104
|
+
let response;
|
|
105
|
+
if (provider) {
|
|
106
|
+
const templateSecret = secret?.trim();
|
|
107
|
+
if (!templateSecret) {
|
|
108
|
+
throw new Error("send_webhook with provider templates requires a non-empty secret");
|
|
109
|
+
}
|
|
110
|
+
response = await client.endpoints.sendTemplate(slug, {
|
|
111
|
+
provider,
|
|
112
|
+
template,
|
|
113
|
+
event,
|
|
114
|
+
secret: templateSecret,
|
|
115
|
+
method,
|
|
116
|
+
headers,
|
|
117
|
+
body
|
|
118
|
+
});
|
|
119
|
+
} else {
|
|
120
|
+
response = await client.endpoints.send(slug, { method, headers, body });
|
|
121
|
+
}
|
|
122
|
+
const responseBody = await readBodyTruncated(response);
|
|
123
|
+
return textContent(
|
|
124
|
+
JSON.stringify(
|
|
125
|
+
{ status: response.status, statusText: response.statusText, body: responseBody },
|
|
126
|
+
null,
|
|
127
|
+
2
|
|
128
|
+
)
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
)
|
|
107
132
|
);
|
|
108
133
|
server.tool(
|
|
109
134
|
"list_requests",
|
|
@@ -169,6 +194,51 @@ function registerTools(server, client) {
|
|
|
169
194
|
);
|
|
170
195
|
})
|
|
171
196
|
);
|
|
197
|
+
server.tool(
|
|
198
|
+
"send_to",
|
|
199
|
+
"Send a webhook directly to any URL with optional provider signing. Use this for local integration testing \u2014 send properly signed webhooks to localhost handlers without routing through webhooks.cc infrastructure.",
|
|
200
|
+
{
|
|
201
|
+
url: import_zod.z.string().url().refine(
|
|
202
|
+
(u) => {
|
|
203
|
+
try {
|
|
204
|
+
const p = new URL(u).protocol;
|
|
205
|
+
return p === "http:" || p === "https:";
|
|
206
|
+
} catch {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
{ message: "Only http and https URLs are supported" }
|
|
211
|
+
).describe("Target URL to send the webhook to"),
|
|
212
|
+
method: import_zod.z.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]).default("POST").describe("HTTP method (default: POST)"),
|
|
213
|
+
headers: import_zod.z.record(import_zod.z.string()).optional().describe("HTTP headers to include"),
|
|
214
|
+
body: import_zod.z.unknown().optional().describe("Request body (will be JSON-serialized)"),
|
|
215
|
+
provider: import_zod.z.enum(["stripe", "github", "shopify", "twilio", "standard-webhooks"]).optional().describe("Optional provider template for signing"),
|
|
216
|
+
template: import_zod.z.string().optional().describe("Provider-specific template preset (not used for standard-webhooks)"),
|
|
217
|
+
event: import_zod.z.string().optional().describe("Provider event/topic name"),
|
|
218
|
+
secret: import_zod.z.string().optional().describe(
|
|
219
|
+
"Shared secret for provider signature generation (required when provider is set)"
|
|
220
|
+
)
|
|
221
|
+
},
|
|
222
|
+
withErrorHandling(async ({ url, method, headers, body, provider, template, event, secret }) => {
|
|
223
|
+
const response = await client.sendTo(url, {
|
|
224
|
+
method,
|
|
225
|
+
headers,
|
|
226
|
+
body,
|
|
227
|
+
provider,
|
|
228
|
+
template,
|
|
229
|
+
event,
|
|
230
|
+
secret
|
|
231
|
+
});
|
|
232
|
+
const responseBody = await readBodyTruncated(response);
|
|
233
|
+
return textContent(
|
|
234
|
+
JSON.stringify(
|
|
235
|
+
{ status: response.status, statusText: response.statusText, body: responseBody },
|
|
236
|
+
null,
|
|
237
|
+
2
|
|
238
|
+
)
|
|
239
|
+
);
|
|
240
|
+
})
|
|
241
|
+
);
|
|
172
242
|
server.tool(
|
|
173
243
|
"describe",
|
|
174
244
|
"Describe all available SDK operations, their parameters, and types. Useful for discovering what actions are possible.",
|
|
@@ -181,7 +251,7 @@ function registerTools(server, client) {
|
|
|
181
251
|
}
|
|
182
252
|
|
|
183
253
|
// src/index.ts
|
|
184
|
-
var VERSION = true ? "0.
|
|
254
|
+
var VERSION = true ? "0.3.0" : "0.0.0-dev";
|
|
185
255
|
function createServer(options = {}) {
|
|
186
256
|
const apiKey = options.apiKey ?? process.env.WHK_API_KEY;
|
|
187
257
|
if (!apiKey) {
|
package/dist/index.js
CHANGED
|
@@ -110,19 +110,44 @@ function registerTools(server, client) {
|
|
|
110
110
|
slug: import_zod.z.string().describe("The endpoint slug to send to"),
|
|
111
111
|
method: import_zod.z.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]).default("POST").describe("HTTP method (default: POST)"),
|
|
112
112
|
headers: import_zod.z.record(import_zod.z.string()).optional().describe("HTTP headers to include"),
|
|
113
|
-
body: import_zod.z.unknown().optional().describe("Request body (will be JSON-serialized)")
|
|
113
|
+
body: import_zod.z.unknown().optional().describe("Request body (will be JSON-serialized)"),
|
|
114
|
+
provider: import_zod.z.enum(["stripe", "github", "shopify", "twilio", "standard-webhooks"]).optional().describe("Optional provider template to send with signed headers"),
|
|
115
|
+
template: import_zod.z.string().optional().describe("Optional provider-specific template preset (for example: pull_request.opened)"),
|
|
116
|
+
event: import_zod.z.string().optional().describe("Optional provider event/topic name when provider template is used"),
|
|
117
|
+
secret: import_zod.z.string().optional().describe(
|
|
118
|
+
"Shared secret for provider signature generation (required when provider is set)"
|
|
119
|
+
)
|
|
114
120
|
},
|
|
115
|
-
withErrorHandling(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
withErrorHandling(
|
|
122
|
+
async ({ slug, method, headers, body, provider, template, event, secret }) => {
|
|
123
|
+
let response;
|
|
124
|
+
if (provider) {
|
|
125
|
+
const templateSecret = secret?.trim();
|
|
126
|
+
if (!templateSecret) {
|
|
127
|
+
throw new Error("send_webhook with provider templates requires a non-empty secret");
|
|
128
|
+
}
|
|
129
|
+
response = await client.endpoints.sendTemplate(slug, {
|
|
130
|
+
provider,
|
|
131
|
+
template,
|
|
132
|
+
event,
|
|
133
|
+
secret: templateSecret,
|
|
134
|
+
method,
|
|
135
|
+
headers,
|
|
136
|
+
body
|
|
137
|
+
});
|
|
138
|
+
} else {
|
|
139
|
+
response = await client.endpoints.send(slug, { method, headers, body });
|
|
140
|
+
}
|
|
141
|
+
const responseBody = await readBodyTruncated(response);
|
|
142
|
+
return textContent(
|
|
143
|
+
JSON.stringify(
|
|
144
|
+
{ status: response.status, statusText: response.statusText, body: responseBody },
|
|
145
|
+
null,
|
|
146
|
+
2
|
|
147
|
+
)
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
)
|
|
126
151
|
);
|
|
127
152
|
server.tool(
|
|
128
153
|
"list_requests",
|
|
@@ -188,6 +213,51 @@ function registerTools(server, client) {
|
|
|
188
213
|
);
|
|
189
214
|
})
|
|
190
215
|
);
|
|
216
|
+
server.tool(
|
|
217
|
+
"send_to",
|
|
218
|
+
"Send a webhook directly to any URL with optional provider signing. Use this for local integration testing \u2014 send properly signed webhooks to localhost handlers without routing through webhooks.cc infrastructure.",
|
|
219
|
+
{
|
|
220
|
+
url: import_zod.z.string().url().refine(
|
|
221
|
+
(u) => {
|
|
222
|
+
try {
|
|
223
|
+
const p = new URL(u).protocol;
|
|
224
|
+
return p === "http:" || p === "https:";
|
|
225
|
+
} catch {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
{ message: "Only http and https URLs are supported" }
|
|
230
|
+
).describe("Target URL to send the webhook to"),
|
|
231
|
+
method: import_zod.z.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]).default("POST").describe("HTTP method (default: POST)"),
|
|
232
|
+
headers: import_zod.z.record(import_zod.z.string()).optional().describe("HTTP headers to include"),
|
|
233
|
+
body: import_zod.z.unknown().optional().describe("Request body (will be JSON-serialized)"),
|
|
234
|
+
provider: import_zod.z.enum(["stripe", "github", "shopify", "twilio", "standard-webhooks"]).optional().describe("Optional provider template for signing"),
|
|
235
|
+
template: import_zod.z.string().optional().describe("Provider-specific template preset (not used for standard-webhooks)"),
|
|
236
|
+
event: import_zod.z.string().optional().describe("Provider event/topic name"),
|
|
237
|
+
secret: import_zod.z.string().optional().describe(
|
|
238
|
+
"Shared secret for provider signature generation (required when provider is set)"
|
|
239
|
+
)
|
|
240
|
+
},
|
|
241
|
+
withErrorHandling(async ({ url, method, headers, body, provider, template, event, secret }) => {
|
|
242
|
+
const response = await client.sendTo(url, {
|
|
243
|
+
method,
|
|
244
|
+
headers,
|
|
245
|
+
body,
|
|
246
|
+
provider,
|
|
247
|
+
template,
|
|
248
|
+
event,
|
|
249
|
+
secret
|
|
250
|
+
});
|
|
251
|
+
const responseBody = await readBodyTruncated(response);
|
|
252
|
+
return textContent(
|
|
253
|
+
JSON.stringify(
|
|
254
|
+
{ status: response.status, statusText: response.statusText, body: responseBody },
|
|
255
|
+
null,
|
|
256
|
+
2
|
|
257
|
+
)
|
|
258
|
+
);
|
|
259
|
+
})
|
|
260
|
+
);
|
|
191
261
|
server.tool(
|
|
192
262
|
"describe",
|
|
193
263
|
"Describe all available SDK operations, their parameters, and types. Useful for discovering what actions are possible.",
|
|
@@ -200,7 +270,7 @@ function registerTools(server, client) {
|
|
|
200
270
|
}
|
|
201
271
|
|
|
202
272
|
// src/index.ts
|
|
203
|
-
var VERSION = true ? "0.
|
|
273
|
+
var VERSION = true ? "0.3.0" : "0.0.0-dev";
|
|
204
274
|
function createServer(options = {}) {
|
|
205
275
|
const apiKey = options.apiKey ?? process.env.WHK_API_KEY;
|
|
206
276
|
if (!apiKey) {
|
package/dist/index.mjs
CHANGED
|
@@ -85,19 +85,44 @@ function registerTools(server, client) {
|
|
|
85
85
|
slug: z.string().describe("The endpoint slug to send to"),
|
|
86
86
|
method: z.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]).default("POST").describe("HTTP method (default: POST)"),
|
|
87
87
|
headers: z.record(z.string()).optional().describe("HTTP headers to include"),
|
|
88
|
-
body: z.unknown().optional().describe("Request body (will be JSON-serialized)")
|
|
88
|
+
body: z.unknown().optional().describe("Request body (will be JSON-serialized)"),
|
|
89
|
+
provider: z.enum(["stripe", "github", "shopify", "twilio", "standard-webhooks"]).optional().describe("Optional provider template to send with signed headers"),
|
|
90
|
+
template: z.string().optional().describe("Optional provider-specific template preset (for example: pull_request.opened)"),
|
|
91
|
+
event: z.string().optional().describe("Optional provider event/topic name when provider template is used"),
|
|
92
|
+
secret: z.string().optional().describe(
|
|
93
|
+
"Shared secret for provider signature generation (required when provider is set)"
|
|
94
|
+
)
|
|
89
95
|
},
|
|
90
|
-
withErrorHandling(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
withErrorHandling(
|
|
97
|
+
async ({ slug, method, headers, body, provider, template, event, secret }) => {
|
|
98
|
+
let response;
|
|
99
|
+
if (provider) {
|
|
100
|
+
const templateSecret = secret?.trim();
|
|
101
|
+
if (!templateSecret) {
|
|
102
|
+
throw new Error("send_webhook with provider templates requires a non-empty secret");
|
|
103
|
+
}
|
|
104
|
+
response = await client.endpoints.sendTemplate(slug, {
|
|
105
|
+
provider,
|
|
106
|
+
template,
|
|
107
|
+
event,
|
|
108
|
+
secret: templateSecret,
|
|
109
|
+
method,
|
|
110
|
+
headers,
|
|
111
|
+
body
|
|
112
|
+
});
|
|
113
|
+
} else {
|
|
114
|
+
response = await client.endpoints.send(slug, { method, headers, body });
|
|
115
|
+
}
|
|
116
|
+
const responseBody = await readBodyTruncated(response);
|
|
117
|
+
return textContent(
|
|
118
|
+
JSON.stringify(
|
|
119
|
+
{ status: response.status, statusText: response.statusText, body: responseBody },
|
|
120
|
+
null,
|
|
121
|
+
2
|
|
122
|
+
)
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
)
|
|
101
126
|
);
|
|
102
127
|
server.tool(
|
|
103
128
|
"list_requests",
|
|
@@ -163,6 +188,51 @@ function registerTools(server, client) {
|
|
|
163
188
|
);
|
|
164
189
|
})
|
|
165
190
|
);
|
|
191
|
+
server.tool(
|
|
192
|
+
"send_to",
|
|
193
|
+
"Send a webhook directly to any URL with optional provider signing. Use this for local integration testing \u2014 send properly signed webhooks to localhost handlers without routing through webhooks.cc infrastructure.",
|
|
194
|
+
{
|
|
195
|
+
url: z.string().url().refine(
|
|
196
|
+
(u) => {
|
|
197
|
+
try {
|
|
198
|
+
const p = new URL(u).protocol;
|
|
199
|
+
return p === "http:" || p === "https:";
|
|
200
|
+
} catch {
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{ message: "Only http and https URLs are supported" }
|
|
205
|
+
).describe("Target URL to send the webhook to"),
|
|
206
|
+
method: z.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]).default("POST").describe("HTTP method (default: POST)"),
|
|
207
|
+
headers: z.record(z.string()).optional().describe("HTTP headers to include"),
|
|
208
|
+
body: z.unknown().optional().describe("Request body (will be JSON-serialized)"),
|
|
209
|
+
provider: z.enum(["stripe", "github", "shopify", "twilio", "standard-webhooks"]).optional().describe("Optional provider template for signing"),
|
|
210
|
+
template: z.string().optional().describe("Provider-specific template preset (not used for standard-webhooks)"),
|
|
211
|
+
event: z.string().optional().describe("Provider event/topic name"),
|
|
212
|
+
secret: z.string().optional().describe(
|
|
213
|
+
"Shared secret for provider signature generation (required when provider is set)"
|
|
214
|
+
)
|
|
215
|
+
},
|
|
216
|
+
withErrorHandling(async ({ url, method, headers, body, provider, template, event, secret }) => {
|
|
217
|
+
const response = await client.sendTo(url, {
|
|
218
|
+
method,
|
|
219
|
+
headers,
|
|
220
|
+
body,
|
|
221
|
+
provider,
|
|
222
|
+
template,
|
|
223
|
+
event,
|
|
224
|
+
secret
|
|
225
|
+
});
|
|
226
|
+
const responseBody = await readBodyTruncated(response);
|
|
227
|
+
return textContent(
|
|
228
|
+
JSON.stringify(
|
|
229
|
+
{ status: response.status, statusText: response.statusText, body: responseBody },
|
|
230
|
+
null,
|
|
231
|
+
2
|
|
232
|
+
)
|
|
233
|
+
);
|
|
234
|
+
})
|
|
235
|
+
);
|
|
166
236
|
server.tool(
|
|
167
237
|
"describe",
|
|
168
238
|
"Describe all available SDK operations, their parameters, and types. Useful for discovering what actions are possible.",
|
|
@@ -175,7 +245,7 @@ function registerTools(server, client) {
|
|
|
175
245
|
}
|
|
176
246
|
|
|
177
247
|
// src/index.ts
|
|
178
|
-
var VERSION = true ? "0.
|
|
248
|
+
var VERSION = true ? "0.3.0" : "0.0.0-dev";
|
|
179
249
|
function createServer(options = {}) {
|
|
180
250
|
const apiKey = options.apiKey ?? process.env.WHK_API_KEY;
|
|
181
251
|
if (!apiKey) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webhooks-cc/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "MCP server for webhooks.cc — AI agent integration for webhook testing",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://webhooks.cc",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
39
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
40
40
|
"zod": "^3.25.0",
|
|
41
|
-
"@webhooks-cc/sdk": "0.
|
|
41
|
+
"@webhooks-cc/sdk": "0.5.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"tsup": "^8.5.1",
|