We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 662aa87 commit 00789acCopy full SHA for 00789ac
2 files changed
packages/mcp-server/src/headers.ts
@@ -15,7 +15,9 @@ export const parseAuthHeaders = (req: IncomingMessage): Partial<ClientOptions> =
15
password: rawValue.slice(rawValue.search(':') + 1),
16
};
17
default:
18
- throw new Error(`Unsupported authorization scheme`);
+ throw new Error(
19
+ 'Unsupported authorization scheme. Expected the "Authorization" header to be a supported scheme (Basic).',
20
+ );
21
}
22
23
packages/mcp-server/src/http.ts
@@ -46,12 +46,12 @@ const newServer = ({
46
},
47
mcpOptions,
48
});
49
- } catch {
+ } catch (error) {
50
res.status(401).json({
51
jsonrpc: '2.0',
52
error: {
53
code: -32000,
54
- message: 'Unauthorized',
+ message: `Unauthorized: ${error instanceof Error ? error.message : error}`,
55
56
57
return null;
0 commit comments