Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ export function createMcpServer(auth: AuthSource): McpServer {
type: 'text' as const,
text:
'Not authenticated. Sign in via OAuth, or provide an API key via ' +
'?apiKey=YOUR_KEY query param, x-api-key header, or Authorization: Bearer am_... ' +
'x-api-key header or Authorization: Bearer am_... ' +
'Get an API key at https://console.agentmail.to.',
},
],
Expand Down Expand Up @@ -690,6 +690,9 @@ function sendOAuthChallenge(req: express.Request, res: express.Response) {
}

const authRouter: express.RequestHandler = async (req, res, next) => {
if (req.query.apiKey) {
console.warn('[telemetry] Legacy query-string API key auth used (sunset scheduled)')
}
const apiKey = extractApiKey(req)
if (apiKey) {
req.authSource = { kind: 'apiKey', apiKey }
Expand Down