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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

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 () => {