Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,9 @@ build-docker: ## build the docker image

start-docker: ## start the jupyter mcp server in docker
docker run -i --rm \
-e DOCUMENT_URL=http://localhost:8888 \
-e DOCUMENT_ID=notebook.ipynb \
-e DOCUMENT_TOKEN=MY_TOKEN \
-e RUNTIME_URL=http://localhost:8888 \
-e JUPYTER_URL=http://localhost:8888 \
-e JUPYTER_TOKEN=MY_TOKEN \
-e START_NEW_RUNTIME=true \
-e RUNTIME_TOKEN=MY_TOKEN \
--network=host \
datalayer/jupyter-mcp-server:latest

Expand All @@ -90,12 +87,9 @@ start: ## start the jupyter mcp server with streamable-http transport
@exec echo
jupyter-mcp-server start \
--transport streamable-http \
--document-url http://localhost:8888 \
--document-id notebook.ipynb \
--document-token MY_TOKEN \
--runtime-url http://localhost:8888 \
--jupyter-url http://localhost:8888 \
--jupyter-token MY_TOKEN \
--start-new-runtime true \
--runtime-token MY_TOKEN \
--port 4040

start-empty: ## start the jupyter mcp server with streamable-http transport and no document nor runtime
Expand All @@ -106,11 +100,9 @@ start-empty: ## start the jupyter mcp server with streamable-http transport and
@exec echo
jupyter-mcp-server start \
--transport streamable-http \
--document-url http://localhost:8888 \
--document-token MY_TOKEN \
--runtime-url http://localhost:8888 \
--jupyter-url http://localhost:8888 \
--jupyter-token MY_TOKEN \
--start-new-runtime false \
--runtime-token MY_TOKEN \
--port 4040

start-jupyter-server-extension: ## start jupyter server with MCP extension
Expand Down
53 changes: 47 additions & 6 deletions docs/docs/configure/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,63 @@ Options:
--transport [stdio|streamable-http] Transport type (default: stdio)
--provider [jupyter|datalayer] Provider type (default: jupyter)
--jupyterlab BOOLEAN Enable JupyterLab mode (default: true)
--runtime-url TEXT Runtime URL for kernel operations (default: http://localhost:8888)
--runtime-url TEXT Runtime URL for kernel operations (default: None)
--runtime-token TEXT Runtime authentication token (default: None)
--runtime-id TEXT Specific kernel ID to use (default: None)
--start-new-runtime BOOLEAN Create new runtime vs use existing (default: false)
--document-url TEXT Document URL for notebook operations (default: http://localhost:8888)
--start-new-runtime BOOLEAN Create new runtime vs use existing (default: true)
--document-url TEXT Document URL for notebook operations (default: None)
--document-id TEXT Notebook path/ID (default: None)
--document-token TEXT Document authentication token (default: None)
--jupyter-url TEXT Jupyter URL as default for both document and runtime URLs (default: None)
--jupyter-token TEXT Jupyter token as default for both document and runtime tokens (default: None)
--port INTEGER Port for streamable-http transport (default: 4040)
```

**Example:**
### Additional Commands

The server also supports additional commands for advanced workflows:

#### Connect Command
```bash
jupyter-mcp-server connect --help

Usage: jupyter-mcp-server connect [OPTIONS]

Connect a Jupyter MCP Server to a document and a runtime.

Options:
--provider [jupyter|datalayer] Provider type (default: jupyter)
--jupyterlab BOOLEAN Enable JupyterLab mode (default: true)
--runtime-url TEXT Runtime URL for kernel operations (default: None)
--runtime-token TEXT Runtime authentication token (default: None)
--runtime-id TEXT Specific kernel ID to use (default: None)
--document-url TEXT Document URL for notebook operations (default: None)
--document-id TEXT Notebook path/ID (default: None)
--document-token TEXT Document authentication token (default: None)
--jupyter-url TEXT Jupyter URL as default for both document and runtime URLs (default: None)
--jupyter-token TEXT Jupyter token as default for both document and runtime tokens (default: None)
--jupyter-mcp-server-url TEXT URL of the Jupyter MCP Server to connect to (default: http://localhost:4040)
```

#### Stop Command
```bash
jupyter-mcp-server stop --help

Usage: jupyter-mcp-server stop [OPTIONS]

Stop a running Jupyter MCP Server.

Options:
--jupyter-mcp-server-url TEXT URL of the Jupyter MCP Server to stop (default: http://localhost:4040)
```

### Usage Examples

```bash
jupyter-mcp-server start \
--transport streamable-http \
--document-url http://localhost:8888 \
--document-token MY_TOKEN \
--jupyter-url http://localhost:8888 \
--jupyter-token MY_TOKEN \
--port 4040
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ pip install datalayer_pycrdt==0.12.17
Then, start JupyterLab with the following command.

```bash
jupyter lab --port 8888 --IdentityProvider.token MY_TOKEN --ip 0.0.0.0
jupyter lab --port 8888 --IdentityProvider.token MY_TOKEN
```

You can also run `make jupyterlab` if you cloned the repository.

:::note

The `--ip` is set to `0.0.0.0` to allow the MCP Server running in a Docker container to access your local JupyterLab.
If you wish to start the Jupyter MCP server using docker, add `--ip 0.0.0.0` to the jupyter lab command to allow the MCP Server running in a Docker container to access your local JupyterLab.

:::

Expand All @@ -46,8 +46,8 @@ Install and start the server:
pip install jupyter-mcp-server
jupyter-mcp-server start \
--transport streamable-http \
--document-url http://localhost:8888 \
--document-token MY_TOKEN \
--jupyter-url http://localhost:8888 \
--jupyter-token MY_TOKEN \
--port 4040
```

Expand Down
Loading