Skip to main content

af-jupyterhub-mcp

MCP server that lets UChicago ATLAS Analysis Facility users start, inspect, stop, and delete their own JupyterHub named servers on jupyterhub.af.uchicago.edu, and work inside them (run code, edit notebooks, drive the JupyterLab UI), as tools for LLMs behind the af-mcp-platform broker.

Architecture

LLM <--MCP/HTTP--> af-mcp-platform aggregator --Bearer: linked hub token--> af-jupyterhub-mcp
                                                                              |
                                      JupyterHub REST API  <------------------+
                                      /hub/api/users/<you>/servers/<name>     |
                                      hub proxy /user/<you>/<name>/mcp  <-----+--> jupyter-mcp-server

Everything goes through JupyterHub and nothing else. Servers are started with POST /hub/api/users/<you>/servers/<name>, whose body is the spawner's user_options (image, site, CPU, memory, QoS, GPUs). The tool then follows the hub's spawn progress stream, sending MCP progress notifications until the server is ready. Notebook tools reach the server's own jupyter-mcp-server through the hub proxy, so they work for servers on any site (local, ssl, nrp). The backend never talks to Kubernetes or BinderHub. Servers launched from the BinderHub UI are ordinary named servers of the same user, so they show up and work here too.

Launched images must include jupyterhub-singleuser (ml_platform has since #21) and jupyter-mcp-server (plus jupyter-mcp-tools for the nb_ui_* tools).

Authentication

  • The user's own hub token. af-mcp-platform links each user's JupyterHub account through the hub's OAuth (oauth21-direct, confidential client service-af-mcp-platform). It forwards the linked token as Authorization: Bearer <hub token>. The backend has no credentials of its own and uses that token for every hub and notebook call, so its trust tier is user-tier.
  • Identity. The caller is resolved with GET /hub/api/user. The result is cached for 60 s, keyed by the token's SHA-256. The hub username is the owner of every server a tool touches; no tool takes an owner argument.
  • Required scopes. servers!user, access:servers!user and read:users:name!user. A token without them gets an error that names the missing scopes.
  • Token lifetime. The link token uses the hub's default 14-day lifetime. The hub issues no refresh token, so users re-link when it expires; the tools then say to re-link.
  • Secrets stay out of results. Tokens never appear in tool results or logs. That includes the token BinderHub stores in a server's user_options.

Tools

76 tools: seven for the server lifecycle, 17 nb_* notebook tools, and 52 nb_ui_* JupyterLab UI tools. See docs/tools.md for the full reference.

Tool Does Kind
create_jupyter_server Start a named server and wait until it is ready, with progress mutating
list_jupyter_servers List your named servers, stopped ones included read-only
get_jupyter_server Show one server's status, image, resources, and URL read-only
stop_jupyter_server Stop a server but keep its entry (it still counts toward the 10) destructive
delete_jupyter_server Stop a server and remove its entry destructive
list_supported_images List the CPU and GPU images create_jupyter_server accepts read-only
list_sites List the site names create_jupyter_server accepts read-only

Build and test commands

pixi run test          # unit + integration tests (fake hub, no network)
pixi run -e py312 test-e2e  # live hub; needs AF_JUPYTERHUB_E2E_TOKEN
pixi run lint          # pre-commit + pylint
pixi run helm-lint     # lint + smoke-render the Helm chart
pixi run docs-serve    # build and serve the docs

See docs/configuration.md and docs/deployment.md for running it.

Metadata

Release files for af-jupyterhub-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for af-jupyterhub-mcp 0.1.0
File Size Uploaded Provenance Actions
af_jupyterhub_mcp-0.1.0.tar.gz 141.4 kB With provenance Details for af_jupyterhub_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for af-jupyterhub-mcp 0.1.0
File Interpreter ABI Platform Actions
af_jupyterhub_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for af_jupyterhub_mcp-0.1.0-py3-none-any.whl

Total release size: 183.0 kB

Release files / af_jupyterhub_mcp-0.1.0.tar.gz

Download URL af_jupyterhub_mcp-0.1.0.tar.gz
Size 141.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f543c6426cb992621b9880a9d6ffc04427610e4e3bd9c05f0f9e61cace13455f
BLAKE2b-256 checksum
How to use checksums
91e92c07639801b52d8b762163cb53d5edd7672af837c872cfa97921e281d759
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / af_jupyterhub_mcp-0.1.0-py3-none-any.whl

Download URL af_jupyterhub_mcp-0.1.0-py3-none-any.whl
Size 41.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99cd90737242e93abc46987cf205827f47573467c5ae2fe0fa8395a15cd86b75
BLAKE2b-256 checksum
How to use checksums
2a560fc92628b47443514689c03fb7810beec0f4f3f99c64f730548b26abb176
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for af-jupyterhub-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for af_jupyterhub_mcp-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page