From 032e368733f7b5cbb775e4272b371d0cb98fda05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C3=A9onore=20Charles?= Date: Thu, 30 Oct 2025 14:27:05 +0100 Subject: [PATCH] fix docs --- Makefile | 20 +++---- docs/docs/configure/index.mdx | 53 ++++++++++++++++--- .../streamable-http/standalone/index.mdx | 8 +-- 3 files changed, 57 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index a9318be..f06b424 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 @@ -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 diff --git a/docs/docs/configure/index.mdx b/docs/docs/configure/index.mdx index 6d11cab..d0ce899 100644 --- a/docs/docs/configure/index.mdx +++ b/docs/docs/configure/index.mdx @@ -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 ``` diff --git a/docs/docs/deployment/jupyter/streamable-http/standalone/index.mdx b/docs/docs/deployment/jupyter/streamable-http/standalone/index.mdx index c2138ba..4fd40db 100644 --- a/docs/docs/deployment/jupyter/streamable-http/standalone/index.mdx +++ b/docs/docs/deployment/jupyter/streamable-http/standalone/index.mdx @@ -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. ::: @@ -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 ```