You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This release enables remote notebook editing and updates transport handling. Key highlights for version 0.3.0 include:
- **Added SFTP Support**: Enables access and management of notebooks on remote SSH servers, with various authentication methods and new CLI arguments.
- **Enhanced Web Transport via FastMCP**: Updated FastMCP for robust stdio, Streamable HTTP (now recommended), and SSE transport, simplifying server logic.
- **New Notebook Tools**:
- `notebook_edit_cell_output`: Allows direct manipulation of cell outputs.
- `notebook_bulk_add_cells`: For adding multiple cells in one operation.
- `notebook_get_server_path_context`: Provides server path details for client-side path construction.
- **Changes & Fixes**:
- Simplified installation: `uvicorn` and `starlette` are now core dependencies.
- Removed custom SSE transport implementation and `validate_imports` tool.
- Improved Windows path handling and fixed web transport errors.
- Updated `README.md` with new transport instructions and known issues #1, #3.
Resolves#2Resolves#4Resolves#5
For a comprehensive list of changes, please see `CHANGELOG.md`.
### Jupyter Notebook Rules for Cursor (Using notebook_mcp):
2
+
3
+
1.**IMPORTANT - Markdown Formatting:**
4
+
* When creating or editing markdown cells, use **actual newlines** for paragraph breaks, not literal `\n\n` strings.
5
+
* CORRECT: `"## Title\n\nThis is a paragraph."`
6
+
* INCORRECT: `"## Title\\n\\nThis is a paragraph."`
7
+
* After editing cells, always use `notebook_read_cell` to verify proper formatting.
8
+
9
+
2.**Tool Usage:**
10
+
* 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).
12
+
13
+
3.**Path Resolution for Notebooks:**
14
+
***Initial Step:** At the beginning of notebook operations, or if path ambiguity exists, call `notebook_get_server_path_context` (providing the current `project_directory`).
15
+
* Use its output (`allowed_roots`, `server_path_style`, `project_directory_status`, `effective_notebook_base_path_for_project`, `path_construction_guidance`) to determine how to construct `notebook_path` arguments for all other notebook tools.
16
+
***Goal:** For unqualified notebook names (e.g., `my_notebook.ipynb`), the `notebook_path` sent to tools should correctly target the user's current project directory by leveraging the `effective_notebook_base_path_for_project` (e.g., `project_name/my_notebook.ipynb`).
17
+
* If the `project_directory_status` is `outside_allowed_roots` or `resolution_error`, inform the user and proceed with caution, relying on their explicit path guidance or warning about potential issues.
18
+
* For explicit user-provided paths (e.g., `../another_project/data.ipynb` or absolute paths), use them as given, but warn if they appear to be outside the server's `allowed_roots` based on the context tool's output.
19
+
* The server ultimately resolves paths relative to its configured `allowed_root`(s). The context tool helps align client-side path construction with server-side expectations.
20
+
21
+
4.**Character Escaping:**
22
+
* For LaTeX: Use single backslashes (e.g., `\alpha`, not `\\alpha`).
23
+
* For newlines: Use actual newlines in the string, not escaped `\\n`.
24
+
* For display math: Use `$$..$$` not `\\[..\]`.
25
+
26
+
5.**Investigation Before Editing:**
27
+
* Use `notebook_get_outline` and `notebook_search` first to understand notebook structure.
28
+
* Read existing cells with `notebook_read_cell` before modifying them.
29
+
30
+
6.**Available Tools by Category:**
31
+
***Path & Server Context**: `notebook_get_server_path_context`
***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)
Copy file name to clipboardExpand all lines: CHANGELOG.md
+37-41Lines changed: 37 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,42 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [0.3.0] - 2025-05-20
9
+
10
+
### Added
11
+
-**SFTP Support for Remote Notebooks**: Added SFTP integration for accessing and managing notebooks on remote SSH servers (resolves [issue #2](https://github.com/jbeno/cursor-notebook-mcp/issues/2)).
- Supports various SSH authentication methods including password, public key (with passphrase), SSH agent, and interactive (2FA).
14
+
- Transparently handles file operations on remote SFTP paths.
15
+
- Automatic tilde (`~`) expansion for remote paths.
16
+
-**Enhanced Web Transport with FastMCP (v2.3.4+):**
17
+
- Integrated `FastMCP`'s `run()` method for robust handling of all transport modes (`stdio`, `streamable-http`, `sse`).
18
+
-`--transport streamable-http`: Now uses `FastMCP`'s built-in Streamable HTTP, becoming the **recommended web transport**.
19
+
-`--transport sse`: Now uses `FastMCP`'s built-in (but deprecated by FastMCP) two-endpoint SSE for legacy compatibility.
20
+
- New tool: `notebook_edit_cell_output` to allow direct manipulation and setting of cell outputs.
21
+
- New tool: `notebook_bulk_add_cells` for adding multiple cells to a notebook in a single operation.
22
+
- New tool: `notebook_get_server_path_context` to provide detailed server path configuration for robust client path construction.
23
+
- Added PowerShell script `run_tests.ps1` for test execution on Windows.
24
+
- Added `examples/demo_tools_list.py` script, demonstrating client-side MCP handshake and `tools/list` request (part of resolving [issue #5](https://github.com/jbeno/cursor-notebook-mcp/issues/5)).
25
+
26
+
### Changed
27
+
-**Refactored Server Logic**: Server now leverages `FastMCP`'s internal `run()` method for all transport modes, simplifying logic and improving reliability.
28
+
- Improved path handling for Windows-style paths and URL-encoded components (related to [issue #4](https://github.com/jbeno/cursor-notebook-mcp/issues/4)).
29
+
- Updated `README.md` with detailed instructions for all transport modes, `mcp.json` configurations, and refined transport recommendations. Added known issues for [issue #1](https://github.com/jbeno/cursor-notebook-mcp/issues/1) and [issue #3](https://github.com/jbeno/cursor-notebook-mcp/issues/3).
30
+
- Updated `examples/demo_tools_list.py` script to demonstrate client-side MCP handshake and `tools/list` request.
31
+
- Refined `cursor_rules.md` for clarity and to reflect new tool capabilities.
32
+
-**Simplified Installation**: `uvicorn` and `starlette` are now core dependencies. Optional extras `[http]` and `[sse]` removed. All transports supported by default install.
33
+
- Command-line `--transport` choices are now `stdio`, `streamable-http`, and `sse`.
- Custom SSE transport implementation (`cursor_notebook_mcp/sse_transport.py`), now handled by `FastMCP`.
38
+
- Removed `validate_imports` tool, which, along with `tools/list` availability and updated documentation, resolves [issue #5](https://github.com/jbeno/cursor-notebook-mcp/issues/5).
39
+
40
+
### Fixed
41
+
- HTTP 405 errors and client fallback issues for web transports by adopting `FastMCP`'s implementations.
42
+
- Addressed issues with Windows path interpretation (resolves [issue #4](https://github.com/jbeno/cursor-notebook-mcp/issues/4)).
43
+
8
44
## [0.2.4] - 2025-04-26
9
45
10
46
### Added
@@ -13,7 +49,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
49
- The `notebook_get_outline` method analyzes a Jupyter notebook's structure, extracting cell types, line counts, and outlines for code and markdown cells.
14
50
- The `notebook_search` method allows for case-insensitive searching within notebook cells, returning matches with context snippets.
15
51
- Added dedicated tests for error paths and edge cases in the NotebookTools module, focusing on improving code coverage.
16
-
- Added tests for handling issues with `diagnose_imports`, including subprocess errors and malformed JSON.
17
52
- Added validation tests for notebooks addressing invalid JSON and non-notebook files.
18
53
- Added tests for outline extraction with invalid code syntax.
19
54
- Added tests for empty search queries and behavior of large file truncation.
@@ -42,43 +77,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
42
77
- Removed invalid comments from JSON examples.
43
78
- Explicitly documented external system requirements (Pandoc, LaTeX) for PDF export.
44
79
- Updated project metadata (`classifiers`, `keywords`, `urls`) in `pyproject.toml`.
45
-
- Configured `pytest` via `pyproject.toml` to set environment variables (`JUPYTER_PLATFORM_DIRS`).
46
-
- Refactored `sse_transport.py` to separate app creation (`create_starlette_app`) for better testability.
47
-
48
-
### Fixed
49
-
- Bug in `notebook_read` size estimation loop (`NameError: name 'i' is not defined`).
50
-
- Multiple test failures related to incorrect mocking, error expectations, path handling, test setup, and imports (`StringIO`, `FastMCP`).
51
-
- Invalid escape sequence in `pyproject.toml` coverage exclusion pattern.
52
-
- Several issues in SSE transport (`sse_transport.py`) related to refactoring, including incorrect `SseServerTransport` initialization, missing `/messages` route handling, and incorrect parameters passed to the underlying `mcp.server.Server.run` method, causing connection failures.
53
-
- GitHub Actions CI workflow failure (exit code 127) by switching dependency installation from `uv` to standard `pip` to ensure `pytest` is found.
54
-
- Hanging test (`test_sse_route_connection` in `tests/test_sse_transport.py`) by refactoring to call the handler directly with a mock request instead of using `TestClient`.
55
-
- CI test failure (`test_read_large_notebook_truncated`) by enabling Git LFS (`lfs: true`) in the `actions/checkout` step to correctly download large fixture files.
56
-
57
-
## [0.2.2] - 2025-04-19
58
-
59
-
### Fixed
60
-
- Suppressed noisy `traitlets` validation errors (`Notebook JSON is invalid: Additional properties are not allowed ('id' was unexpected)`) by adding a specific logging filter in `server.py` instead of changing the global logger level. This prevents valid `ERROR` messages from `traitlets` from being hidden.
61
-
62
-
### Added
63
-
-`CHANGELOG.md` file to track project changes.
64
-
- "Suggested Cursor Rules" section to `README.md` explaining best practices for using the MCP server with Cursor's AI, formatted as a copy-pasteable markdown block.
65
-
66
-
## [0.2.1] - 2025-04-18
67
-
68
-
### Added
69
-
- Initial release of the Jupyter Notebook MCP Server.
70
-
- Core functionality for manipulating Jupyter Notebook (`.ipynb`) files via MCP tools.
71
-
- Support for both `stdio` and `sse` transport modes.
72
-
- Command-line arguments for configuration (allowed roots, logging, transport, etc.).
0 commit comments