Getting started#
Install#
Two packages, one per environment:
pip install nbclassic-mcp-bridge # in the Jupyter environment
pip install nbclassic-mcp-bridge-mcp # in the MCP client's environment
Installing the Jupyter-side package registers both the relay server extension and the frontend extension automatically — there is nothing to enable.
Register the MCP server#
Start the classic notebook and note the token it prints:
jupyter nbclassic
Any MCP client works: run the nbclassic-mcp-bridge command with JUPYTER_URL and
JUPYTER_TOKEN set. With Claude Code, for example:
claude mcp add nbclassic-mcp-bridge \
-e JUPYTER_URL=http://localhost:8888 \
-e JUPYTER_TOKEN=<token> \
-- nbclassic-mcp-bridge
Add -s user to register the server for every project. If nbclassic-mcp-bridge-mcp is installed
in a non-default environment, pass the absolute path of the executable in place of the trailing
nbclassic-mcp-bridge (find it with which nbclassic-mcp-bridge).
First session#
Open a notebook in the browser. From the assistant:
use_notebook()— with no arguments it finds the open notebook automatically;list_notebooksshows everything the server has open, and inexact paths resolve fuzzily.read_notebookfor an outline, theninsert_cell,set_cell_source,execute_cell,run_cellsto work.poll_eventsreports what the human changed in the meantime — assistant commands are never echoed back as events.
A plug icon at the right end of the notebook toolbar shows the bridge’s state: green when an assistant is connected, orange when paused. Clicking it toggles pause; while paused, every assistant command is rejected and none of your edits stream out.
Concurrent edits to the same cell are last-write-wins, which suits one human and one assistant taking turns. The one guard: the assistant cannot overwrite the cell you are currently editing.
Configuration#
JUPYTER_URLBase URL of the Jupyter server. Default
http://localhost:8888.JUPYTER_TOKENThe server’s access token. Required.
ALLOW_IMG_OUTPUTSet to
1to include base64 image payloads in text responses. Off by default: image payloads are large, an output’s text representation is always kept, andread_cell_imagereturns any image as a viewable image regardless of this flag.LOG_LEVELMCP server log verbosity. Default
INFO.