dump-mcp 0.1.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/README.md +162 -0
- package/dist/api-client.d.ts +66 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +160 -0
- package/dist/api-client.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +96 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/endpoints.d.ts +14 -0
- package/dist/tools/endpoints.d.ts.map +1 -0
- package/dist/tools/endpoints.js +195 -0
- package/dist/tools/endpoints.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +7 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/replay.d.ts +14 -0
- package/dist/tools/replay.d.ts.map +1 -0
- package/dist/tools/replay.js +169 -0
- package/dist/tools/replay.js.map +1 -0
- package/dist/tools/requests.d.ts +14 -0
- package/dist/tools/requests.d.ts.map +1 -0
- package/dist/tools/requests.js +157 -0
- package/dist/tools/requests.js.map +1 -0
- package/dist/types.d.ts +113 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +15 -0
- package/dist/types.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Endpoint management tools for dump-mcp
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Register endpoint-related tools
|
|
6
|
+
*/
|
|
7
|
+
export function registerEndpointTools() {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
name: 'dump_list_teams',
|
|
11
|
+
description: 'List all teams you have access to. Returns team IDs needed for other operations.',
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {},
|
|
15
|
+
required: [],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'dump_list_endpoints',
|
|
20
|
+
description: 'List all webhook capture endpoints in a team.',
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: 'object',
|
|
23
|
+
properties: {
|
|
24
|
+
team_id: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'The team ID to list endpoints for',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
required: ['team_id'],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'dump_create_endpoint',
|
|
34
|
+
description: 'Create a new webhook capture endpoint. Returns the capture URL where webhooks should be sent.',
|
|
35
|
+
inputSchema: {
|
|
36
|
+
type: 'object',
|
|
37
|
+
properties: {
|
|
38
|
+
team_id: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'The team ID to create the endpoint in',
|
|
41
|
+
},
|
|
42
|
+
name: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'Name for the endpoint (e.g., "github-webhooks", "stripe-events")',
|
|
45
|
+
},
|
|
46
|
+
description: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'Optional description of what this endpoint captures',
|
|
49
|
+
},
|
|
50
|
+
custom_response_status: {
|
|
51
|
+
type: 'number',
|
|
52
|
+
description: 'Optional HTTP status code to return (default: 200)',
|
|
53
|
+
},
|
|
54
|
+
custom_response_body: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
description: 'Optional response body to return',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
required: ['team_id', 'name'],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'dump_get_endpoint',
|
|
64
|
+
description: 'Get details of a specific endpoint including its capture URL.',
|
|
65
|
+
inputSchema: {
|
|
66
|
+
type: 'object',
|
|
67
|
+
properties: {
|
|
68
|
+
team_id: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
description: 'The team ID',
|
|
71
|
+
},
|
|
72
|
+
endpoint_id: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
description: 'The endpoint ID',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
required: ['team_id', 'endpoint_id'],
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'dump_delete_endpoint',
|
|
82
|
+
description: 'Delete an endpoint and all its captured requests. This action cannot be undone.',
|
|
83
|
+
inputSchema: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
team_id: {
|
|
87
|
+
type: 'string',
|
|
88
|
+
description: 'The team ID',
|
|
89
|
+
},
|
|
90
|
+
endpoint_id: {
|
|
91
|
+
type: 'string',
|
|
92
|
+
description: 'The endpoint ID to delete',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
required: ['team_id', 'endpoint_id'],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
];
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Handle endpoint tool calls
|
|
102
|
+
*/
|
|
103
|
+
export async function handleEndpointTool(client, name, args) {
|
|
104
|
+
switch (name) {
|
|
105
|
+
case 'dump_list_teams': {
|
|
106
|
+
const teams = await client.listTeams();
|
|
107
|
+
return {
|
|
108
|
+
teams: teams.map((t) => ({
|
|
109
|
+
id: t.id,
|
|
110
|
+
name: t.name,
|
|
111
|
+
slug: t.slug,
|
|
112
|
+
role: t.role,
|
|
113
|
+
})),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
case 'dump_list_endpoints': {
|
|
117
|
+
const teamId = args.team_id;
|
|
118
|
+
if (!teamId)
|
|
119
|
+
throw new Error('team_id is required');
|
|
120
|
+
const endpoints = await client.listEndpoints(teamId);
|
|
121
|
+
return {
|
|
122
|
+
endpoints: endpoints.map((e) => ({
|
|
123
|
+
id: e.id,
|
|
124
|
+
name: e.name,
|
|
125
|
+
short_id: e.short_id,
|
|
126
|
+
capture_url: e.capture_url,
|
|
127
|
+
description: e.description,
|
|
128
|
+
created_at: e.created_at,
|
|
129
|
+
})),
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
case 'dump_create_endpoint': {
|
|
133
|
+
const teamId = args.team_id;
|
|
134
|
+
const name = args.name;
|
|
135
|
+
if (!teamId)
|
|
136
|
+
throw new Error('team_id is required');
|
|
137
|
+
if (!name)
|
|
138
|
+
throw new Error('name is required');
|
|
139
|
+
const params = { name };
|
|
140
|
+
if (args.description)
|
|
141
|
+
params.description = args.description;
|
|
142
|
+
if (args.custom_response_status) {
|
|
143
|
+
params.custom_response_status = args.custom_response_status;
|
|
144
|
+
}
|
|
145
|
+
if (args.custom_response_body) {
|
|
146
|
+
params.custom_response_body = args.custom_response_body;
|
|
147
|
+
}
|
|
148
|
+
const endpoint = await client.createEndpoint(teamId, params);
|
|
149
|
+
return {
|
|
150
|
+
endpoint: {
|
|
151
|
+
id: endpoint.id,
|
|
152
|
+
name: endpoint.name,
|
|
153
|
+
short_id: endpoint.short_id,
|
|
154
|
+
capture_url: endpoint.capture_url,
|
|
155
|
+
description: endpoint.description,
|
|
156
|
+
},
|
|
157
|
+
message: `Endpoint created. Send webhooks to: ${endpoint.capture_url}`,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
case 'dump_get_endpoint': {
|
|
161
|
+
const teamId = args.team_id;
|
|
162
|
+
const endpointId = args.endpoint_id;
|
|
163
|
+
if (!teamId)
|
|
164
|
+
throw new Error('team_id is required');
|
|
165
|
+
if (!endpointId)
|
|
166
|
+
throw new Error('endpoint_id is required');
|
|
167
|
+
const endpoint = await client.getEndpoint(teamId, endpointId);
|
|
168
|
+
return {
|
|
169
|
+
endpoint: {
|
|
170
|
+
id: endpoint.id,
|
|
171
|
+
name: endpoint.name,
|
|
172
|
+
short_id: endpoint.short_id,
|
|
173
|
+
capture_url: endpoint.capture_url,
|
|
174
|
+
description: endpoint.description,
|
|
175
|
+
custom_response_status: endpoint.custom_response_status,
|
|
176
|
+
custom_response_body: endpoint.custom_response_body,
|
|
177
|
+
created_at: endpoint.created_at,
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
case 'dump_delete_endpoint': {
|
|
182
|
+
const teamId = args.team_id;
|
|
183
|
+
const endpointId = args.endpoint_id;
|
|
184
|
+
if (!teamId)
|
|
185
|
+
throw new Error('team_id is required');
|
|
186
|
+
if (!endpointId)
|
|
187
|
+
throw new Error('endpoint_id is required');
|
|
188
|
+
await client.deleteEndpoint(teamId, endpointId);
|
|
189
|
+
return { message: 'Endpoint deleted successfully' };
|
|
190
|
+
}
|
|
191
|
+
default:
|
|
192
|
+
throw new Error(`Unknown endpoint tool: ${name}`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../src/tools/endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL;YACE,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,kFAAkF;YAC/F,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,EAAE;gBACd,QAAQ,EAAE,EAAE;aACb;SACF;QACD;YACE,IAAI,EAAE,qBAAqB;YAC3B,WAAW,EAAE,+CAA+C;YAC5D,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,OAAO,EAAE;wBACP,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,mCAAmC;qBACjD;iBACF;gBACD,QAAQ,EAAE,CAAC,SAAS,CAAC;aACtB;SACF;QACD;YACE,IAAI,EAAE,sBAAsB;YAC5B,WAAW,EAAE,+FAA+F;YAC5G,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,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BACL,QAAQ,EAAE;oBACR,EAAE,EAAE,QAAQ,CAAC,EAAE;oBACf,IAAI,EAAE,QAAQ,CAAC,IAAI;oBACnB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;oBAC3B,WAAW,EAAE,QAAQ,CAAC,WAAW;oBACjC,WAAW,EAAE,QAAQ,CAAC,WAAW;oBACjC,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB;oBACvD,oBAAoB,EAAE,QAAQ,CAAC,oBAAoB;oBACnD,UAAU,EAAE,QAAQ,CAAC,UAAU;iBAChC;aACF,CAAC;QACJ,CAAC;QAED,KAAK,sBAAsB,CAAC,CAAC,CAAC;YAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,OAAiB,CAAC;YACtC,MAAM,UAAU,GAAG,IAAI,CAAC,WAAqB,CAAC;YAC9C,IAAI,CAAC,MAAM;gBAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;YACpD,IAAI,CAAC,UAAU;gBAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;YAE5D,MAAM,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YAChD,OAAO,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC;QACtD,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,0BAA0B,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool registry for dump-mcp
|
|
3
|
+
*/
|
|
4
|
+
export { registerEndpointTools, handleEndpointTool } from './endpoints.js';
|
|
5
|
+
export { registerRequestTools, handleRequestTool } from './requests.js';
|
|
6
|
+
export { registerReplayTools, handleReplayTool } from './replay.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool registry for dump-mcp
|
|
3
|
+
*/
|
|
4
|
+
export { registerEndpointTools, handleEndpointTool } from './endpoints.js';
|
|
5
|
+
export { registerRequestTools, handleRequestTool } from './requests.js';
|
|
6
|
+
export { registerReplayTools, handleReplayTool } from './replay.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replay tools for dump-mcp
|
|
3
|
+
*/
|
|
4
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
import { DumpApiClient } from '../api-client.js';
|
|
6
|
+
/**
|
|
7
|
+
* Register replay-related tools
|
|
8
|
+
*/
|
|
9
|
+
export declare function registerReplayTools(): Tool[];
|
|
10
|
+
/**
|
|
11
|
+
* Handle replay tool calls
|
|
12
|
+
*/
|
|
13
|
+
export declare function handleReplayTool(client: DumpApiClient, name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
14
|
+
//# sourceMappingURL=replay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/tools/replay.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,EAAE,CAsE5C;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,OAAO,CAAC,CA6FlB"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replay tools for dump-mcp
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Register replay-related tools
|
|
6
|
+
*/
|
|
7
|
+
export function registerReplayTools() {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
name: 'dump_replay_request',
|
|
11
|
+
description: 'Replay a captured request to a target URL. Useful for testing webhooks against local development servers.',
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
team_id: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
description: 'The team ID',
|
|
18
|
+
},
|
|
19
|
+
endpoint_id: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'The endpoint ID',
|
|
22
|
+
},
|
|
23
|
+
request_id: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
description: 'The request ID to replay',
|
|
26
|
+
},
|
|
27
|
+
target_url: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: 'The URL to send the replayed request to (e.g., http://localhost:3000/webhook)',
|
|
30
|
+
},
|
|
31
|
+
modify_headers: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
description: 'Optional headers to add or override in the replayed request',
|
|
34
|
+
additionalProperties: { type: 'string' },
|
|
35
|
+
},
|
|
36
|
+
modify_body: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: 'Optional body to use instead of the original request body',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
required: ['team_id', 'endpoint_id', 'request_id', 'target_url'],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'dump_get_replay_result',
|
|
46
|
+
description: 'Get the result of a replay request, including the response from the target server.',
|
|
47
|
+
inputSchema: {
|
|
48
|
+
type: 'object',
|
|
49
|
+
properties: {
|
|
50
|
+
team_id: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
description: 'The team ID',
|
|
53
|
+
},
|
|
54
|
+
replay_id: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
description: 'The replay ID returned from dump_replay_request',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
required: ['team_id', 'replay_id'],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'dump_list_replays',
|
|
64
|
+
description: 'List recent replay attempts for a team.',
|
|
65
|
+
inputSchema: {
|
|
66
|
+
type: 'object',
|
|
67
|
+
properties: {
|
|
68
|
+
team_id: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
description: 'The team ID',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
required: ['team_id'],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Handle replay tool calls
|
|
80
|
+
*/
|
|
81
|
+
export async function handleReplayTool(client, name, args) {
|
|
82
|
+
switch (name) {
|
|
83
|
+
case 'dump_replay_request': {
|
|
84
|
+
const teamId = args.team_id;
|
|
85
|
+
const endpointId = args.endpoint_id;
|
|
86
|
+
const requestId = args.request_id;
|
|
87
|
+
const targetUrl = args.target_url;
|
|
88
|
+
if (!teamId)
|
|
89
|
+
throw new Error('team_id is required');
|
|
90
|
+
if (!endpointId)
|
|
91
|
+
throw new Error('endpoint_id is required');
|
|
92
|
+
if (!requestId)
|
|
93
|
+
throw new Error('request_id is required');
|
|
94
|
+
if (!targetUrl)
|
|
95
|
+
throw new Error('target_url is required');
|
|
96
|
+
const params = { target_url: targetUrl };
|
|
97
|
+
if (args.modify_headers) {
|
|
98
|
+
params.modify_headers = args.modify_headers;
|
|
99
|
+
}
|
|
100
|
+
if (args.modify_body) {
|
|
101
|
+
params.modify_body = args.modify_body;
|
|
102
|
+
}
|
|
103
|
+
const replay = await client.replayRequest(teamId, endpointId, requestId, params);
|
|
104
|
+
return {
|
|
105
|
+
replay: {
|
|
106
|
+
id: replay.id,
|
|
107
|
+
request_id: replay.request_id,
|
|
108
|
+
target_url: replay.target_url,
|
|
109
|
+
status: replay.status,
|
|
110
|
+
response_status: replay.response_status,
|
|
111
|
+
response_time_ms: replay.response_time_ms,
|
|
112
|
+
error_message: replay.error_message,
|
|
113
|
+
created_at: replay.created_at,
|
|
114
|
+
completed_at: replay.completed_at,
|
|
115
|
+
},
|
|
116
|
+
message: replay.status === 'success'
|
|
117
|
+
? `Replay successful - target returned HTTP ${replay.response_status}`
|
|
118
|
+
: replay.status === 'failed'
|
|
119
|
+
? `Replay failed: ${replay.error_message}`
|
|
120
|
+
: 'Replay pending',
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
case 'dump_get_replay_result': {
|
|
124
|
+
const teamId = args.team_id;
|
|
125
|
+
const replayId = args.replay_id;
|
|
126
|
+
if (!teamId)
|
|
127
|
+
throw new Error('team_id is required');
|
|
128
|
+
if (!replayId)
|
|
129
|
+
throw new Error('replay_id is required');
|
|
130
|
+
const replay = await client.getReplay(teamId, replayId);
|
|
131
|
+
return {
|
|
132
|
+
replay: {
|
|
133
|
+
id: replay.id,
|
|
134
|
+
request_id: replay.request_id,
|
|
135
|
+
target_url: replay.target_url,
|
|
136
|
+
status: replay.status,
|
|
137
|
+
response_status: replay.response_status,
|
|
138
|
+
response_headers: replay.response_headers,
|
|
139
|
+
response_body_preview: replay.response_body_preview,
|
|
140
|
+
response_time_ms: replay.response_time_ms,
|
|
141
|
+
error_message: replay.error_message,
|
|
142
|
+
created_at: replay.created_at,
|
|
143
|
+
completed_at: replay.completed_at,
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
case 'dump_list_replays': {
|
|
148
|
+
const teamId = args.team_id;
|
|
149
|
+
if (!teamId)
|
|
150
|
+
throw new Error('team_id is required');
|
|
151
|
+
const replays = await client.listReplays(teamId);
|
|
152
|
+
return {
|
|
153
|
+
replays: replays.map((r) => ({
|
|
154
|
+
id: r.id,
|
|
155
|
+
request_id: r.request_id,
|
|
156
|
+
target_url: r.target_url,
|
|
157
|
+
status: r.status,
|
|
158
|
+
response_status: r.response_status,
|
|
159
|
+
response_time_ms: r.response_time_ms,
|
|
160
|
+
error_message: r.error_message,
|
|
161
|
+
created_at: r.created_at,
|
|
162
|
+
})),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
default:
|
|
166
|
+
throw new Error(`Unknown replay tool: ${name}`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=replay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.js","sourceRoot":"","sources":["../../src/tools/replay.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL;YACE,IAAI,EAAE,qBAAqB;YAC3B,WAAW,EAAE,2GAA2G;YACxH,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,OAAO,EAAE;wBACP,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,aAAa;qBAC3B;oBACD,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,iBAAiB;qBAC/B;oBACD,UAAU,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,0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AAC,qBAAqB,CAAC,CAAC;YAEpD,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAEjD,OAAO;gBACL,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBAC3B,EAAE,EAAE,CAAC,CAAC,EAAE;oBACR,UAAU,EAAE,CAAC,CAAC,UAAU;oBACxB,UAAU,EAAE,CAAC,CAAC,UAAU;oBACxB,MAAM,EAAE,CAAC,CAAC,MAAM;oBAChB,eAAe,EAAE,CAAC,CAAC,eAAe;oBAClC,gBAAgB,EAAE,CAAC,CAAC,gBAAgB;oBACpC,aAAa,EAAE,CAAC,CAAC,aAAa;oBAC9B,UAAU,EAAE,CAAC,CAAC,UAAU;iBACzB,CAAC,CAAC;aACJ,CAAC;QACJ,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request viewing tools for dump-mcp
|
|
3
|
+
*/
|
|
4
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
import { DumpApiClient } from '../api-client.js';
|
|
6
|
+
/**
|
|
7
|
+
* Register request-related tools
|
|
8
|
+
*/
|
|
9
|
+
export declare function registerRequestTools(): Tool[];
|
|
10
|
+
/**
|
|
11
|
+
* Handle request tool calls
|
|
12
|
+
*/
|
|
13
|
+
export declare function handleRequestTool(client: DumpApiClient, name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
14
|
+
//# sourceMappingURL=requests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../src/tools/requests.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,EAAE,CAmE7C;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,OAAO,CAAC,CA0ElB"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request viewing tools for dump-mcp
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Register request-related tools
|
|
6
|
+
*/
|
|
7
|
+
export function registerRequestTools() {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
name: 'dump_list_requests',
|
|
11
|
+
description: 'List captured webhook requests for an endpoint. Returns request summaries with IDs for fetching full details.',
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
team_id: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
description: 'The team ID',
|
|
18
|
+
},
|
|
19
|
+
endpoint_id: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'The endpoint ID to list requests for',
|
|
22
|
+
},
|
|
23
|
+
page: {
|
|
24
|
+
type: 'number',
|
|
25
|
+
description: 'Page number (default: 1)',
|
|
26
|
+
},
|
|
27
|
+
per_page: {
|
|
28
|
+
type: 'number',
|
|
29
|
+
description: 'Results per page, max 100 (default: 20)',
|
|
30
|
+
},
|
|
31
|
+
method: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
description: 'Filter by HTTP method (GET, POST, PUT, DELETE, etc.)',
|
|
34
|
+
},
|
|
35
|
+
search: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
description: 'Search in request path and body',
|
|
38
|
+
},
|
|
39
|
+
since: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
description: 'Filter requests after this ISO timestamp',
|
|
42
|
+
},
|
|
43
|
+
until: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'Filter requests before this ISO timestamp',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
required: ['team_id', 'endpoint_id'],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'dump_get_request',
|
|
53
|
+
description: 'Get full details of a captured request including headers and body.',
|
|
54
|
+
inputSchema: {
|
|
55
|
+
type: 'object',
|
|
56
|
+
properties: {
|
|
57
|
+
team_id: {
|
|
58
|
+
type: 'string',
|
|
59
|
+
description: 'The team ID',
|
|
60
|
+
},
|
|
61
|
+
endpoint_id: {
|
|
62
|
+
type: 'string',
|
|
63
|
+
description: 'The endpoint ID',
|
|
64
|
+
},
|
|
65
|
+
request_id: {
|
|
66
|
+
type: 'string',
|
|
67
|
+
description: 'The request ID',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
required: ['team_id', 'endpoint_id', 'request_id'],
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Handle request tool calls
|
|
77
|
+
*/
|
|
78
|
+
export async function handleRequestTool(client, name, args) {
|
|
79
|
+
switch (name) {
|
|
80
|
+
case 'dump_list_requests': {
|
|
81
|
+
const teamId = args.team_id;
|
|
82
|
+
const endpointId = args.endpoint_id;
|
|
83
|
+
if (!teamId)
|
|
84
|
+
throw new Error('team_id is required');
|
|
85
|
+
if (!endpointId)
|
|
86
|
+
throw new Error('endpoint_id is required');
|
|
87
|
+
const params = {};
|
|
88
|
+
if (args.page)
|
|
89
|
+
params.page = args.page;
|
|
90
|
+
if (args.per_page)
|
|
91
|
+
params.per_page = Math.min(args.per_page, 100);
|
|
92
|
+
if (args.method)
|
|
93
|
+
params.method = args.method;
|
|
94
|
+
if (args.search)
|
|
95
|
+
params.search = args.search;
|
|
96
|
+
if (args.since)
|
|
97
|
+
params.since = args.since;
|
|
98
|
+
if (args.until)
|
|
99
|
+
params.until = args.until;
|
|
100
|
+
const result = await client.listRequests(teamId, endpointId, params);
|
|
101
|
+
return {
|
|
102
|
+
requests: result.data.map((r) => ({
|
|
103
|
+
id: r.id,
|
|
104
|
+
method: r.method,
|
|
105
|
+
path: r.path,
|
|
106
|
+
query_string: r.query_string,
|
|
107
|
+
content_type: r.content_type,
|
|
108
|
+
body_size: r.body_size,
|
|
109
|
+
body_preview: r.body_preview,
|
|
110
|
+
received_at: r.received_at,
|
|
111
|
+
status: r.status,
|
|
112
|
+
})),
|
|
113
|
+
pagination: result.pagination,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
case 'dump_get_request': {
|
|
117
|
+
const teamId = args.team_id;
|
|
118
|
+
const endpointId = args.endpoint_id;
|
|
119
|
+
const requestId = args.request_id;
|
|
120
|
+
if (!teamId)
|
|
121
|
+
throw new Error('team_id is required');
|
|
122
|
+
if (!endpointId)
|
|
123
|
+
throw new Error('endpoint_id is required');
|
|
124
|
+
if (!requestId)
|
|
125
|
+
throw new Error('request_id is required');
|
|
126
|
+
const request = await client.getRequest(teamId, endpointId, requestId);
|
|
127
|
+
// Get the full payload if available
|
|
128
|
+
let body = request.body;
|
|
129
|
+
if (!body && request.status === 'active') {
|
|
130
|
+
try {
|
|
131
|
+
body = await client.getRequestPayload(teamId, endpointId, requestId);
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
// Payload might not be available
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
request: {
|
|
139
|
+
id: request.id,
|
|
140
|
+
method: request.method,
|
|
141
|
+
path: request.path,
|
|
142
|
+
query_string: request.query_string,
|
|
143
|
+
headers: request.headers,
|
|
144
|
+
body: body || request.body_preview,
|
|
145
|
+
body_size: request.body_size,
|
|
146
|
+
content_type: request.content_type,
|
|
147
|
+
ip_address: request.ip_address,
|
|
148
|
+
received_at: request.received_at,
|
|
149
|
+
status: request.status,
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
default:
|
|
154
|
+
throw new Error(`Unknown request tool: ${name}`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=requests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../../src/tools/requests.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO;QACL;YACE,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EAAE,+GAA+G;YAC5H,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,OAAO,EAAE;wBACP,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,aAAa;qBAC3B;oBACD,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,sCAAsC;qBACpD;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,0BAA0B;qBACxC;oBACD,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,yCAAyC;qBACvD;oBACD,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,sDAAsD;qBACpE;oBACD,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,iCAAiC;qBAC/C;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,0CAA0C;qBACxD;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,2CAA2C;qBACzD;iBACF;gBACD,QAAQ,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC;aACrC;SACF;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,WAAW,EAAE,oEAAoE;YACjF,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;o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