-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Hi 👋
I have a Fastify server for my web platform. Inside the same server, I want to add an MCP server, but under the /mcp path. I also need to handle OAuth myself.
However, if I enable OAuth with this plugin, it seems to automatically protect all routes, and not only /mcp ?
I.e. with the plugin auth enabled, I cannot access my normal routes anymore since they start returning this instead:
{"error":"authorization_required","error_description":"Authorization header required"}
I tried of course to register the plugin under a prefix. But MCP clients expect auth routes to sit at root level.
Additionally, I believe this kind of functionality will be needed if the server should both act as the MCP server, and the OAuth server.
Cause right now, this path /oauth2/authorize will be under protection, meaning the browser cannot open it.
Thanks for the help!