This commit is contained in:
bipproduction
2025-10-27 02:01:13 +08:00
parent 599dfe3f99
commit df6df16885

View File

@@ -17,7 +17,7 @@ function createStream(handler: (controller: ReadableStreamDefaultController) =>
} finally {
try {
controller.close();
} catch {}
} catch { }
}
},
cancel() {
@@ -30,6 +30,21 @@ export const MCPRoute = new Elysia({
prefix: "/mcp",
tags: ["mcp"],
})
.get("/", ({ set }) => {
set.headers["Content-Type"] = "application/json; charset=utf-8";
return {
jsonrpc: "2.0",
id: 1,
result: {
protocol: "2024-11-05",
capabilities: {
"tools/list": true,
"tools/call": true,
},
status: "MCP Server Ready",
},
};
})
/**
* ✅ GET /mcp/:id — streaming response untuk n8n + curl
*/