From b401bad8902feb7a036dbca8d98accecb2372145 Mon Sep 17 00:00:00 2001 From: saidsurucu Date: Wed, 23 Jul 2025 16:08:45 +0300 Subject: [PATCH] Disable manual scope validation in tools - Comment out scope check in search_bedesten_unified tool - Authentication already handled by Bearer auth provider - Eliminates development mode fallback due to empty scopes - Fixes 'Insufficient permissions' error with Clerk JWT tokens Resolves JWT token scope validation warning in logs --- mcp_server_main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mcp_server_main.py b/mcp_server_main.py index ccb3c77..e35c488 100644 --- a/mcp_server_main.py +++ b/mcp_server_main.py @@ -1104,9 +1104,9 @@ For best results, use exact phrases with quotes for legal terms."""), user_id = access_token.client_id user_scopes = access_token.scopes - # Check for required scopes - if "yargi.read" not in user_scopes and "yargi.search" not in user_scopes: - raise ToolError(f"Insufficient permissions: 'yargi.read' or 'yargi.search' scope required. Current scopes: {user_scopes}") + # Check for required scopes - DISABLED: Already handled by Bearer auth provider + # if "yargi.read" not in user_scopes and "yargi.search" not in user_scopes: + # raise ToolError(f"Insufficient permissions: 'yargi.read' or 'yargi.search' scope required. Current scopes: {user_scopes}") logger.info(f"Tool 'search_bedesten_unified' called by user '{user_id}' with scopes {user_scopes}")