@webhooks-cc/mcp 0.1.0 → 0.2.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 +38 -13
- package/dist/index.js +38 -13
- package/dist/index.mjs +38 -13
- package/package.json +2 -2
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"]).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",
|
|
@@ -181,7 +206,7 @@ function registerTools(server, client) {
|
|
|
181
206
|
}
|
|
182
207
|
|
|
183
208
|
// src/index.ts
|
|
184
|
-
var VERSION = true ? "0.
|
|
209
|
+
var VERSION = true ? "0.2.0" : "0.0.0-dev";
|
|
185
210
|
function createServer(options = {}) {
|
|
186
211
|
const apiKey = options.apiKey ?? process.env.WHK_API_KEY;
|
|
187
212
|
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"]).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",
|
|
@@ -200,7 +225,7 @@ function registerTools(server, client) {
|
|
|
200
225
|
}
|
|
201
226
|
|
|
202
227
|
// src/index.ts
|
|
203
|
-
var VERSION = true ? "0.
|
|
228
|
+
var VERSION = true ? "0.2.0" : "0.0.0-dev";
|
|
204
229
|
function createServer(options = {}) {
|
|
205
230
|
const apiKey = options.apiKey ?? process.env.WHK_API_KEY;
|
|
206
231
|
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"]).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",
|
|
@@ -175,7 +200,7 @@ function registerTools(server, client) {
|
|
|
175
200
|
}
|
|
176
201
|
|
|
177
202
|
// src/index.ts
|
|
178
|
-
var VERSION = true ? "0.
|
|
203
|
+
var VERSION = true ? "0.2.0" : "0.0.0-dev";
|
|
179
204
|
function createServer(options = {}) {
|
|
180
205
|
const apiKey = options.apiKey ?? process.env.WHK_API_KEY;
|
|
181
206
|
if (!apiKey) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webhooks-cc/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
40
40
|
"zod": "^3.25.0",
|
|
41
|
-
"@webhooks-cc/sdk": "0.
|
|
41
|
+
"@webhooks-cc/sdk": "0.4.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"tsup": "^8.5.1",
|