Skip to main content

af-jupyterlab-mcp

MCP server that lets AF users create, inspect, and delete their own per-user JupyterLab servers on the UChicago ATLAS Analysis Facility Kubernetes cluster — the same notebooks af-portal deploys today, exposed as tools for LLMs.

Architecture

LLM <--MCP/HTTP--> af-jupyterlab-mcp <--k8s API--> notebook namespace (Pod/Service/Secret/Ingress)
                         ^
                         | Authorization: Bearer <broker-issued JWT>
                         |
              af-mcp-platform credential broker

Phase 1 (this repo, today) ships six tools that manage the Pod/Service/ Secret/Ingress quadruple for a notebook, ported from af-portal's portal/jupyterlab.py and its four Jinja templates. Phase 2 (tracked, not yet built) adds a typed proxy to the Datalayer jupyter-mcp-server running inside the notebook itself — see maniaclab/af-mcp-platform#189.

Project layout

src/af_jupyterlab_mcp/
├── cli.py               # argparse: `af-jupyterlab-mcp serve` (HTTP only)
├── config.py            # env-driven Settings: namespace, domain, image allowlist, quotas
├── server.py            # FastMCP setup, lifespan (k8s client + broker verifier), tool registration
├── auth/
│   └── broker.py        # extract_bearer(), get_broker_claims() -- broker-issued JWT verification
├── k8s/
│   ├── errors.py         # GuardrailError, NameConflictError, NotFoundOrNotYoursError, ...
│   ├── guardrails.py     # CPU/memory/duration range + image allowlist validation
│   ├── names.py          # sanitize_k8s_pod_name, name availability, name generation
│   ├── templates.py      # Jinja rendering of the four ported manifests
│   ├── notebooks.py      # create/get/list/delete notebook (ported portal logic)
│   ├── gpu.py            # get_gpu_availability (ported portal logic)
│   └── templates/        # pod.yaml.j2, service.yaml.j2, secret.yaml.j2, ingress.yaml.j2
│                          # (ported verbatim from af-portal/portal/templates/jupyterlab/)
└── tools/
    └── jupyterlab.py     # the six @mcp.tool() functions

Tool surface

  • create_jupyter_server
  • list_jupyter_servers
  • get_jupyter_server
  • delete_jupyter_server
  • get_gpu_availability
  • list_supported_images

The owner of every server is always claims.unixname from the verified broker JWT — no tool takes an owner/username argument.

Build and test commands

pixi run test          # quick tests
pixi run lint          # pre-commit + pylint
pixi run helm-lint      # lint + smoke-render the Helm chart

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

af_jupyterlab_mcp-0.1.4.tar.gz (129.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

af_jupyterlab_mcp-0.1.4-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file af_jupyterlab_mcp-0.1.4.tar.gz.

File metadata

  • Download URL: af_jupyterlab_mcp-0.1.4.tar.gz
  • Upload date:
  • Size: 129.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for af_jupyterlab_mcp-0.1.4.tar.gz
Algorithm Hash digest
SHA256 33a539b7b9121a5c187bb02a4907c61807b5d4e8f5431cae6b5b5f4390aa62ce
MD5 4274bb4b7e8a00e1a2a9884a33b0de9b
BLAKE2b-256 fe07873aebf0599cd781e43a79c70d0a9916ebec20b8a21cf2d2565ab1f0784a

See more details on using hashes here.

Provenance

The following attestation bundles were made for af_jupyterlab_mcp-0.1.4.tar.gz:

Publisher: cd.yml on maniaclab/af-jupyterlab-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file af_jupyterlab_mcp-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for af_jupyterlab_mcp-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5a47d12b58a400b822fbf1c2fab181d3aa74e84233629f0921b25d66bce1aafd
MD5 d99273b6c146d2d5140fe88cb6a440b9
BLAKE2b-256 aaca1caee411231a3cee93bc89f1dd1a2ffbc07d1b2b9fe55f848cc6777f6e82

See more details on using hashes here.

Provenance

The following attestation bundles were made for af_jupyterlab_mcp-0.1.4-py3-none-any.whl:

Publisher: cd.yml on maniaclab/af-jupyterlab-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.0

2 files

0.1.5

2 files

This release

0.1.4 This release

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

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