diff --git a/src/client/auth.test.ts b/src/client/auth.test.ts index c38f1933..f2dadbb1 100644 --- a/src/client/auth.test.ts +++ b/src/client/auth.test.ts @@ -863,7 +863,8 @@ describe('OAuth Authorization', () => { const calls = mockFetch.mock.calls; const [, options] = calls[0]; expect(options.headers).toEqual({ - 'MCP-Protocol-Version': '2025-01-01' + 'MCP-Protocol-Version': '2025-01-01', + Accept: 'application/json' }); }); diff --git a/src/client/auth.ts b/src/client/auth.ts index 3c04f7cb..1e90f34b 100644 --- a/src/client/auth.ts +++ b/src/client/auth.ts @@ -738,7 +738,10 @@ export async function discoverAuthorizationServerMetadata( protocolVersion?: string; } = {} ): Promise { - const headers = { 'MCP-Protocol-Version': protocolVersion }; + const headers = { + 'MCP-Protocol-Version': protocolVersion, + Accept: 'application/json' + }; // Get the list of URLs to try const urlsToTry = buildDiscoveryUrls(authorizationServerUrl);