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_serverlist_jupyter_serversget_jupyter_serverdelete_jupyter_serverget_gpu_availabilitylist_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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file af_jupyterlab_mcp-0.1.2.tar.gz.
File metadata
- Download URL: af_jupyterlab_mcp-0.1.2.tar.gz
- Upload date:
- Size: 129.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a253f0055133a91d338c479bdf4d2bb7df24ded7f79a9ede117ec61d741a2004
|
|
| MD5 |
03169ff57520beeeed01e68911367d55
|
|
| BLAKE2b-256 |
72b0e73d34dab48f4c1cb4d482f928eebc152078de617d7bbf927bbc1e2cd413
|
Provenance
The following attestation bundles were made for af_jupyterlab_mcp-0.1.2.tar.gz:
Publisher:
cd.yml on maniaclab/af-jupyterlab-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
af_jupyterlab_mcp-0.1.2.tar.gz -
Subject digest:
a253f0055133a91d338c479bdf4d2bb7df24ded7f79a9ede117ec61d741a2004 - Sigstore transparency entry: 2537048492
- Sigstore integration time:
-
Permalink:
maniaclab/af-jupyterlab-mcp@04bc54aaa86a27b0f09af8368b463ec779567849 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/maniaclab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@04bc54aaa86a27b0f09af8368b463ec779567849 -
Trigger Event:
release
-
Statement type:
File details
Details for the file af_jupyterlab_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: af_jupyterlab_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 31.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
051979ffdb53befc39bc951c177e066dbc8b692bc1272c3f1fab19a3ab437ddb
|
|
| MD5 |
3a4994c51f274e22954142e375c691f3
|
|
| BLAKE2b-256 |
e8e07d6eb60eaab6bbd5cca7e9589ffa4b69e18955955406a202d3f0c2004a3e
|
Provenance
The following attestation bundles were made for af_jupyterlab_mcp-0.1.2-py3-none-any.whl:
Publisher:
cd.yml on maniaclab/af-jupyterlab-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
af_jupyterlab_mcp-0.1.2-py3-none-any.whl -
Subject digest:
051979ffdb53befc39bc951c177e066dbc8b692bc1272c3f1fab19a3ab437ddb - Sigstore transparency entry: 2537048885
- Sigstore integration time:
-
Permalink:
maniaclab/af-jupyterlab-mcp@04bc54aaa86a27b0f09af8368b463ec779567849 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/maniaclab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@04bc54aaa86a27b0f09af8368b463ec779567849 -
Trigger Event:
release
-
Statement type: