Skip to content

Conversation

@Lazysusan01
Copy link
Contributor

Issue with the validation in jupyter_mcp_server/server.py
@mcp.tool()
async def insert_execute_code_cell(
cell_index: Annotated[int, Field(description="Index of the cell to insert and execute (0-based)", ge=0)]

This prevents the index from being set to -1 , which appends the cell to the bottom of the notebook.
-Changed ge=0 to ge=-1.
-Added unit test for appending code cell in test_tools .py

-Mispelling of health api endpoint (was healthz)

-Added handling of Plotly json data output if the cell is executing plotly code.

Lazysusan01 and others added 4 commits November 18, 2025 20:00
- Update `extract_output` in `utils.py` to detect and serialize Plotly data structures into formatted JSON strings.
- Filter out non-standard `transient` fields from execution outputs to improve `nbformat` schema compliance.
- Change health check route from `/api/healthz` to `/api/health` in `server.py`.
- Add debug logging for output data keys to assist with visualization detection.
Updated cell_index parameter to allow -1 as a valid index.
Added test for appending code cell to notebook.
@echarles echarles self-requested a review November 26, 2025 13:17
@echarles echarles added bug Something isn't working enhancement New feature or request labels Nov 26, 2025
@echarles
Copy link
Member

change to health seem to impact the tests (not sure though... mcp server seem to not start or not being ack via health)

-------------------------------- live log setup --------------------------------
INFO     root:conftest.py:49 Jupyter MCP: starting ...
ERROR    root:conftest.py:81 Jupyter MCP [15519]: fail to start after retries. Check if port 49208 is available.
ERROR                                                                    [ [52](https://github.com/datalayer/jupyter-mcp-server/actions/runs/19703963154/job/56450352785?pr=174#step:5:53)%]
tests/test_tools.py::test_mcp_health[no_runtime]

@Lazysusan01
Copy link
Contributor Author

It looks like there are some other areas using the healthz endpoint, should have checked, my fault.

@Lazysusan01 Lazysusan01 marked this pull request as draft November 26, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants