Hi everyone,
I’m facing an authentication challenge with our MCP integration in Cursor and would appreciate your insights.
We have an MCP server built with FastAPI that exposes our “chat” tool via SSE. For our web UI (powered by NextAuth), we rely on Google authentication to ensure the proper username and email context. However, when it comes to the MCP connection from Cursor, the usual Google OAuth flow isn’t triggering, leaving us without an authenticated user context on the server.
In essence, while our MCP server expects Google OAuth credentials (either via an external flow or token injection), Cursor’s MCP client currently appears not to support custom auth headers, token injection, or automatic redirection to a Google login page. We’re exploring options like:
- Pre-authentication: Running a one-time OAuth flow externally to obtain a token (or refresh token) that the server can use for subsequent MCP requests.
- Proxy/Wrapper: Setting up a proxy that injects the necessary auth headers into the SSE connection from Cursor.
- Awaiting Native Support: Looking for future enhancements in Cursor that might allow for an integrated OAuth flow or custom header/token support.
Has anyone successfully tackled this issue or have recommendations on integrating Google authentication with MCP in Cursor? Any pointers on workarounds or upcoming features would be greatly appreciated.