@evref-bl/pharo-launcher-mcp

中文文档
0.4.1发布于 2026/11/11MITTypeScriptES Module构建来源已验证近 30 天下载 2705

MCP server for controlling Pharo Launcher images, templates, VMs, and processes.

原始使用文档
文档目录9 节
  1. Install
  2. Use it as a library
  3. Terms
  4. Quick Start
  5. Profile Quick Start
  6. Common Workflows
  7. Safety Model
  8. Documentation
  9. Source Development

pharo-launcher-mcp

pharo-launcher-mcp is an MCP server for controlling Pharo Launcher from a host process.

It exposes Pharo Launcher image, template, VM, and process operations as MCP tools. An MCP client can ask it what Launcher installation it resolved, list templates, create or copy images, start images, package images, inspect running Pharo processes, and delete caller-owned images or VMs.

The server works outside the target images. It does not install code into those images, keep project state, or decide which images are safe to mutate. It is the launcher boundary that higher-level tools can call when they need a concrete image or process action.

Install

Requirements:

  • Node.js 22.12.0 or newer
  • npm and npx
  • Pharo Launcher installed on the host

Install from npm:

npm install @evref-bl/pharo-launcher-mcp

Run the MCP server over stdio:

npx @evref-bl/pharo-launcher-mcp

The package also provides the pharo-launcher-mcp executable when installed in a project or globally.

Use it as a library

A Node caller does not need the protocol. The tools are functions:

import { openPharoLauncher } from "@evref-bl/pharo-launcher-mcp/launcher";

const launcher = openPharoLauncher();
const running = await launcher.listProcesses();
const images = await launcher.listImages({ nameFilter: "Task" });

Each call answers the normalized launcher result directly, with its ok, data, diagnostic and command fields typed, rather than JSON inside an MCP text block that the caller parses back.

A TypeScript caller gets those shapes with them, so a result does not have to be described a second time on the way out:

import type {
  LauncherCommandResult,
  LauncherImage,
  LauncherProcess,
  LauncherTemplate,
} from "@evref-bl/pharo-launcher-mcp/launcher";

Scope is a config, not a process. A caller that works inside a profile passes the environment that describes it, instead of spawning a process to hold those variables:

const scoped = openPharoLauncher({
  env: { PHARO_LAUNCHER_MCP_PROFILE: "isolated", PHARO_LAUNCHER_MCP_STATE_ROOT: stateRoot },
});

The MCP server is an adapter over the same functions, so a host that embeds it rather than spawning it imports that instead:

import { callTool, createServer } from "@evref-bl/pharo-launcher-mcp";
import { loadPharoLauncherConfig } from "@evref-bl/pharo-launcher-mcp/config";
import { defaultLauncherDir } from "@evref-bl/pharo-launcher-mcp/platform";

The executable is reachable as a command, not as an import: loading it starts a server on stdio.

Terms

  • A Pharo Launcher installation is the app or data directory, VM executable, control image, and launcher wrapper used to run Launcher commands.
  • A launcher state scope is the set of image, VM, template-source, init-script, and log directories affected by Launcher commands.
  • No-profile mode uses the user's normal Pharo Launcher installation and state scope directly.
  • A pharo-launcher-mcp profile is an explicit isolated state scope selected through environment variables.
  • A launcher tool result is the normalized JSON envelope returned by most tools. It includes parsed data when available, raw stdout/stderr, parser status, command duration, exit code, and timeout state.

Quick Start

Check what installation the server will use without invoking Pharo Launcher:

npx @evref-bl/pharo-launcher-mcp --health

If the discovered paths are not right, set the installation paths explicitly:

PHARO_LAUNCHER_DIR="/path/to/Pharo Launcher"
PHARO_LAUNCHER_VM="/path/to/pharo"
PHARO_LAUNCHER_IMAGE="/path/to/PharoLauncher.image"
npx @evref-bl/pharo-launcher-mcp --health

Configure an MCP client to start the stdio server. A generic MCP configuration looks like this:

{
  "mcpServers": {
    "pharo-launcher": {
      "command": "npx",
      "args": ["-y", "@evref-bl/pharo-launcher-mcp"]
    }
  }
}

Once connected, start with these tools:

pharo_launcher_config
pharo_launcher_image_list
pharo_launcher_template_list

pharo_launcher_config only inspects resolved configuration; the other two cross the live Launcher boundary.

Checking the installation before connecting is the executable's job, not a tool's. pharo-launcher-mcp --health, --version-check, --validate-installation and --probe-images each print JSON and exit.

Profile Quick Start

Use a profile when automation or tests need an isolated Launcher state scope:

PHARO_LAUNCHER_MCP_PROFILE=isolated
PHARO_LAUNCHER_MCP_STATE_ROOT=/path/to/launcher-profile
npx @evref-bl/pharo-launcher-mcp --health

In profile mode, pharo-launcher-mcp copies the Launcher control image into the profile root when needed, creates profile directories, and writes a Launcher CLI configuration that points images, VMs, templates, init scripts, and logs at that profile. No-profile mode stays inactive unless one of the profile environment variables is set.

Read Profile mode before using profiles for live image creation, launch, or cleanup.

Common Workflows

List available templates:

pharo_launcher_template_update
pharo_launcher_template_list

Create an image from a template:

{
  "tool": "pharo_launcher_image_create",
  "arguments": {
    "templateName": "Pharo 13.0 - 64bit",
    "newImageName": "sample-130",
    "noLaunch": true
  }
}

Copy an image:

{
  "tool": "pharo_launcher_image_copy",
  "arguments": {
    "imageName": "sample-130",
    "newImageName": "sample-130-copy"
  }
}

Launch an image:

{
  "tool": "pharo_launcher_image_start",
  "arguments": {
    "imageName": "sample-130-copy",
    "displayMode": "headless",
    "detached": true
  }
}

Safety Model

Mutating tools are explicit, and name what they act on. There is no confirmation argument: calling a tool is the decision to call it, and a second spelling of the same intent protects nothing.

What does protect something is the target. pharo_launcher_process_kill requires exactly one of pid or imageName, and a PID stops that process alone. Prefer the PID a detached launch returned when cleaning up a launch you own.

pharo_launcher_image_create and pharo_launcher_image_copy verify the target image after Launcher reports success. If the target image cannot be listed and inspected, the MCP result is an error with the command output and verification diagnostics.

Documentation

  • Getting started covers installation, environment discovery, MCP client setup, and the first health checks.
  • Profile mode explains no-profile mode, isolated profiles, profile paths, generated configuration, and cross-profile image copy.
  • Tool reference lists the MCP tools, arguments, result envelope, and special behaviors.
  • Troubleshooting maps common setup and live Launcher failures to concrete checks.
  • Development covers source layout, tests, local probes, and live test boundaries.
  • Cleanup hook boundary describes the status, timeout, stop, and cleanup contract for caller-managed live checks.

Source Development

npm install
npm run check

npm run check runs type checking, build, and unit tests. Live integration tests are separate because they invoke a local Pharo Launcher installation:

npm run test:integration

版本与发布记录

@evref-bl/pharo-launcher-mcp 共发布 8 个版本,首次发布于 2026/04/27;过去 12 个月发布了 8 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.4.1latest2026/11/113 天前
0.4.02026/11/0311 天前
0.3.02026/11/0112 天前
0.2.02026/11/0112 天前
0.1.42026/10/2619 天前
0.1.32026/06/035 个月前

关于 @evref-bl/pharo-launcher-mcp 的常见问题

@evref-bl/pharo-launcher-mcp 是什么?

MCP server for controlling Pharo Launcher images, templates, VMs, and processes.

如何安装 @evref-bl/pharo-launcher-mcp?

在项目目录运行 npm install @evref-bl/pharo-launcher-mcp,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 pharo-launcher-mcp,可以用 npx pharo-launcher-mcp 直接运行。

@evref-bl/pharo-launcher-mcp 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@evref-bl/pharo-launcher-mcp 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@evref-bl/pharo-launcher-mcp 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.12.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@evref-bl/pharo-launcher-mcp 可以商用吗?

@evref-bl/pharo-launcher-mcp 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@evref-bl/pharo-launcher-mcp 的下载量有多少?

根据 npm 官方下载统计,@evref-bl/pharo-launcher-mcp 在 2026/10/14 – 2026/11/12 这 30 天内被下载 2,705 次,日均约 90 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@evref-bl/pharo-launcher-mcp 还在维护吗?

最新版本 0.4.1 发布于 2026/11/11(3 天前);至今共发布 8 个版本,其中过去 12 个月发布了 8 个;首次发布于 2026/04/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。