xcrawl-mcp 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.
- package/.editorconfig +12 -0
- package/.env.example +3 -0
- package/.prettierrc +6 -0
- package/README.md +244 -0
- package/claude.md +295 -0
- package/dist/core/crawl.d.ts +246 -0
- package/dist/core/crawl.d.ts.map +1 -0
- package/dist/core/crawl.js +141 -0
- package/dist/core/crawl.js.map +1 -0
- package/dist/core/map.d.ts +34 -0
- package/dist/core/map.d.ts.map +1 -0
- package/dist/core/map.js +50 -0
- package/dist/core/map.js.map +1 -0
- package/dist/core/scrape.d.ts +201 -0
- package/dist/core/scrape.d.ts.map +1 -0
- package/dist/core/scrape.js +148 -0
- package/dist/core/scrape.js.map +1 -0
- package/dist/core/search.d.ts +144 -0
- package/dist/core/search.d.ts.map +1 -0
- package/dist/core/search.js +75 -0
- package/dist/core/search.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +516 -0
- package/dist/index.js.map +1 -0
- package/dist/stdio.d.ts +3 -0
- package/dist/stdio.d.ts.map +1 -0
- package/dist/stdio.js +551 -0
- package/dist/stdio.js.map +1 -0
- package/dist/tools.d.ts +540 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +528 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +214 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +33 -0
- package/src/core/crawl.ts +149 -0
- package/src/core/map.ts +56 -0
- package/src/core/scrape.ts +156 -0
- package/src/core/search.ts +81 -0
- package/src/index.ts +565 -0
- package/src/stdio.ts +584 -0
- package/src/tools.ts +539 -0
- package/src/types.ts +221 -0
- package/tsconfig.build.json +14 -0
- package/tsconfig.json +45 -0
- package/vitest.config.mts +11 -0
- package/worker-configuration.d.ts +10848 -0
- package/wrangler.jsonc +26 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
3
|
+
import { callXCrawlAPI, checkScrapeStatus, formatScrapeResponse, scrapeToolSchema } from "./core/scrape.js";
|
|
4
|
+
import { callXCrawlSearchAPI, formatSearchResponse, searchToolSchema } from "./core/search.js";
|
|
5
|
+
import { callXCrawlMapAPI, formatMapResponse, mapToolSchema } from "./core/map.js";
|
|
6
|
+
import { callXCrawlCrawlAPI, checkCrawlStatus, formatCrawlResponse, crawlToolSchema } from "./core/crawl.js";
|
|
7
|
+
import { XCRAWL_SCRAPE_TOOL, XCRAWL_CHECK_STATUS_TOOL, XCRAWL_SEARCH_TOOL, XCRAWL_MAP_TOOL, XCRAWL_CRAWL_TOOL, XCRAWL_CHECK_CRAWL_STATUS_TOOL, } from "./tools.js";
|
|
8
|
+
/**
|
|
9
|
+
* Extract API key from request headers
|
|
10
|
+
*/
|
|
11
|
+
function extractApiKey(request) {
|
|
12
|
+
const authHeader = request.headers.get("Authorization");
|
|
13
|
+
if (authHeader?.startsWith("Bearer ")) {
|
|
14
|
+
return authHeader.slice(7);
|
|
15
|
+
}
|
|
16
|
+
return request.headers.get("x-api-key") || request.headers.get("x-xcrawl-api-key") || undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Create MCP server instance
|
|
20
|
+
*/
|
|
21
|
+
function createMCPServer(apiKey) {
|
|
22
|
+
const server = new Server({
|
|
23
|
+
name: "xCrawl MCP Server",
|
|
24
|
+
version: "1.0.0",
|
|
25
|
+
}, {
|
|
26
|
+
capabilities: {
|
|
27
|
+
tools: {},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
// Register tools/list handler
|
|
31
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
32
|
+
tools: [
|
|
33
|
+
XCRAWL_SCRAPE_TOOL,
|
|
34
|
+
XCRAWL_CHECK_STATUS_TOOL,
|
|
35
|
+
XCRAWL_SEARCH_TOOL,
|
|
36
|
+
XCRAWL_MAP_TOOL,
|
|
37
|
+
XCRAWL_CRAWL_TOOL,
|
|
38
|
+
XCRAWL_CHECK_CRAWL_STATUS_TOOL,
|
|
39
|
+
],
|
|
40
|
+
}));
|
|
41
|
+
// Register tools/call handler
|
|
42
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
43
|
+
if (request.params.name === "xcrawl_scrape") {
|
|
44
|
+
try {
|
|
45
|
+
const validatedArgs = scrapeToolSchema.parse(request.params.arguments);
|
|
46
|
+
const response = await callXCrawlAPI(apiKey, validatedArgs);
|
|
47
|
+
return {
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: "text",
|
|
51
|
+
text: formatScrapeResponse(response),
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
58
|
+
return {
|
|
59
|
+
content: [
|
|
60
|
+
{
|
|
61
|
+
type: "text",
|
|
62
|
+
text: `Error: ${errorMessage}`,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
isError: true,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (request.params.name === "xcrawl_check_status") {
|
|
70
|
+
try {
|
|
71
|
+
const args = request.params.arguments;
|
|
72
|
+
if (!args.scrape_id || typeof args.scrape_id !== "string") {
|
|
73
|
+
throw new Error("scrape_id is required and must be a string");
|
|
74
|
+
}
|
|
75
|
+
const response = await checkScrapeStatus(apiKey, args.scrape_id);
|
|
76
|
+
return {
|
|
77
|
+
content: [
|
|
78
|
+
{
|
|
79
|
+
type: "text",
|
|
80
|
+
text: formatScrapeResponse(response),
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
87
|
+
return {
|
|
88
|
+
content: [
|
|
89
|
+
{
|
|
90
|
+
type: "text",
|
|
91
|
+
text: `Error: ${errorMessage}`,
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
isError: true,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (request.params.name === "xcrawl_search") {
|
|
99
|
+
try {
|
|
100
|
+
const validatedArgs = searchToolSchema.parse(request.params.arguments);
|
|
101
|
+
const response = await callXCrawlSearchAPI(apiKey, validatedArgs);
|
|
102
|
+
return {
|
|
103
|
+
content: [
|
|
104
|
+
{
|
|
105
|
+
type: "text",
|
|
106
|
+
text: formatSearchResponse(response),
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
113
|
+
return {
|
|
114
|
+
content: [
|
|
115
|
+
{
|
|
116
|
+
type: "text",
|
|
117
|
+
text: `Error: ${errorMessage}`,
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
isError: true,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (request.params.name === "xcrawl_map") {
|
|
125
|
+
try {
|
|
126
|
+
const validatedArgs = mapToolSchema.parse(request.params.arguments);
|
|
127
|
+
const response = await callXCrawlMapAPI(apiKey, validatedArgs);
|
|
128
|
+
return {
|
|
129
|
+
content: [
|
|
130
|
+
{
|
|
131
|
+
type: "text",
|
|
132
|
+
text: formatMapResponse(response),
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
139
|
+
return {
|
|
140
|
+
content: [
|
|
141
|
+
{
|
|
142
|
+
type: "text",
|
|
143
|
+
text: `Error: ${errorMessage}`,
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
isError: true,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (request.params.name === "xcrawl_crawl") {
|
|
151
|
+
try {
|
|
152
|
+
const validatedArgs = crawlToolSchema.parse(request.params.arguments);
|
|
153
|
+
const response = await callXCrawlCrawlAPI(apiKey, validatedArgs);
|
|
154
|
+
return {
|
|
155
|
+
content: [
|
|
156
|
+
{
|
|
157
|
+
type: "text",
|
|
158
|
+
text: formatCrawlResponse(response),
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
165
|
+
return {
|
|
166
|
+
content: [
|
|
167
|
+
{
|
|
168
|
+
type: "text",
|
|
169
|
+
text: `Error: ${errorMessage}`,
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
isError: true,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (request.params.name === "xcrawl_check_crawl_status") {
|
|
177
|
+
try {
|
|
178
|
+
const args = request.params.arguments;
|
|
179
|
+
if (!args.crawl_id || typeof args.crawl_id !== "string") {
|
|
180
|
+
throw new Error("crawl_id is required and must be a string");
|
|
181
|
+
}
|
|
182
|
+
const response = await checkCrawlStatus(apiKey, args.crawl_id);
|
|
183
|
+
return {
|
|
184
|
+
content: [
|
|
185
|
+
{
|
|
186
|
+
type: "text",
|
|
187
|
+
text: formatCrawlResponse(response),
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
194
|
+
return {
|
|
195
|
+
content: [
|
|
196
|
+
{
|
|
197
|
+
type: "text",
|
|
198
|
+
text: `Error: ${errorMessage}`,
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
isError: true,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
throw new Error(`Unknown tool: ${request.params.name}`);
|
|
206
|
+
});
|
|
207
|
+
return server;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Cloudflare Workers fetch handler
|
|
211
|
+
*/
|
|
212
|
+
export default {
|
|
213
|
+
async fetch(request, env, ctx) {
|
|
214
|
+
const url = new URL(request.url);
|
|
215
|
+
// Health check endpoint
|
|
216
|
+
if (url.pathname === "/health") {
|
|
217
|
+
return new Response("OK", { status: 200 });
|
|
218
|
+
}
|
|
219
|
+
// Extract API key from request headers only
|
|
220
|
+
const apiKey = extractApiKey(request);
|
|
221
|
+
if (!apiKey) {
|
|
222
|
+
return new Response(JSON.stringify({
|
|
223
|
+
error: "API key required",
|
|
224
|
+
message: "Please provide xCrawl API key via one of these headers:\n- Authorization: Bearer <your-api-key>\n- x-api-key: <your-api-key>\n- x-xcrawl-api-key: <your-api-key>",
|
|
225
|
+
}), {
|
|
226
|
+
status: 401,
|
|
227
|
+
headers: { "Content-Type": "application/json" },
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
// SSE endpoint
|
|
231
|
+
if (url.pathname === "/sse" || url.pathname.startsWith("/sse/")) {
|
|
232
|
+
// SSE transport requires streaming support which is complex in Workers
|
|
233
|
+
// For now, return a message directing to use stdio mode
|
|
234
|
+
return new Response(JSON.stringify({
|
|
235
|
+
message: "SSE endpoint not yet implemented in Workers mode. Please use stdio mode for local development.",
|
|
236
|
+
}), {
|
|
237
|
+
status: 501,
|
|
238
|
+
headers: { "Content-Type": "application/json" },
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
// MCP endpoint (streamable HTTP / JSON-RPC)
|
|
242
|
+
if (url.pathname === "/mcp") {
|
|
243
|
+
try {
|
|
244
|
+
// Parse JSON-RPC request
|
|
245
|
+
const body = (await request.json());
|
|
246
|
+
const { jsonrpc, id, method, params } = body;
|
|
247
|
+
// Validate JSON-RPC format
|
|
248
|
+
if (jsonrpc !== "2.0") {
|
|
249
|
+
return new Response(JSON.stringify({
|
|
250
|
+
jsonrpc: "2.0",
|
|
251
|
+
id: id || null,
|
|
252
|
+
error: { code: -32600, message: "Invalid Request - jsonrpc must be '2.0'" },
|
|
253
|
+
}), {
|
|
254
|
+
status: 400,
|
|
255
|
+
headers: { "Content-Type": "application/json" },
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
let result;
|
|
259
|
+
// Handle initialize
|
|
260
|
+
if (method === "initialize") {
|
|
261
|
+
result = {
|
|
262
|
+
protocolVersion: "2024-11-05",
|
|
263
|
+
capabilities: {
|
|
264
|
+
tools: {},
|
|
265
|
+
},
|
|
266
|
+
serverInfo: {
|
|
267
|
+
name: "xCrawl MCP Server",
|
|
268
|
+
version: "1.0.0",
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
// Handle notifications/initialized (no response needed for notifications)
|
|
273
|
+
else if (method === "notifications/initialized") {
|
|
274
|
+
// This is a notification, return empty success response
|
|
275
|
+
return new Response(JSON.stringify({
|
|
276
|
+
jsonrpc: "2.0",
|
|
277
|
+
id,
|
|
278
|
+
result: {},
|
|
279
|
+
}), {
|
|
280
|
+
status: 200,
|
|
281
|
+
headers: { "Content-Type": "application/json" },
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
// Handle tools/list
|
|
285
|
+
else if (method === "tools/list") {
|
|
286
|
+
result = {
|
|
287
|
+
tools: [
|
|
288
|
+
XCRAWL_SCRAPE_TOOL,
|
|
289
|
+
XCRAWL_CHECK_STATUS_TOOL,
|
|
290
|
+
XCRAWL_SEARCH_TOOL,
|
|
291
|
+
XCRAWL_MAP_TOOL,
|
|
292
|
+
XCRAWL_CRAWL_TOOL,
|
|
293
|
+
XCRAWL_CHECK_CRAWL_STATUS_TOOL,
|
|
294
|
+
],
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
// Handle tools/call
|
|
298
|
+
else if (method === "tools/call") {
|
|
299
|
+
const toolName = params?.name;
|
|
300
|
+
const toolArgs = params?.arguments || {};
|
|
301
|
+
if (toolName === "xcrawl_scrape") {
|
|
302
|
+
try {
|
|
303
|
+
const validatedArgs = scrapeToolSchema.parse(toolArgs);
|
|
304
|
+
const response = await callXCrawlAPI(apiKey, validatedArgs);
|
|
305
|
+
result = {
|
|
306
|
+
content: [
|
|
307
|
+
{
|
|
308
|
+
type: "text",
|
|
309
|
+
text: formatScrapeResponse(response),
|
|
310
|
+
},
|
|
311
|
+
],
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
catch (error) {
|
|
315
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
316
|
+
result = {
|
|
317
|
+
content: [
|
|
318
|
+
{
|
|
319
|
+
type: "text",
|
|
320
|
+
text: `Error: ${errorMessage}`,
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
isError: true,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
else if (toolName === "xcrawl_check_status") {
|
|
328
|
+
try {
|
|
329
|
+
const scrapeId = toolArgs.scrape_id;
|
|
330
|
+
if (!scrapeId || typeof scrapeId !== "string") {
|
|
331
|
+
throw new Error("scrape_id is required and must be a string");
|
|
332
|
+
}
|
|
333
|
+
const response = await checkScrapeStatus(apiKey, scrapeId);
|
|
334
|
+
result = {
|
|
335
|
+
content: [
|
|
336
|
+
{
|
|
337
|
+
type: "text",
|
|
338
|
+
text: formatScrapeResponse(response),
|
|
339
|
+
},
|
|
340
|
+
],
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
catch (error) {
|
|
344
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
345
|
+
result = {
|
|
346
|
+
content: [
|
|
347
|
+
{
|
|
348
|
+
type: "text",
|
|
349
|
+
text: `Error: ${errorMessage}`,
|
|
350
|
+
},
|
|
351
|
+
],
|
|
352
|
+
isError: true,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
else if (toolName === "xcrawl_search") {
|
|
357
|
+
try {
|
|
358
|
+
const validatedArgs = searchToolSchema.parse(toolArgs);
|
|
359
|
+
const response = await callXCrawlSearchAPI(apiKey, validatedArgs);
|
|
360
|
+
result = {
|
|
361
|
+
content: [
|
|
362
|
+
{
|
|
363
|
+
type: "text",
|
|
364
|
+
text: formatSearchResponse(response),
|
|
365
|
+
},
|
|
366
|
+
],
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
371
|
+
result = {
|
|
372
|
+
content: [
|
|
373
|
+
{
|
|
374
|
+
type: "text",
|
|
375
|
+
text: `Error: ${errorMessage}`,
|
|
376
|
+
},
|
|
377
|
+
],
|
|
378
|
+
isError: true,
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
else if (toolName === "xcrawl_map") {
|
|
383
|
+
try {
|
|
384
|
+
const validatedArgs = mapToolSchema.parse(toolArgs);
|
|
385
|
+
const response = await callXCrawlMapAPI(apiKey, validatedArgs);
|
|
386
|
+
result = {
|
|
387
|
+
content: [
|
|
388
|
+
{
|
|
389
|
+
type: "text",
|
|
390
|
+
text: formatMapResponse(response),
|
|
391
|
+
},
|
|
392
|
+
],
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
catch (error) {
|
|
396
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
397
|
+
result = {
|
|
398
|
+
content: [
|
|
399
|
+
{
|
|
400
|
+
type: "text",
|
|
401
|
+
text: `Error: ${errorMessage}`,
|
|
402
|
+
},
|
|
403
|
+
],
|
|
404
|
+
isError: true,
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
else if (toolName === "xcrawl_crawl") {
|
|
409
|
+
try {
|
|
410
|
+
const validatedArgs = crawlToolSchema.parse(toolArgs);
|
|
411
|
+
const response = await callXCrawlCrawlAPI(apiKey, validatedArgs);
|
|
412
|
+
result = {
|
|
413
|
+
content: [
|
|
414
|
+
{
|
|
415
|
+
type: "text",
|
|
416
|
+
text: formatCrawlResponse(response),
|
|
417
|
+
},
|
|
418
|
+
],
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
catch (error) {
|
|
422
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
423
|
+
result = {
|
|
424
|
+
content: [
|
|
425
|
+
{
|
|
426
|
+
type: "text",
|
|
427
|
+
text: `Error: ${errorMessage}`,
|
|
428
|
+
},
|
|
429
|
+
],
|
|
430
|
+
isError: true,
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
else if (toolName === "xcrawl_check_crawl_status") {
|
|
435
|
+
try {
|
|
436
|
+
const crawlId = toolArgs.crawl_id;
|
|
437
|
+
if (!crawlId || typeof crawlId !== "string") {
|
|
438
|
+
throw new Error("crawl_id is required and must be a string");
|
|
439
|
+
}
|
|
440
|
+
const response = await checkCrawlStatus(apiKey, crawlId);
|
|
441
|
+
result = {
|
|
442
|
+
content: [
|
|
443
|
+
{
|
|
444
|
+
type: "text",
|
|
445
|
+
text: formatCrawlResponse(response),
|
|
446
|
+
},
|
|
447
|
+
],
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
catch (error) {
|
|
451
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
452
|
+
result = {
|
|
453
|
+
content: [
|
|
454
|
+
{
|
|
455
|
+
type: "text",
|
|
456
|
+
text: `Error: ${errorMessage}`,
|
|
457
|
+
},
|
|
458
|
+
],
|
|
459
|
+
isError: true,
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
return new Response(JSON.stringify({
|
|
465
|
+
jsonrpc: "2.0",
|
|
466
|
+
id,
|
|
467
|
+
error: { code: -32601, message: `Unknown tool: ${toolName}` },
|
|
468
|
+
}), {
|
|
469
|
+
status: 404,
|
|
470
|
+
headers: { "Content-Type": "application/json" },
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
// Method not found
|
|
475
|
+
else {
|
|
476
|
+
return new Response(JSON.stringify({
|
|
477
|
+
jsonrpc: "2.0",
|
|
478
|
+
id,
|
|
479
|
+
error: { code: -32601, message: `Method not found: ${method}` },
|
|
480
|
+
}), {
|
|
481
|
+
status: 404,
|
|
482
|
+
headers: { "Content-Type": "application/json" },
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
return new Response(JSON.stringify({
|
|
486
|
+
jsonrpc: "2.0",
|
|
487
|
+
id,
|
|
488
|
+
result,
|
|
489
|
+
}), {
|
|
490
|
+
status: 200,
|
|
491
|
+
headers: { "Content-Type": "application/json" },
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
catch (error) {
|
|
495
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
496
|
+
return new Response(JSON.stringify({
|
|
497
|
+
jsonrpc: "2.0",
|
|
498
|
+
id: null,
|
|
499
|
+
error: { code: -32700, message: `Parse error: ${errorMessage}` },
|
|
500
|
+
}), {
|
|
501
|
+
status: 400,
|
|
502
|
+
headers: { "Content-Type": "application/json" },
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
// Default 404 response
|
|
507
|
+
return new Response(JSON.stringify({
|
|
508
|
+
error: "Not found",
|
|
509
|
+
message: "Available endpoints: /mcp, /sse, /health",
|
|
510
|
+
}), {
|
|
511
|
+
status: 404,
|
|
512
|
+
headers: { "Content-Type": "application/json" },
|
|
513
|
+
});
|
|
514
|
+
},
|
|
515
|
+
};
|
|
516
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAC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