@air-jam/mcp-server 0.9.2 → 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ > **Prerelease `1.0.0-beta.1`** from Air Jam's `beta` channel. It is not stable and may change or break between prereleases; install `@latest` for the stable release.
2
+
3
+ # `@air-jam/mcp-server`
4
+
5
+ The official Air Jam MCP server exposes the same project, development,
6
+ evaluation, semantic game-session, and hosted-release services as the Air Jam
7
+ CLI.
8
+
9
+ ## Discover and connect
10
+
11
+ ```bash
12
+ pnpm exec airjam mcp doctor --dir . --json
13
+ pnpm exec airjam mcp config --profile portable --dir .
14
+ pnpm exec airjam-mcp
15
+ ```
16
+
17
+ The portable project declaration is `.mcp.json`. Codex and Claude Desktop can
18
+ also use their explicit profiles through `airjam mcp config`.
19
+
20
+ For Claude Desktop, generate the client-global configuration for your game:
21
+
22
+ ```bash
23
+ pnpm exec airjam mcp config --profile claude-desktop --dir . --json
24
+ ```
25
+
26
+ The result includes the destination `configPath` and JSON `content`. In
27
+ Claude Desktop's **Settings > Developer > Edit config**, merge the `airjam`
28
+ entry into `mcpServers`, preserving any existing connectors. Restart Desktop
29
+ and check the server's connection status in Developer settings. This profile
30
+ pins the game's absolute directory so Desktop can find its installed MCP
31
+ package regardless of where the app launches. The `pnpm` executable must be
32
+ available to Desktop; if it cannot find it, use its absolute executable path
33
+ in the entry's `command` field.
34
+
35
+ Rendering a profile does not install it. `claude mcp add` registers a server
36
+ with Claude Code, not Claude Desktop. Use `airjam mcp doctor --dir . --json`
37
+ to inspect registration; registration alone does not prove a live connection.
38
+
39
+ ## Complete evaluation
40
+
41
+ Call `airjam.evaluate` before sharing a game and again after any repair. It
42
+ runs typecheck, lint, tests, and the production build, returning one stable
43
+ `air-jam-complete-evaluation/v1` result. Use `airjam.run_quality_gate` when you
44
+ only need to narrow a failure.
45
+
46
+ For reliable gameplay assertions, use `airjam.open_game_session`,
47
+ `airjam.read_game_session`, `airjam.invoke_game_session_action`, and
48
+ `airjam.close_game_session`. Use `airjam.capture_game_session_visuals` to
49
+ capture the owning room's canonical host and controller views when the client
50
+ cannot launch its own browser. Browser interaction remains visual proof rather
51
+ than the primary automation lane.
52
+
53
+ ## Hosted releases
54
+
55
+ `airjam.release_inspect` and `airjam.release_list` return exact `playUrl` links,
56
+ including hidden live releases. `airjam.release_archive` accepts `releaseId` and
57
+ optional `platformUrl`, uses the same owner-checked service as Create's
58
+ **Releases** section, and returns the updated release. Archiving retires the release; it
59
+ does not publish anything. See the [hosted release guide](../../docs/guides/hosted-release-guide.md).
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ import { spawn } from "node:child_process";
3
4
  import { existsSync } from "node:fs";
4
5
  import path from "node:path";
5
- import { spawn } from "node:child_process";
6
6
  import { fileURLToPath, pathToFileURL } from "node:url";
7
7
 
8
8
  const packageRoot = path.resolve(
@@ -10,35 +10,57 @@ const packageRoot = path.resolve(
10
10
  "..",
11
11
  );
12
12
  const distEntry = path.join(packageRoot, "dist", "cli.js");
13
- const sourceEntry = path.join(packageRoot, "src", "cli.ts");
13
+ const repoRoot = path.resolve(packageRoot, "../..");
14
+ const workspaceBuildScript = path.join(
15
+ repoRoot,
16
+ "scripts",
17
+ "ensure-workspace-package-build.mjs",
18
+ );
19
+
20
+ const buildWorkspacePackage = async () => {
21
+ if (!existsSync(workspaceBuildScript)) {
22
+ throw new Error(
23
+ "The installed @air-jam/mcp-server package is missing its built CLI entrypoint.",
24
+ );
25
+ }
14
26
 
15
- const forwardToSourceCli = async () =>
16
- new Promise((resolve, reject) => {
27
+ await new Promise((resolve, reject) => {
17
28
  const child = spawn(
18
29
  process.execPath,
19
- ["--import", "tsx", sourceEntry, ...process.argv.slice(2)],
30
+ [workspaceBuildScript, "@air-jam/mcp-server"],
20
31
  {
21
- cwd: packageRoot,
32
+ cwd: repoRoot,
22
33
  stdio: "inherit",
23
34
  env: process.env,
24
35
  },
25
36
  );
26
37
 
27
38
  child.on("exit", (code, signal) => {
28
- if (signal) {
29
- process.kill(process.pid, signal);
39
+ if (code === 0) {
40
+ resolve(undefined);
30
41
  return;
31
42
  }
32
43
 
33
- process.exitCode = code ?? 0;
34
- resolve(undefined);
44
+ reject(
45
+ new Error(
46
+ signal
47
+ ? `Workspace MCP build terminated by signal ${signal}.`
48
+ : `Workspace MCP build exited with code ${code}.`,
49
+ ),
50
+ );
35
51
  });
36
-
37
52
  child.on("error", reject);
38
53
  });
54
+ };
55
+
56
+ if (!existsSync(distEntry)) {
57
+ await buildWorkspacePackage();
58
+ }
39
59
 
40
- if (existsSync(distEntry)) {
41
- await import(pathToFileURL(distEntry).href);
42
- } else {
43
- await forwardToSourceCli();
60
+ if (!existsSync(distEntry)) {
61
+ throw new Error(
62
+ "The @air-jam/mcp-server build completed without producing dist/cli.js.",
63
+ );
44
64
  }
65
+
66
+ await import(pathToFileURL(distEntry).href);