Add new test to verify that when an Authorization header is provided (#3023)

This commit is contained in:
Gennadiy Civil
2025-07-07 12:34:16 -04:00
committed by GitHub
parent 17dfa267d5
commit aa8e5776eb

View File

@@ -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 () => { it('should prefix tool names if multiple MCP servers are configured', async () => {