Additional Tools
In JupyterLab mode, Jupyter MCP Server integrates with jupyter-mcp-tools to expose additional JupyterLab-specific commands as MCP tools.
Dependency on jupyter-mcp-tools
When running in JupyterLab mode (see Configuration), Jupyter MCP Server depends on jupyter-mcp-tools to provide enhanced UI integration capabilities. This extension enables the use of JupyterLab commands as MCP tools.
Installation
The jupyter-mcp-tools package must be installed in your JupyterLab environment:
pip install jupyter-mcp-tools>=0.1.4
How It Works
- JupyterLab Mode Detection: When Jupyter MCP Server detects it's running in JupyterLab mode, it queries
jupyter-mcp-toolsfor available commands - Allowed Tools Filtering: Only specific tools from
jupyter-mcp-toolsare exposed to MCP clients (see Allowed Tools below) - Command Routing: When an MCP client calls one of these tools, the request is routed to
jupyter-mcp-toolswhich executes the corresponding JupyterLab command
Allowed Tools
The following tools from jupyter-mcp-tools are enabled by default in Jupyter MCP Server:
| Tool Name | Description |
|---|---|
notebook_run-all-cells | Execute all cells in the current notebook sequentially |
notebook_get-selected-cell | Get information about the currently selected cell |
The list of allowed jupyter-mcp-tools is now configurable!
The complete list of available tools can be found in the jupyter-mcp-tools README.
You can specify which tools to enable using:
When running jupyter-mcp-server as a Jupyter Server Extension:
jupyter lab --port 4040 --IdentityProvider.token MY_TOKEN --JupyterMCPServerExtensionApp.allowed_jupyter_mcp_tools="notebook_run-all-cells,notebook_get-selected-cell,notebook_append-execute"
When running jupyter-mcp-server standalone:
jupyter-mcp-server --allowed-jupyter-mcp-tools "notebook_run-all-cells,notebook_get-selected-cell,notebook_append-execute"
For developers who want to modify the default list programmatically, you can still update the allowed_jupyter_mcp_tools configuration in:
jupyter_mcp_server/server.py- for standalone/STDIO modejupyter_mcp_server/jupyter_extension/handlers.py- for Jupyter server extension mode
Architecture
When JupyterLab mode is enabled:
- Jupyter MCP Server queries
jupyter-mcp-toolsfor available tools - Only tools in the
allowed_jupyter_mcp_toolsconfiguration are exposed to MCP clients - Tool execution is routed through
jupyter-mcp-toolswhich communicates with the JupyterLab frontend via WebSocket