Skip to content

Commit abac48a

Browse files
committed
fix: Add Accept header to auth metadata request
1 parent c84ef24 commit abac48a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/client/auth.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,8 @@ describe('OAuth Authorization', () => {
863863
const calls = mockFetch.mock.calls;
864864
const [, options] = calls[0];
865865
expect(options.headers).toEqual({
866-
'MCP-Protocol-Version': '2025-01-01'
866+
'MCP-Protocol-Version': '2025-01-01',
867+
Accept: 'application/json'
867868
});
868869
});
869870

src/client/auth.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,10 @@ export async function discoverAuthorizationServerMetadata(
738738
protocolVersion?: string;
739739
} = {}
740740
): Promise<AuthorizationServerMetadata | undefined> {
741-
const headers = { 'MCP-Protocol-Version': protocolVersion };
741+
const headers = {
742+
'MCP-Protocol-Version': protocolVersion,
743+
Accept: 'application/json'
744+
};
742745

743746
// Get the list of URLs to try
744747
const urlsToTry = buildDiscoveryUrls(authorizationServerUrl);

0 commit comments

Comments
 (0)