Skip to content

Commit 390b01b

Browse files
committed
fix: Add Accept header to auth metadata request
1 parent e0de082 commit 390b01b

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
@@ -887,7 +887,8 @@ describe('OAuth Authorization', () => {
887887
const calls = mockFetch.mock.calls;
888888
const [, options] = calls[0];
889889
expect(options.headers).toEqual({
890-
'MCP-Protocol-Version': '2025-01-01'
890+
'MCP-Protocol-Version': '2025-01-01',
891+
Accept: 'application/json'
891892
});
892893
});
893894

src/client/auth.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,10 @@ export async function discoverAuthorizationServerMetadata(
735735
protocolVersion?: string;
736736
} = {}
737737
): Promise<AuthorizationServerMetadata | undefined> {
738-
const headers = { 'MCP-Protocol-Version': protocolVersion };
738+
const headers = {
739+
'MCP-Protocol-Version': protocolVersion,
740+
Accept: 'application/json'
741+
};
739742

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

0 commit comments

Comments
 (0)