-
-
Notifications
You must be signed in to change notification settings - Fork 1
Bug: MCP dispatch fallback doesn't forward user role for RBAC filtering #2629
Copy link
Copy link
Closed
Labels
Description
Problem
The _try_mcp_dispatch() function in chat_workflow/tool_handler.py (#2513) calls dispatcher.dispatch(tool_name, arguments) without passing the user's role. The RBAC filtering added in #2598 defaults role="user", so admin users can't access admin-only MCP tools (client_list, slowlog, etc.) through the chat dispatch path.
The user's role is available in the session/workflow context but isn't threaded through to the MCP dispatcher.
Fix
- Pass user role from the session context into
_try_mcp_dispatch() - Thread it through to
dispatcher.dispatch(tool_name, arguments, role=user_role) - Also pass to
_get_mcp_tools_prompt()in ChatAgent so admin users see admin tools in their prompt
Files Affected
autobot-backend/chat_workflow/tool_handler.py—_try_mcp_dispatch()and_dispatch_tool_call()autobot-backend/agents/chat_agent.py—_get_mcp_tools_prompt()andprocess_chat_message()
Discovered During
Review of #2596/#2598 implementation.
Impact
Medium — RBAC filtering works but admin users are incorrectly restricted to user-level tools.
Reactions are currently unavailable