rusackas commented on code in PR #43637:
URL: https://github.com/apache/superset/pull/43637#discussion_r3878266731
##########
docs/admin_docs/configuration/mcp-server.mdx:
##########
@@ -253,6 +253,49 @@ def my_custom_auth_factory(app):
MCP_AUTH_FACTORY = my_custom_auth_factory
```
+### Embedded Guest Authentication
+
+Superset's [embedded dashboards](/user-docs/using-superset/embedding) feature
mints short-lived **guest tokens** for anonymous/embedded viewers. The MCP
server can accept these same guest tokens, so an embedded guest (e.g. an in-app
chatbot next to an embedded dashboard) can call MCP tools scoped to the
dashboards/resources named in its token.
+
+This is opt-in and reuses the existing core guest-token configuration -- there
is no MCP-specific guest secret or audience.
+
+```python
+# superset_config.py
+FEATURE_FLAGS = {"EMBEDDED_SUPERSET": True} # required -- guest tokens only
exist when this is on
+MCP_EMBEDDED_GUEST_AUTH_ENABLED = True # opt-in for the MCP transport
(default False)
+```
+
+Present the guest token the same way as any other bearer token:
+
+```bash
+curl -X POST http://localhost:5008/mcp \
+ -H 'Content-Type: application/json' \
+ -H 'Authorization: Bearer YOUR_GUEST_TOKEN' \
+ -d '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}'
+```
+
+**How it works**
+
+- A dedicated guest-token verifier validates the token against the same
`GUEST_TOKEN_JWT_SECRET` / `GUEST_TOKEN_JWT_ALGO` / `GUEST_TOKEN_JWT_AUDIENCE`
config used by embedded dashboards, replays the embedded structural checks, and
enforces revocation (global version bumps and per-dashboard
`guest_token_revoked_before` cutoffs). It runs *before* the JWT verifier
described above, since guest tokens are signed with a different key/algorithm
and would otherwise be rejected at the transport.
+- A verified guest resolves to a Superset guest user as the highest-priority
identity, so it's never downgraded to API-key / `MCP_DEV_USERNAME` / dev-mode
resolution. Data access is scoped by the same checks (dataset allowlist,
dashboard access, row-level security) that apply to embedded dashboard views.
+- Sensitive enumeration tools (`find_users`, `get_instance_info` by default)
are hidden and denied to guests via `MCP_GUEST_DENIED_TOOLS`, regardless of
`MCP_RBAC_ENABLED`.
+
+```python
+# superset_config.py
+MCP_GUEST_DENIED_TOOLS = {"find_users", "get_instance_info"} # default
Review Comment:
Good catch — swapped the doc's `MCP_GUEST_DENIED_TOOLS` for the actual
`MCP_GUEST_ALLOWED_TOOLS` allow-list, since that's what governs guest tool
access.
--
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]