This commit is contained in:
Timothy Jaeryang Baek
2026-01-08 03:37:11 +04:00
parent a9a979fb3d
commit 9b06fdc8fe
2 changed files with 118 additions and 78 deletions

View File

@@ -93,7 +93,7 @@ from open_webui.utils.misc import (
convert_logit_bias_input_to_json,
get_content_from_message,
)
from open_webui.utils.tools import get_tools, get_updated_tool_function
from open_webui.utils.tools import get_tools, get_updated_tool_function, has_tool_server_access
from open_webui.utils.plugin import load_function_module_by_id
from open_webui.utils.filter import (
get_sorted_filter_ids,
@@ -1663,6 +1663,11 @@ async def process_chat_payload(request, form_data, user, metadata, model):
log.error(f"MCP server with id {server_id} not found")
continue
# Check access control for MCP server
if not has_tool_server_access(user, mcp_server_connection):
log.warning(f"Access denied to MCP server {server_id} for user {user.id}")
continue
auth_type = mcp_server_connection.get("auth_type", "")
headers = {}
if auth_type == "bearer":