diff --git a/src/gateway/mcp-http.test.ts b/src/gateway/mcp-http.test.ts index b053f507c24..b4606c9404c 100644 --- a/src/gateway/mcp-http.test.ts +++ b/src/gateway/mcp-http.test.ts @@ -43,7 +43,7 @@ const resolveGatewayScopedToolsMock = vi.hoisted(() => })), ); -vi.mock("../config/config.js", () => ({ +vi.mock("../config/io.js", () => ({ getRuntimeConfig: () => ({ session: { mainKey: "main" } }), })); @@ -452,6 +452,7 @@ describe("mcp loopback server", () => { params: { body: "hello" }, ctx: expect.objectContaining({ agentId: "main", + config: { session: { mainKey: "main" } }, sessionKey: "agent:main:main", }), signal: expect.any(AbortSignal), diff --git a/src/gateway/mcp-http.ts b/src/gateway/mcp-http.ts index d2cc9900931..4d6220d617d 100644 --- a/src/gateway/mcp-http.ts +++ b/src/gateway/mcp-http.ts @@ -132,6 +132,7 @@ export async function startMcpLoopbackServer(port = 0): Promise<{ toolSchema: scopedTools.toolSchema, hookContext: { agentId: scopedTools.agentId, + config: cfg, sessionKey: requestContext.sessionKey, }, signal: requestAbort.signal,