> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/api-and-integrations/sdk-getting-started/sdk-api-reference/notebook-apps.md).

# Notebook apps

Notebook host for the platform's interactive app bundles. Requires the `jupyter` extra.

## McpGateway

Stateless JSON-RPC over HTTP against the platform's MCP endpoint.

### McpGateway.call

```python
McpGateway.call(method: str, params: Any = None) -> Any
```

*Undocumented; the signature above is the contract.*

### McpGateway.call\_tool

```python
McpGateway.call_tool(name: str, arguments: dict[str, Any]) -> Any
```

*Undocumented; the signature above is the contract.*

### McpGateway.app\_uri\_for

```python
McpGateway.app_uri_for(tool_name: str) -> str
```

*Undocumented; the signature above is the contract.*

### McpGateway.read\_bundle

```python
McpGateway.read_bundle(uri: str) -> str
```

*Undocumented; the signature above is the contract.*

## app

```python
app(
    tool: str,
    arguments: dict[str, Any] | None = None,
    *,
    theme: str = '',
    height: int = 480,
    transport: Transport | None = None,
    result: dict[str, Any] | None = None,
) -> Any
```

Run an MCP tool and render its interactive app under the cell.

The tool executes server-side with the session's credentials; its App bundle renders the result and any controls it carries (re-run scenario, expand table, approve graph change) round-trip live through the gateway.

| Parameter   | Type                     | Default  | Description                                                                                                                                                                              |
| ----------- | ------------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tool`      | `str`                    | required | MCP tool name, for example `query_causal_graph`.                                                                                                                                         |
| `arguments` | `dict[str, Any] \| None` | `None`   | The tool's arguments.                                                                                                                                                                    |
| `theme`     | `str`                    | `''`     | `light`, `dark`, or empty to follow the notebook.                                                                                                                                        |
| `height`    | `int`                    | `480`    | Height of the mounted app, in pixels.                                                                                                                                                    |
| `transport` | `Transport \| None`      | `None`   | Use a specific session instead of the module-level one.                                                                                                                                  |
| `result`    | `dict[str, Any] \| None` | `None`   | A pre-computed tool result to render instead of executing the tool — `{"content": [...], "structuredContent": {...}}`. The app's own controls still round-trip live through the gateway. |

**Returns** (`Any`): The widget, ready for a notebook cell to display. Requires the `jupyter` extra.
