Клиенту не найти, как войти
MCPS-AUTH-003Почему это важноСервер требует входа, но ни в ответе 401, ни по адресу well-known не говорит, где получить токен. Claude, ChatGPT и другие клиенты без ручной настройки не подключатся.
Как исправитьОпубликуйте метаданные защищённого ресурса OAuth (RFC 9728) и укажите их в заголовке WWW-Authenticate ответа 401.
res.status(401).set('WWW-Authenticate', 'Bearer resource_metadata="https://mcp.example.com/.well-known/oauth-protected-resource/mcp"').end()mcp = FastMCP('example', auth=AuthSettings(issuer_url='https://auth.example.com', resource_server_url='https://mcp.example.com/mcp'), token_verifier=verifier)- Запрос
POST https://mcp.guide.sonatype.com/mcp (initialize); GET /.well-known/oauth-protected-resource- Ответ
401- Что мы увидели
WWW-Authenticate: Bearer error="invalid_request", error_description="No Sonatype access token was supplied, so this MCP server is not authenticated. Add an 'Authorization: Bearer <your-token>' header to your MCP client configuration, using a token from your Sonatype account settings."
Видно в ответе сервера
СпецификацияMCP 2026-07-28, Authorization Server Discovery: Protected Resource Metadata Discovery RequirementsRFC 9728, Section 5.1