From b6b1140a2177c48443f8fa94c0d951f31d293b08 Mon Sep 17 00:00:00 2001 From: Novice Date: Wed, 15 Oct 2025 15:31:30 +0800 Subject: [PATCH] fix: handle authorization field --- api/services/tools/mcp_tools_manage_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/services/tools/mcp_tools_manage_service.py b/api/services/tools/mcp_tools_manage_service.py index 89a454fae3..18f4c9250e 100644 --- a/api/services/tools/mcp_tools_manage_service.py +++ b/api/services/tools/mcp_tools_manage_service.py @@ -99,7 +99,7 @@ class MCPToolManageService: # Encrypt sensitive data encrypted_server_url = encrypter.encrypt_token(tenant_id, server_url) encrypted_headers = self._prepare_encrypted_dict(headers, tenant_id) if headers else None - if authentication is not None: + if authentication is not None and authentication.client_id and authentication.client_secret: # Build the full credentials structure with encrypted client_id and client_secret encrypted_credentials = self._build_and_encrypt_credentials( authentication.client_id, authentication.client_secret, tenant_id @@ -194,7 +194,7 @@ class MCPToolManageService: mcp_provider.encrypted_headers = None # Update credentials if provided - if authentication is not None: + if authentication is not None and authentication.client_id and authentication.client_secret: # Merge with existing credentials to handle masked values ( final_client_id,