Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/_static/docs-mcp-server.mp4
Binary file not shown.
3 changes: 2 additions & 1 deletion docs/guides/editor_features/ai_completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ into your notebook.

The chat panel currently supports the following modes:

- **Ask**: Enables read-only [AI tools](tools.md) and [tools from added MCP Client servers](mcp.md#mcp-client) for context gathering, allowing the assistant to inspect your notebooks
- **Manual**: No tool access; the AI responds based only on the conversation and manually injected context
- **Ask**: Enables read-only [AI tools](tools.md) and [tools from added MCP Client servers](mcp.md#mcp-client) for context gathering, allowing the assistant to inspect your notebooks
- **Agent** (beta): Enables all tools in **Ask Mode** plus additional tools to [edit notebook cells (add, remove, update) and run stale cells](tools.md#editing-agent-mode-only).

??? tip "See the chat panel in action"

Expand Down
4 changes: 4 additions & 0 deletions docs/guides/editor_features/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ marimo edit notebook.py --mcp --no-token

marimo can expose its [AI tools](tools.md) through an MCP server endpoint, allowing external AI applications to interact with your notebooks.

<video autoplay loop muted playsinline width="100%" height="100%" align="center">
<source src="/_static/docs-mcp-server.mp4" type="video/mp4">
</video>

### Available tools

When connected to marimo's MCP server, external applications can access all [AI tools](tools.md).
Expand Down
14 changes: 13 additions & 1 deletion docs/guides/editor_features/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ These tools are available when using the [chat panel in ask mode](ai_completion.
| **get_active_notebooks** | List all currently active marimo notebooks. Returns summary statistics and notebook details including names, paths, and session IDs. Start here to discover which notebooks are available. |
| **get_lightweight_cell_map** | Get an overview of notebook structure showing a preview of each cell. Takes a `session_id` and optional `preview_lines` parameter. Returns cell IDs, preview text, line counts, and cell types (code, markdown, SQL). |
| **get_cell_runtime_data** | Get detailed runtime information for a specific cell. Takes `session_id` and `cell_id` parameters. Returns full cell code, error details, runtime metadata (execution time, runtime state), and variables defined by the cell. |
| **get_cell_outputs** | Get execution output from a specific cell. Takes `session_id` and `cell_id` parameters. Returns visual output (HTML, charts, tables, etc.) with mimetype, stdout messages, and stderr messages. |

### Data

Expand All @@ -31,14 +32,25 @@ These tools are available when using the [chat panel in ask mode](ai_completion.
| Tool | Description |
|------|-------------|
| **get_notebook_errors** | Get all errors in the notebook organized by cell. Takes `session_id` parameter. Returns error summary (total errors, affected cells) and per-cell error details (type, message, traceback). |
| **lint_notebook** | Get all marimo lint errors in the notebook. Returns lint errors as defined in the [lint rules documentation](../lint_rules/index.md). |

### Reference

| Tool | Description |
|------|-------------|
| **get_marimo_rules** | Get official marimo guidelines and best practices for AI assistants. Returns the content of the marimo rules file and source URL for understanding marimo-specific conventions. |

### Editing (Agent mode only)

!!! note "Availability"
These tools are only available when using the [chat panel in agent mode](ai_completion.md#chat-panel). They are not exposed through the [MCP server](mcp.md#mcp-server).

| Tool | Description |
|------|-------------|
| **edit_notebook** | Add, remove, or update cells in the notebook. Takes cell operations and modifications as parameters. Allows the AI agent to generate diffs that modify notebook structure and content. |
| **run_stale_cells** | Run cells that are stale (outdated due to upstream changes). Triggers execution of affected cells to update the notebook state. |

## Related documentation

- [Model Context Protocol (MCP)]() - Learn how to expose tools through the marimo MCP server
- [Model Context Protocol (MCP)](mcp.md) - Learn how to expose tools through the marimo MCP server
- [AI-assisted coding](ai_completion.md) - Learn about more AI coding features