af-jupyterlab-mcp
af-jupyterlab-mcp
Servidor MCP que permite a los usuarios de AF crear, inspeccionar y eliminar sus propios servidores JupyterLab por usuario en el clúster Kubernetes de la UChicago ATLAS Analysis Facility — los mismos notebooks que af-portal despliega hoy, expuestos como herramientas para LLMs.
Arquitectura
LLM <--MCP/HTTP--> af-jupyterlab-mcp <--k8s API--> notebook namespace (Pod/Service/Secret/Ingress)
^
| Authorization: Bearer <broker-issued JWT>
|
af-mcp-platform credential brokerLa fase 1 (este repositorio, hoy) incluye seis herramientas que gestionan la cuádruple Pod/Service/Secret/Ingress de un notebook, portadas desde portal/jupyterlab.py de af-portal y sus cuatro plantillas Jinja. La fase 2 (en seguimiento, aún no construida) añade un proxy tipado al jupyter-mcp-server de Datalayer que se ejecuta dentro del propio notebook — véase maniaclab/af-mcp-platform#189.
Related MCP server: rucio-mcp
Estructura del proyecto
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() functionsSuperficie de herramientas
create_jupyter_serverlist_jupyter_serversget_jupyter_serverdelete_jupyter_serverget_gpu_availabilitylist_supported_images
El propietario de cada servidor es siempre claims.unixname del JWT de broker verificado — ninguna herramienta acepta un argumento de propietario/nombre de usuario.
Comandos de compilación y prueba
pixi run test # quick tests
pixi run lint # pre-commit + pylint
pixi run helm-lint # lint + smoke-render the Helm chartThis server cannot be deployed
Maintenance
Related MCP Connectors
Massed Compute MCP — GPU inventory, VM lifecycle, billing, SSH keys, and setup recipes.
GPU cloud platform — create, manage, and monitor instances, snapshots, SSH keys, and billing.
Read GPU instances, types, images, filesystems and firewall rules; launch and terminate instances.
On-demand GPU nodes for agents: create nodes, run commands, and submit jobs, billed by the minute.
Related MCP Servers
- FlicenseAqualityCmaintenanceAn MCP server that enables LLMs to execute Python code on GPU-accelerated compute nodes within SLURM-managed HPC environments. It bridges local clients to remote clusters by launching JupyterLab sessions via SLURM jobs to facilitate high-performance notebook-based computation.7-
- AlicenseNot gradedqualityCmaintenanceAn MCP server that exposes Rucio distributed data management operations as tools for LLMs. Designed for ATLAS physicists working with grid data on analysis facilities, but usable with any Rucio instance.42 PyPI6Apache 2.0
- AlicenseAqualityCmaintenanceEnables code execution in isolated Docker containers with persistent IPython, Node.js, or R kernels, supporting file import/export and cross-session transfers via MCP tools.6MIT
- AlicenseAqualityDmaintenanceAI-powered MCP server for connecting and managing Jupyter Notebooks. Enables interactive code execution, multi-notebook management, and multimodal output for data analysis, visualization, and machine learning.1272 PyPI9MIT