bito-code-review[bot] commented on code in PR #44146:
URL: https://github.com/apache/superset/pull/44146#discussion_r4054035028
##########
superset/core/mcp/core_mcp_injection.py:
##########
@@ -210,7 +210,10 @@ def decorator(func: F) -> F:
if protect:
from superset.mcp_service.auth import mcp_auth_hook
- wrapped_func = mcp_auth_hook(func)
+ # Pass the registered (extension-prefixed) name so call-time
+ # checks keyed on tool identity cannot be confused by an
+ # extension tool that shares a base name with a host tool.
+ wrapped_func = mcp_auth_hook(func, tool_name=tool_name)
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Extension tools blocked under dataset scope</b></div>
<div id="fix">
Passing the extension-prefixed name makes `enforce_call_dataset_scope`
refuse every extension tool when `MCP_DATASET_ROLE_ALLOWLIST` is configured:
prefixed names like `extensions.pub.ext.query_dataset` never match the bare
names in `SCOPED_TOOLS` (`dataset_scope.py:74`), so
`MCPDatasetScopeError(UNSUPPORTED_TOOL_ERROR)` raises for all extension tools,
not just host-name collisions. Consider passing `tool_name` only when
`context_type == "host"`, or normalizing the prefix in `dataset_scope.py`.
</div>
</div>
<small><i>Code Review Run #5d8d6b</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]