Repository navigation
|
I created a FastMCP server and was able to connect to it with Cursor without issue. However, now I am trying to add OAuth authentication and am getting stuck. I have setup the Auth0 application correctly as I can login to it from any other OAuth tester, like Postman or Bruno. I need help either configuring the FastMCP code or Cursor. My issue is that Cursor says that all MCP servers need to use the callback of: "cursor://anysphere.cursor-mcp/oauth/callback" but the FastMCP documentation says my callback should be: "http://localhost:8080/auth/callback". Which is correct? I have added both to my Auth0 application as allowed callbacks. FastMCP allows me to override the path of the callback, but not the entire URL. So I am a little confused as to the workflow for a proper Authorization Code Flow when using FastMCP and Cursor as they seem like they are fighting over the callback URI. |
Replies: 1 comment 1 reply
|
Three OAuth parties, not two. Cursor hits FastMCP |
After 17 hours of debugging through the FastMCP source code, I found my issue.
When using Auth0 as the IdP, you MUST set these extra arguments in the
OAuthProxy:extra_authorize_paramsto include theaudienceextra_token_paramsto include theaudienceI discovered this information in the comments of the fastmcp source file:
fastmcp/server/auth/oauth_proxy/proxy.pywhich specifically talk about Auth0.