Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
LOOMMUX_MONITOR_URLNoOverride the monitor event-ingest URL.
LOOMMUX_MONITOR_DISABLEDNoSet to 1 to disable monitor publishing.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
extensions
{
  "io.modelcontextprotocol/ui": {}
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
run_cellA

向持久 IPython kernel 提交一个 IPython cell。

请你使用 IPython 的思想来优雅使用本系列工具。

输入

一格 IPython cell,变量、导入和其他 namespace 状态与当前持久 IPython 会话中的后续 cell 共享。

loommux cell magic

cell 第一行写 %%loommux,给这一次调用加参数;选项只作用于这一个 cell, 下一行可以接另一个 cell magic,例如 %%bash::

%%loommux --wait 260 --silence 35
%%bash
pnpm exec playwright test

等待有两个计时器,对应 HTTP 客户端的总超时与 read timeout(CI 里是 job timeout 与 no_output_timeout):

--wait SECONDS:这次调用最多等多久; --silence SECONDS:cell 连续这么久没有任何输出就提前返回,从提交起计,每来一条输出就重新计时。

cell 跑完立即返回;计时器先到时,结果写明 running 与原因,附最后几行输出。 到点只交还控制权,cell 照常运行:接着用 wait 等(同样两个计时器),或 read_output、interrupt。

不写时两个都是 10 秒,几秒内结束的 cell 不用写。要跑更久,就按这次具体在跑的东西估两个整数秒, 不写 30、120、600 这类凑整的数:--wait 是略高于预期、超过就该回来看看的上限; --silence 是健康运行里两行输出之间最长的间隔。上面的 e2e 上次跑了 212 秒,最慢的用例 23 秒; 训练 12 个 epoch、每个约 280 秒才打一行时,写 --wait 3500 --silence 320。 只写 --wait 时静默仍是 10 秒,安静的长任务会在 10 秒处先回来。

每个结果第一行写着这次执行跑了多久,如 In [7] · 54.3 s:,还在跑时是从提交到现在; 下一次估计照着它修正。

--full-output:让本次 execution 在终态时返回完整 combined 正文,突破默认 5,000-token 阈值限制; 在明确需要完整阅读某些文件、资料时使用,避免反复阅读的开销。

--kernel NAME 写另一个 kernel 的名字,把这个 cell 交给它::

%%loommux --kernel build --wait 75 --silence 25
%%bash
uv run pytest

build 是这个会话主 kernel 名下的子 kernel,不存在时首次使用就开出, 跟着主 kernel 活、跟着它回收;子 kernel 的名字只在各自的主 kernel 名下唯一, 别的主 kernel 名下的写全称 /主kernel名/build。 这个 cell 就是 loommux.create("build") 再在它上面 run_cell,在这里等它、接着它的输出; 所以中断这个 cell,build 的这次执行也被中断。 每个 kernel 里都有 loommux:守护进程的客户端,好比 docker 命令之于 dockerd。 守护进程管 kernel 的生死与名字:列出、查找、开子 kernel、改名、回收; loommux["build"] 取到的 kernel 有与这组工具同名同参的方法,你对主 kernel 做的事,对任何一台都能做。 细节在对象上:loommux?、help(loommux)。

什么时候用呢?

  1. 同时想利用Kernel本身(如果Shellwork合适优先使用)去跑长任务的同时,还想要使用主Kernel去做别的事情使用。

  2. 想要保持主Kernel命名空间干净,临时去子Kernel做探索、尝试、测试……完成后回收临时Kernel。 如果你要做的事情本身就是阻塞当前的这个任务,那么请只使用主Kernel.

主 kernel

第一个 cell 用 --attach 名字 --create 给它命名意味着向 loommux 申请持久资源,最长24小时动态刷新。 名字必须使用描述这次任务的一个短语,不带空格::

%%loommux --attach 主kernel绑定设计 --create
import pandas as pd

--attach 名字 可重新切换会曾命名到的持久资源。 任务变了,在任意 cell 里顺手写 loommux.rename(loommux.self, "新名字")。

图像展示

使用 IPython display() 即可看图, 对 PNG、JPEG、WEBP 或单帧 GIF 图像有效

执行编号与后续操作

提交成功可以获得一个 execution。后续工具使用它定位当前持久 IPython 会话中的这次执行。

statusA

返回 workspace、kernel 与最近执行记录的观察状态。

状态范围

还返回当前 IPython 工作台启动时解析的 workspace、其 workspace_resolution 来源类别、Python 解释器、kernel PID、kernel 是否已启动,以及 kernel 是否正忙。 workspace_resolution 只能是 launch_cwd 或explicit_config; 忙碌时 current_execution 是正在运行的正整数执行编号; 空闲时 recent_execution 是最近一次被接受的执行编号。

IPython 通过原生 ZMQ 协议连接,拥有完整能力。

Returns: 当前 IPython 工作台与 kernel 的状态快照。

execution_statusA

返回一个 execution 的状态与元数据。

选择规则

提供 execution 时,只选择该正整数记录。省略时,先选择当前 running 记录;不存在 running 记录时,选择最近一次被接受的记录; 两者都不存在时返回 execution_not_found。

read_outputA

读取一个 execution 的指定输出流。

选择与流

execution 的选择规则与 execution_status 相同。stream 只能为 combined、stdout、stderr、result 或 traceback。

行坐标

line_range 形如切片 start:stop:两端都是行号,都含在范围内, 端点都可以省略,省略即到边界,所以 : 就是整个流。:10 读前 10 行,-10: 读后 10 行,2:4 读第 2 到第 4 行,3:3 只读第 3 行。

负数按行号从尾部数,两端照样都含::-3 是到倒数第三行为止,不是去掉 末三行。所选范围的全部行一次返回,不必切成连续的小段。

search_outputA

在一个 execution 的指定输出流中搜索文本或正则表达式。

选择与匹配

execution 的选择规则与 execution_status 相同;可选的 stream 值与 read_output 相同。query_mode="literal" 按字面文本匹配,query_mode="regex" 要求 query 是有效正则, query_mode="auto" 先按正则解释,仅在编译失败时回退到字面匹配。

命中上下文

每条命中保留原始所选流行号,并以 M 标记;前后上下文行以 C 标记。

waitA

等待一个 execution 结束,或两个计时器之一到点。

两个计时器

与 cell 头的 --wait / --silence 相同,对应 HTTP 客户端的总超时与 read timeout: timeout_seconds 是这次调用最多等多久;silence_seconds 是 execution 连续这么久 没有新输出就提前返回,从这次调用开始计。默认都是 10 秒。

到点只结束这次调用,cell 照常运行,结果写明 running 与原因,附最后几行输出; 之后可以再调用本工具,或用 read_output、interrupt。 结果第一行写着它从提交到现在跑了多久;对照预期估出剩下的整数秒,例如 wait(timeout_seconds=170, silence_seconds=35)。

选择

execution 的选择规则与 execution_status 相同。

完整输出交付

当所选 execution 的 cell 头含 --full-output 且已达到终态时,本工具 直接返回完整 combined 正文,可以突破 5,000-token 省略;仍在运行的 execution 继续返回 running。

interruptA

向当前正在运行的 execution 发送 kernel 中断信号。

中断语义

kernel 到达 IOPub idle 后,记录才会报告 interrupted、 error 或其他最终状态。kernel 空闲时返回 idle。

Returns: 已发送信号时返回目标 execution;kernel 空闲时返回 idle。

restartA

重启 IPython kernel。

重置边界

若存在 running execution,它会先被终止;随后旧 kernel 停止并创建替代 kernel。

Returns: 新 kernel 的状态与 PID;重启失败时返回 workspace 或 kernel 启动错误。

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.9/5.0

Scored across 8 tools

Disambiguation3/5

Most tools are clearly distinct (run_cell, wait, interrupt, restart, read_output, search_output), but execution_status and status overlap heavily — both report status about the kernel/executions, with fuzzy boundaries that force the agent to reason about which one answers its question. The verbose descriptions help clarify but don't fully resolve this confusion.

Naming Consistency4/5

All tools use snake_case and a readable action-oriented convention (run_cell, read_output, search_output, interrupt, restart, wait). The main deviation is the pair 'status' vs 'execution_status', where one is a bare noun and the other a noun_noun compound, creating slight inconsistency.

Tool Count5/5

Eight tools is well-scoped for a persistent IPython kernel session manager, covering execution, waiting, output inspection, search, interrupt, restart, and status without bloat. Each tool earns its place in the workflow.

Completeness4/5

The execution lifecycle is well covered (submit, wait, read, search, interrupt, status, restart). However, kernel lifecycle operations mentioned in the docs — create/attach, rename, list kernels, and recycle/kill — are exposed only via the Python loommux object, not as tools, leaving gaps an agent must work around through run_cell code.

Maintenance

ActivityActive
ResponsivenessNo recent community issues