Jupyter MCP Server 2.2.6 has CVE-2026-137189's Host-header bypass patched, but official uvx and Docker examples still use @latest, the image still binds 0.0.0.0, and execute_code can run kernel code with no server-side confirmation
Published
Jupyter MCP Server is a Model Context Protocol server that lets a connected AI client read, edit, and execute Jupyter notebooks. It can run as a standalone process (stdio or Streamable HTTP) or as a Jupyter Server extension under /mcp. Publisher: Datalayer, Inc. The public repository is datalayer/jupyter-mcp-server. The official documentation is at jupyter-mcp-server.datalayer.tech. The PyPI package is jupyter-mcp-server. The CLI entry points are jupyter-mcp and jupyter-mcp-server. The license is BSD 3-Clause. The README also advertises a hosted endpoint at https://mcp.datalayer.run/mcp; this review is of the open-source package only. We did not sign in to, or runtime-review, the hosted service.
This is a static review, conducted on 1 December 2026, Asia/Hong_Kong. The pin is git tag v2.2.6, a lightweight tag pointing at commit 526e80eda814fd8d98ae45ddbfccc765fa7490c6 (bump: 2.2.6, author date 17 November 2026, 17:07:50 Asia/Hong_Kong / 10:07:50 +01:00). We cloned that tag, read first-party source and the security docs in the same tree, downloaded the official PyPI wheel and sdist, and checked hashes. We did not run the MCP server, the CLI, JupyterLab, Docker, uvx, pip install scripts, or any kernel. We did not use a Jupyter token, a Datalayer account, or --insecure-mcp-noauth. This is not a clean bill of health.
The timely fact is CVE-2026-137189 (GitHub Advisory GHSA-f8rf-rcrx-h6r9, CWE-346, CVSS 4.0 score 9.3). The CVE record was published 30 November 2026, 02:47:07 Asia/Hong_Kong on 1 December (18:47:07 UTC on 30 November). It describes a Host-header bypass of an earlier localhost check on the standalone server's management routes. The vendor patch shipped earlier: 2.1.3 was published 1 September 2026, 11:35:52 Asia/Hong_Kong (03:35:52 UTC). If you still run anything older than 2.1.3, upgrade before you debate defaults.
On this pin, the picture is more specific than "the CVE is fixed, therefore the install is fine." Official quick-start examples still launch uvx jupyter-mcp-server@latest and datalayer/jupyter-mcp-server:latest. The pip CLI now defaults Streamable HTTP to 127.0.0.1:4040, but the official Dockerfile still sets HOST=0.0.0.0. And once a client is connected, execute_code and execute_cell can run code in the attached Jupyter kernel. We found no server-side confirmation or elicitation gate on those tools.
Inspect the official 2.2.6 package without starting the server
Work in a scratch directory. These commands only download and read the published wheel. They do not run uvx, pip install, Docker, or jupyter-mcp-server.
- Download the official wheel (not a git clone of
main, and not@latestviauvx):
curl -fsSL -o jupyter_mcp_server-2.2.6-py3-none-any.whl \
https://files.pythonhosted.org/packages/ec/3c/5134117911132c01316fbb9bcc8323140c1b6147f060b0a92bacc388dd59/jupyter_mcp_server-2.2.6-py3-none-any.whl
- Confirm the SHA-256. When we fetched this file on 1 December 2026, it was
0341aaabbb85cc327262ed2d9c5176b5a87eaf8eedf68a2187e61bfc6d1bd280, matching the PyPI digest. The sdistjupyter_mcp_server-2.2.6.tar.gzdigested tob4b777cc087901350f869a1087846822723f12122958503357cc5e9410a88098. Both artifacts were uploaded 17 November 2026, 17:08 Asia/Hong_Kong (09:08 UTC). PyPI did not advertise provenance for this release.
python3 - <<'PY'
import hashlib
from pathlib import Path
digest = hashlib.sha256(Path("jupyter_mcp_server-2.2.6-py3-none-any.whl").read_bytes()).hexdigest()
print(digest)
assert digest == "0341aaabbb85cc327262ed2d9c5176b5a87eaf8eedf68a2187e61bfc6d1bd280"
PY
- Read the version, the HTTP bind default, and the management-route check from the wheel. You should see
__version__ = "2.2.6", a Typer default ofhost="127.0.0.1", and both a Host-header check and a TCP-peer check:
python3 - <<'PY'
import zipfile
z = zipfile.ZipFile("jupyter_mcp_server-2.2.6-py3-none-any.whl")
print(z.read("jupyter_mcp_server/__version__.py").decode())
text = z.read("jupyter_mcp_server/cli/commands/serve.py").decode()
for needle in ('= "127.0.0.1"', '= "0.0.0.0"', "insecure-mcp-noauth", "autodiscover"):
print(needle, text.count(needle))
server = z.read("jupyter_mcp_server/server.py").decode()
for needle in ("def _is_local_peer", "def _is_local_hostname", "request.client", "Invalid Host header", "Request must originate from localhost"):
print(needle, needle in server)
PY
If you already have a local install, also check the running pin. python3 -c "import jupyter_mcp_server.__version__ as v; print(v.__version__)" prints the imported version. A version below 2.1.3 is still in the CVE-2026-137189 affected range.
What we pinned
- Git tag
v2.2.6is a lightweight tag.git cat-file -ton the tag object is a commit, not an annotated tag. We could not verify a maintainer or tag signature on526e80ed. Treat the tag as a convenient name for that commit, not as a signed release. jupyter_mcp_server/__version__.pyat this commit is"2.2.6".- The official wheel and sdist first-party
jupyter_mcp_server/**/*.pytrees matched the git checkout: 67 Python files, 0 mismatches, includingserver.pySHA-256ec8528342dc3456c79c25f6d6276a3cbfc1d77879a137d62af1f0550b4f3a974. requires-pythonis>=3.10. Runtime dependencies includemcp[cli]>=2,<3,code-sandboxes>=1.10.0,jupyter_server>=2.10,<3, FastAPI, Uvicorn, and Typer. We did not audit those dependency implementations.- The default branch had been pushed as recently as 28 November 2026. This review does not cover unreleased commits after
v2.2.6. - We did not pull
datalayer/jupyter-mcp-server:latestfrom Docker Hub, so we cannot confirm that image's digest matches this wheel.
Architecture and trust boundaries
The architecture note in the repository is short and accurate: one codebase, two modes. Standalone jupyter-mcp-server start speaks MCP over stdio or Streamable HTTP and reaches notebooks and kernels over HTTP/WebSocket. The Jupyter Server extension serves the same tool classes under Jupyter's /mcp path, through that server's own managers.
Those are different trust boundaries.
- In stdio mode, the MCP client launches the process and talks on stdin/stdout. There is no inbound HTTP port. The process still uses whatever Jupyter URL and token it was given, and the tools can still execute kernel code. This is the documented quick-start transport; the CLI default is
stdio. - In Streamable HTTP mode, Uvicorn listens on
--host/--port(defaults127.0.0.1:4040). From 1.0.0, this transport requires--mcp-token(or a custom verifier inJUPYTER_MCP_TOKEN_VERIFIER_CLASS) unless the operator passes--insecure-mcp-noauth, which the CLI help labels "NOT recommended for production." Official docs say that flag disables MCP client authentication, so any client that can reach the port can call tools, including code execution. - In Jupyter Server extension mode, the tools run inside Jupyter itself. Authentication then follows that Jupyter deployment. We read the extension code; we did not load it into a live JupyterLab.
A second boundary sits between the MCP server and the Jupyter it talks to. DOCUMENT_URL / DOCUMENT_TOKEN are for notebook storage; CODE_SANDBOX_URL / CODE_SANDBOX_TOKEN are for kernel execution. JUPYTER_URL / JUPYTER_TOKEN are the combined shortcuts. Sandbox variants other than the default jupyter-server (Datalayer, Kaggle, Colab, Modal, Daytona, E2B, CoreWeave, Cloudflare, and others) send execution to those backends. We did not review those engines or their credentials.
The connected MCP client is an implicit trusted operator. The built-in tools can list the Jupyter contents root, read and rewrite notebook cells, restart kernels, and execute code. connect_to_jupyter can repoint the process at a different Jupyter URL and token, but the jupyter.connect capability is off by default. The code comments describe that as an operator action, not something a prompt on a shared server should be able to do unless the operator opts in with --capability jupyter.connect.
CVE-2026-137189, and what 2.2.6 actually checks
The earlier fix, GHSA-9x8x-crjq-g64h (also recorded as CVE-2026-77359 / CVE-2026-77318), added ManagementRouteSecurityMiddleware so /api/connect, /api/stop, and /api/healthz would only accept local Host values. CVE-2026-137189 is a bypass of that check: Starlette builds request.url.hostname from the client-supplied Host header when one is present, not from the TCP peer. The official advisory states that in --insecure-mcp-noauth mode a remote caller who passed that check could replace the live Jupyter backend configuration; with --mcp-token set, the state-changing routes still required a bearer token, and the unauthenticated impact was limited to /api/healthz. The advisory also states that affected builds bound 0.0.0.0 by default, so the management routes were reachable from the network.
We are describing the vendor advisory. We did not reproduce the bypass, and this article is not a proof of concept.
On tag v2.2.6, jupyter_mcp_server/server.py still rejects a non-local Host and a non-local Origin, and it still requires a bearer token for /api/connect and /api/stop when a verifier is configured. It also calls _is_local_peer, which reads request.client.host and allows only 127.0.0.1 and ::1. The function's own docstring says this is the check "which a client-supplied Host header cannot forge." The tests in tests/test_tools.py include a case that a Host: localhost header alone must not satisfy the local-only check.
Two documentation gaps are worth knowing before you treat "I read the security page" as equivalent to "I read this pin":
- The GitHub Release notes for 2.1.3 mention a typo fix and an error-output change. They do not mention this security fix. Someone who only reads release titles could have stayed on an older build without realizing a critical management-route bypass had shipped.
- The authentication page in this tag's docs tree,
docs/docs/security/authentication/index.mdx, still describes the management-route protection as accepting local Host values, plus Origin and bearer-token rules. It does not mention the TCP-peer check that 2.2.6 actually performs. The live documentation we fetched at jupyter-mcp-server.datalayer.tech/security/authentication used the same Host-header wording.
The peer check is a real improvement over the vulnerable Host-only logic. We did not runtime-test it, including how Starlette reports client addresses behind a reverse proxy, on IPv4-mapped IPv6, or when the process is started with HOST=0.0.0.0.
Official install still drifts off this pin
The useful operational risk on 2.2.6 is not "the CVE is unpatched in this wheel." It is that the documented happy path does not stay on this wheel.
The README's recommended quick start configures the MCP client as:
{
"mcpServers": {
"jupyter": {
"command": "uvx",
"args": ["jupyter-mcp-server@latest"],
"env": {
"JUPYTER_URL": "http://localhost:8888",
"JUPYTER_TOKEN": "MY_TOKEN",
"ALLOW_IMG_OUTPUT": "true"
}
}
}
}
The "production" Docker example uses datalayer/jupyter-mcp-server:latest. On Linux it also adds --network=host. Neither example pins 2.2.6. The next time latest moves, or the next time a machine replenishes the uvx cache, you are no longer running the tree you reviewed.
The same Getting Started section starts JupyterLab with:
jupyter lab --port 8888 --IdentityProvider.token MY_TOKEN --ip 0.0.0.0
That bind is on Jupyter itself, not on the MCP server. It is still the official first command, and it publishes the notebook server on every interface with only the token as the gate. The MCP server will then be given that token in JUPYTER_TOKEN.
For the MCP process, the CLI default on this pin is better than the advisory's affected range: --host defaults to 127.0.0.1, --port to 4040, --transport to stdio. The official Dockerfile overrides the host:
# The --host option defaults to loopback so that a pip install does not put the
# streamable-HTTP listener on every interface. That default is wrong for this image:
# Docker forwards a published port to the container's eth0 address, not to its
# loopback, so a 127.0.0.1 bind would make `-p 4040:4040` accept nothing.
ENV HOST=0.0.0.0
ENTRYPOINT ["python", "-m", "jupyter_mcp_server"]
That comment is honest about why the image differs from the pip default. It also means a docker run -p 4040:4040 of the official image, used with Streamable HTTP, is listening on every interface inside the container namespace. The image documentation tells you to put TLS in front of that. The MCP client JSON examples above use docker run -i (stdio) and do not publish 4040; the risk appears when someone follows the image's HTTP default rather than the stdio snippet.
If the document provider is jupyter and no Jupyter password is set, start also turns on autodiscovery. resolve_url_and_token_variables calls jupyter_server.serverapp.list_running_servers — the same inspection behind jupyter server list — and will fill in a missing URL and/or token from a running local server. Official quick start usually sets JUPYTER_URL and JUPYTER_TOKEN explicitly. If you omit the token, this pin can still pick it up from the local Jupyter runtime. We did not execute that path; the code and its unit tests describe it.
Tools, data access, and what a connected client can do
These MCP tool names are registered in server.py at this pin:
- Read-oriented:
list_files,list_kernels,list_notebooks,read_notebook,read_cell. - Notebook and kernel control:
use_notebook,use_notebook_by_name,unuse_notebook,restart_notebook. - Cell writes:
insert_cell,overwrite_cell_source,edit_cell_source,delete_cell,clear_cell_output,move_cell. - Execution:
execute_cell,insert_execute_code_cell,execute_code. - Optional retargeting:
connect_to_jupyter(capabilityjupyter.connect, off by default).
list_files lists the Jupyter server's contents API, starting at the contents root when path is empty, with a default recursion depth of 1. Its scope is whatever that Jupyter server can see, not the MCP process's own filesystem sandbox. execute_code and execute_cell run code in the attached kernel as the Jupyter user. Their tool annotations mark them destructiveHint=True and openWorldHint=True. We grepped the first-party package for elicitation and confirmation hooks and found none. Whether your MCP client asks before calling those tools is a client policy, not a guarantee of this server.
Default execution timeout is 120 seconds; a tool call may request up to max_execution_timeout, which defaults to 3600 seconds.
A separate capability, kernel.auto-restart, is also off by default. The code comments explain why: automatically replacing a dead kernel used to hide the fact that session state had been lost. We did not runtime-test either capability flag.
When the process is loaded as a JupyterLab extension, additional tools can come from jupyter-mcp-tools. The default allow-list in the CLI help is notebook_run-all-cells,notebook_get-selected-cell. We did not review that companion package in this pin.
Credentials, network, and telemetry
- Jupyter tokens and passwords can be passed on the CLI or via environment variables (
JUPYTER_TOKEN,DOCUMENT_TOKEN,CODE_SANDBOX_TOKEN, and the password variants). Streamable HTTP addsMCP_TOKEN. Official docs correctly treatMCP_TOKENas independent from the Jupyter token. connect_to_jupyteraccepts a URL and token as tool arguments when its capability is enabled. The implementation logs the URL and redacts the token as***. It also issues arequests.getto/api/statusto verify the new server before swapping config. We did not run it.- OpenTelemetry span export is opt-in.
maybe_register_oteldoes nothing unless--otel-fileorJUPYTER_MCP_OTEL_FILEis set. We did not find an on-by-default phone-home path in the first-party package. We did not audit dependencies for telemetry of their own. - Audit sinks are also opt-in, via
JUPYTER_MCP_AUDIT_SINK_CLASS. A name that cannot be loaded is intended to stop the server rather than run without auditing.
Malware check, and its limits
In the first-party Python we opened at 526e80ed, and in the matching official wheel, we did not find install-time hooks, obfuscated payloads, or a default telemetry exporter. HTTP calls we saw were to operator-configured Jupyter or sandbox URLs, plus the documented local autodiscovery path.
That is a limited static look. We did not execute the package, rebuild it, review code-sandboxes or mcp, pull Docker layers, or inspect the hosted service at mcp.datalayer.run. A clean first-party reading is not a claim that every install path is harmless, especially an unpinned @latest install.
Who this is for, and what to do
This package is for people who already run Jupyter and want an agent to operate on those notebooks. It is not a sandbox that contains the model. The model inherits the Jupyter account you handed it.
If you use it:
- Pin a reviewed version. Do not copy
jupyter-mcp-server@latestordatalayer/jupyter-mcp-server:latestinto a standing config. For this review, the pin isjupyter-mcp-server==2.2.6, git tagv2.2.6, commit526e80ed. Anything older than 2.1.3 is in the CVE-2026-137189 affected range. - Prefer stdio unless you have a reason for Streamable HTTP. If you do use HTTP, set
--mcp-token, keep the bind on loopback unless you have TLS and an access path you can explain, and do not pass--insecure-mcp-noauthon a network-reachable process. - If you use the official Docker image with HTTP, remember it sets
HOST=0.0.0.0. Publishing port 4040 is then a deliberate exposure, not the pip default. - Give the process a Jupyter token with the narrowest access you can, and assume
execute_codewill run. Do not point it at a Jupyter that can see credentials or data you would not let the model read or change. Leavejupyter.connectoff unless you mean the client to retarget the backend. - Do not treat the official
jupyter lab --ip 0.0.0.0getting-started command as a hardened default.
Limits of this review
This was a static review of datalayer/jupyter-mcp-server at 526e80eda814fd8d98ae45ddbfccc765fa7490c6 (tag v2.2.6) and of the official PyPI artifacts jupyter-mcp-server 2.2.6, checked on 1 December 2026, Asia/Hong_Kong.
We did not run the server, the CLI, JupyterLab, uvx, pip install, or Docker. We did not rebuild the wheel from source. We did not connect to Remote or hosted MCP at https://mcp.datalayer.run/mcp, and we used no vendor account or token. We did not runtime-test the TCP-peer check, autodiscovery, capability flags, or kernel execution. We did not audit dependency implementations or Docker image contents.
This is not a clean bill of health.
More skill reviews
- Claude Security 0.13.1 can run pull request code — pin the GitHub Action the official sample leaves on mainAnthropic’s official Claude Security plugin, pinned here at v0.13.1, can review GitHub pull requests as a GitHub Action. Official docs warn that pull request text can steer the scan and that the scan can run the pull request’s code. The Action’s own limits tell you to pin a full commit SHA because it runs with sudo, but the official sample workflow still floats main, and the docs page still advertises the 0.13.0 merge commit. A green required check is not a hard security gate.
- Official Grafana MCP Server 2.4.0 leaves --disable-write off, so a GRAFANA_SERVICE_ACCOUNT_TOKEN unlocks write tools such as update_dashboard, create_folder, install_plugin, and grafana_api_request; the official Docker entrypoint binds --transport sse --address 0.0.0.0:8000 with --server-auth-token empty; CVE-2026-15583's token exfil is fixed, but official uvx examples remain unpinned while PyPI still serves 2.2.0Static review of grafana/mcp-grafana v2.4.0 (commit 7f717bceff42080b3eeb026506672e8ba4fbdce7). The default --enabled-tools list includes the api and plugin categories and --disable-write defaults to false, so write tools such as grafana_api_request and install_plugin are registered unless you turn them off. The official Docker image listens on 0.0.0.0:8000 over SSE with no caller token unless you override the entrypoint. CVE-2026-15583's environment-token exfil is not present in this pin; official uvx examples are unpinned, and PyPI's mcp-grafana was still 2.2.0 when we checked.
- Official Terraform MCP Server 1.4.1 defaults --toolsets to all, so a TFE_TOKEN unlocks write tools such as create_workspace_variable, grant_team_access, and create_run without ENABLE_TF_OPERATIONS; official HTTP examples bind TRANSPORT_HOST=0.0.0.0, which the TLS gate treats as localhost; and MCP_REQUIRE_TOKEN defaults offStatic review of HashiCorp terraform-mcp-server v1.4.1 (commit 3781509). The default --toolsets value is all, so a TFE_TOKEN enables write tools that ENABLE_TF_OPERATIONS does not gate. Official HTTP Docker examples bind 0.0.0.0, which the TLS check treats as localhost, and MCP_REQUIRE_TOKEN defaults off.