Skip to content

Commit 3981c29

Browse files
committed
docs: Updated cursor_rules.md and README.md to explain cost vs. visibility trade-offs
- Removed statements in cursor_rules.md that guided to use bulk actions (preferring transparency and less waiting over cost) - Updated README.md with a new section on Cursor Rules for AI Guidance, explaining how to modify if cost is a concern
1 parent 302c6de commit 3981c29

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,39 @@ The following examples can be used for `~/.cursor/mcp.json` (global) or `.cursor
278278
```
279279
*Note: For these `uv` examples, `/absolute/path/to/your/project/with/uv/venv` must be the correct absolute path to your project where `cursor-notebook-mcp` is installed within its `uv`-managed environment. The `--allow-root` path for notebooks should also be an absolute path for clarity and reliability. You can add other `cursor-notebook-mcp` arguments (like `--log-level DEBUG` or `--port 8889`) to the end of the `args` list for `cursor-notebook-mcp` or `python -m cursor_notebook_mcp.server` as needed.*
280280

281+
## Cursor Rules for AI Guidance
282+
283+
The package includes a `cursor_rules.md` file that helps calibrate the agent's behavior when working with Jupyter notebooks through the MCP server. These rules ensure consistent and clean notebook actions by providing guidelines for markdown formatting, tool usage, path resolution, and more.
284+
285+
### Default Behavior: Visibility and Feedback
286+
287+
By default, the rules are optimized for visibility into the AI's actions as it constructs or modifies notebooks. The AI will tend to use individual tool calls for operations like adding cells, which means you can see the notebook being built cell by cell. This provides good feedback and allows you to intervene quickly if needed. However, this approach results in more tool calls, which can impact costs when using paid AI services.
288+
289+
### Configuring Rules in Cursor
290+
291+
To use the cursor rules:
292+
293+
1. Open Cursor
294+
2. Go to Cursor > Settings > Cursor Settings
295+
3. Click on "Rules" in the sidebar
296+
4. You can either:
297+
* Click "Add new rule" under "Project Rules" to apply the rules only to the current project
298+
* Add to "User Rules" to apply them globally
299+
300+
### Optional: Cost-Efficient Mode
301+
302+
If you're more concerned about cost-effectiveness and don't mind waiting to see results, you can add the following section to the rules:
303+
304+
```markdown
305+
8. **Efficiency Mode (Cost Optimization):**
306+
* Minimize tool calls as they incur API costs.
307+
* Use `notebook_bulk_add_cells` instead of multiple `notebook_add_cell` calls when adding multiple cells.
308+
* Use `notebook_read` to get the full notebook state instead of reading individual cells.
309+
* Only use `notebook_read_cell` when you need to verify a specific cell's content.
310+
* Batch related changes together when possible.
311+
* Skip verification reads if the operation is simple and unlikely to fail.
312+
```
313+
281314
## Editing Remote Notebooks via SFTP/SSH
282315
283316
This server supports accessing and editing Jupyter notebooks stored on remote servers via SFTP (SSH File Transfer Protocol). This allows you to work on notebooks as if they were local, provided you have SSH access to the remote machine and SFTP is enabled on it.

cursor_rules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
2. **Tool Usage:**
1010
* Always use `notebook_mcp` tools for `.ipynb` files, never `edit_file`.
11-
* Verify changes after making them with `notebook_read_cell` or `notebook_read` (be efficient with tool calls).
11+
* Verify changes after making them with `notebook_read_cell` or `notebook_read`.
1212

1313
3. **Path Resolution for Notebooks:**
1414
* **Initial Step:** At the beginning of notebook operations, or if path ambiguity exists, call `notebook_get_server_path_context` (providing the current `project_directory`).
@@ -31,7 +31,7 @@
3131
* **Path & Server Context**: `notebook_get_server_path_context`
3232
* **Navigation & Discovery**: `notebook_get_outline`, `notebook_search`, `notebook_get_info`, `notebook_get_cell_count`
3333
* **File Operations**: `notebook_create`, `notebook_delete`, `notebook_rename`, `notebook_read`, `notebook_export`
34-
* **Cell Operations**: `notebook_read_cell`, `notebook_add_cell`, `notebook_edit_cell`, `notebook_delete_cell`, `notebook_bulk_add_cells` (use bulk add when you need to add multiple cells at once)
34+
* **Cell Operations**: `notebook_read_cell`, `notebook_add_cell`, `notebook_edit_cell`, `notebook_delete_cell`, `notebook_bulk_add_cells`
3535
* **Cell Transformations**: `notebook_change_cell_type`, `notebook_move_cell`, `notebook_split_cell`, `notebook_merge_cells`, `notebook_duplicate_cell`
3636
* **Metadata & Output**: `notebook_read_metadata`, `notebook_edit_metadata`, `notebook_read_cell_metadata`, `notebook_edit_cell_metadata`, `notebook_read_cell_output`, `notebook_edit_cell_output`, `notebook_clear_cell_outputs`, `notebook_clear_all_outputs`
3737
* **Validation**: `notebook_validate`

0 commit comments

Comments
 (0)