keryx 0.12.4 → 0.13.1
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/initializers/mcp.ts +7 -1
- package/package.json +1 -1
- package/util/webResponse.ts +4 -0
package/initializers/mcp.ts
CHANGED
|
@@ -382,7 +382,13 @@ function createMcpServer(): McpServer {
|
|
|
382
382
|
|
|
383
383
|
const clientIp = (authInfo?.extra?.ip as string) || "unknown";
|
|
384
384
|
const mcpSessionId = extra.sessionId || "";
|
|
385
|
-
const connection = new Connection(
|
|
385
|
+
const connection = new Connection(
|
|
386
|
+
"mcp",
|
|
387
|
+
clientIp,
|
|
388
|
+
randomUUID(),
|
|
389
|
+
undefined,
|
|
390
|
+
authInfo?.token,
|
|
391
|
+
);
|
|
386
392
|
|
|
387
393
|
try {
|
|
388
394
|
// If Bearer token was verified, set up authenticated session
|
package/package.json
CHANGED
package/util/webResponse.ts
CHANGED
|
@@ -77,6 +77,10 @@ export function buildResponse(
|
|
|
77
77
|
status = 200,
|
|
78
78
|
requestOrigin?: string,
|
|
79
79
|
) {
|
|
80
|
+
if (response instanceof Response) {
|
|
81
|
+
return response;
|
|
82
|
+
}
|
|
83
|
+
|
|
80
84
|
return new Response(JSON.stringify(response, null, 2) + EOL, {
|
|
81
85
|
status,
|
|
82
86
|
headers: buildHeaders(connection, requestOrigin),
|