aminghadersohi commented on code in PR #44146:
URL: https://github.com/apache/superset/pull/44146#discussion_r4043353175


##########
docs/admin_docs/configuration/mcp-server.mdx:
##########
@@ -1074,3 +1074,68 @@ once, even when multiple dimensions are missing.
 The tool does not rewrite dots into SQL path separators: quoting and 
nested-field
 support depend on the dataset's database dialect, and dots can also be literal
 characters in column names.
+
+## Dataset discovery and routing
+
+`list_datasets` searches table name, **description**, schema, and SQL using
+escaped, case-insensitive substring matching. Write descriptions with business
+terminology to make differently named datasets discoverable. A complete UUID
+passed as `search` is treated as an exact UUID filter; an explicit `uuid` 
filter
+can also look up one or more datasets by UUID. Matching
+datasets are candidates, ordered by the requested sort (last modified by 
default), not
+ranked recommendations. Compare descriptions and metrics, present alternatives
+when ambiguous, and clarify before querying. No matches does not prove that 
data
+does not exist; search only covers accessible datasets and the configured 
scope.
+
+`query_dataset` returns `dataset_id` and `dataset_name`; `get_table` 
additionally
+returns `source` and the corresponding dataset or external-view identity. Cite
+these fields in answers rather than guessing the source from the query text.
+Neither tool selects an alternative dataset automatically.
+
+### Optional per-role dataset scope
+
+Set `MCP_DATASET_ROLE_ALLOWLIST` in `superset_config.py` to constrain MCP to a
+curated set of registered datasets:
+
+```python
+MCP_DATASET_ROLE_ALLOWLIST = {
+    "Finance Readers": ["00000000-0000-0000-0000-000000000001"],
+    "Operations Readers": ["00000000-0000-0000-0000-000000000002"],
+}
+```
+
+Obtain dataset UUIDs from `get_dataset_info` (or request `uuid` in
+`list_datasets.select_columns`). Use UUIDs, not names or numeric IDs, in 
config.
+Effective roles, including group roles, contribute the **union** of their 
lists.
+That union is **intersected with existing dataset access**. Unconfigured roles
+contribute nothing; Admin has no routing exemption. `None` (the default) 
disables
+this feature; `{}` allows no datasets. Invalid entries cause a configuration
+error at startup rather than silently disabling the restriction.
+
+Scoped mode supports the dataset tools that name a registered dataset —
+`list_datasets`, `get_dataset_info`, `query_dataset`, and, with a built-in
+dataset, `get_table`, `list_metrics`, `get_compatible_dimensions` and
+`get_compatible_metrics` — plus `health_check` and `get_schema`.
+Discovery filters before counting and pagination. Other tools refuse in this

Review Comment:
   Good catch — you're right, and the doc was overclaiming. Scope enforcement 
lives inside `mcp_auth_hook`, so `generate_bug_report` (`protect=False`, the 
sole entry in `ALLOWED_UNPROTECTED`) never reaches it.
   
   Fixed in a0f7522 by scoping the statement to auth-wrapped tools *and* naming 
the exception explicitly, so an operator reading the list knows why that one 
still answers (diagnostics need to survive broken auth; it reads no dataset 
rows). Also left a matching note on `SCOPED_TOOLS` in `dataset_scope.py` so a 
future unprotected tool that *can* reach dataset data gets a second look.
   
   Added `test_public_tools_are_documented_as_exempt_from_the_scope`, which 
pins `ALLOWED_UNPROTECTED` to exactly `{generate_bug_report}` — if someone adds 
another public tool, that test fails and the docs claim gets revisited rather 
than quietly going stale.



-- 
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]

Reply via email to