diff --git a/src/client/auth.test.ts b/src/client/auth.test.ts index 846ba35c2..a7be57f1a 100644 --- a/src/client/auth.test.ts +++ b/src/client/auth.test.ts @@ -887,7 +887,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 d5d39cad4..6cdfd71fa 100644 --- a/src/client/auth.ts +++ b/src/client/auth.ts @@ -735,7 +735,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);