Skip to content

Commit 836aa91

Browse files
committed
fix(mcp): reuse known-provider OAuth grants
1 parent 3bf8382 commit 836aa91

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • backend/onyx/server/features/mcp

backend/onyx/server/features/mcp/api.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,14 @@ async def _connect_oauth(
816816
"Known-provider OAuth mode requires a non-empty client_id",
817817
)
818818

819+
if credentials_usable and not request.force_reauthentication:
820+
return MCPUserOAuthConnectResponse(
821+
server_id=server_id,
822+
status="already_authenticated",
823+
authorization_url=None,
824+
redirect_url=request.return_path,
825+
)
826+
819827
oauth_result = start_known_provider_oauth_flow(
820828
mcp_server=mcp_server,
821829
user_id=str(user.id),

0 commit comments

Comments
 (0)