From aa8e5776eb491dffa4e539afdc75798bfc4a904d Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Mon, 7 Jul 2025 12:34:16 -0400 Subject: [PATCH] Add new test to verify that when an Authorization header is provided (#3023) --- packages/core/src/tools/mcp-client.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/core/src/tools/mcp-client.test.ts b/packages/core/src/tools/mcp-client.test.ts index aec9f0d7..09f7951b 100644 --- a/packages/core/src/tools/mcp-client.test.ts +++ b/packages/core/src/tools/mcp-client.test.ts @@ -385,6 +385,18 @@ describe('discoverMcpTools', () => { {}, ); }); + + it('should pass oauth token when provided', async () => { + const headers = { + Authorization: 'Bearer test-token', + }; + const { serverConfig } = await setupHttpTest(headers); + + expect(StreamableHTTPClientTransport).toHaveBeenCalledWith( + new URL(serverConfig.httpUrl!), + { requestInit: { headers } }, + ); + }); }); it('should prefix tool names if multiple MCP servers are configured', async () => {