Skip to content

datarobot_genai.drmcpbase.panels.resources

resources

Panels exposed as read-only MCP resources.

The discovery/read surface for panels. URIs:

  • panels://{source} — list panels (metadata) in a source
  • panels://{source}/{panel_id} — a single panel's metadata
  • panels://{source}/{panel_id}/content — a panel's content (inline for Text/Json; a payload reference for Dataset/Chart)

All are read-only and gated on the per-user ENABLE_MCP_SANDBOX entitlement (enforced inside each handler). The handlers live here in drmcpbase so both DRMCP and global-mcp can register them onto their own FastMCP instance via :func:register_panel_resources.

register_panel_resources

register_panel_resources(mcp: Any) -> None

Register the panel resources onto mcp (a FastMCP instance).

Instance-passing rather than a module-global decorator: drmcpbase is a shared layer with no mcp singleton, so each server (DRMCP, global-mcp) calls this with its own instance. The handlers are registered unwrapped so FastMCP sees the real coroutine functions and awaits them.

Source code in datarobot_genai/drmcpbase/panels/resources.py
def register_panel_resources(mcp: Any) -> None:
    """Register the panel resources onto *mcp* (a FastMCP instance).

    Instance-passing rather than a module-global decorator: ``drmcpbase`` is a
    shared layer with no mcp singleton, so each server (DRMCP, global-mcp) calls
    this with its own instance. The handlers are registered unwrapped so FastMCP
    sees the real coroutine functions and awaits them.
    """
    for handler, init_args in _PANEL_RESOURCES:
        mcp.resource(**init_args)(handler)