@air-jam/mcp-server 0.9.1 → 0.9.3
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 +49 -0
- package/bin/airjam-mcp.mjs +37 -15
- package/dist/cli.js +337 -7876
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +1 -13
- package/dist/config.js +12 -251
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +321 -7707
- package/dist/index.js.map +1 -1
- package/dist/server.js +307 -7650
- package/dist/server.js.map +1 -1
- package/dist/tools.js +289 -7643
- package/dist/tools.js.map +1 -1
- package/package.json +16 -12
- package/src/cli.ts +8 -1
- package/src/config.ts +15 -71
- package/src/index.ts +0 -1
- package/src/server.ts +3 -2
- package/src/tools.ts +132 -125
- package/src/version.ts +15 -0
- package/tool-contract.json +61 -0
- package/dist/types.d.ts +0 -18
- package/dist/types.js +0 -1
- package/dist/types.js.map +0 -1
- package/src/types.ts +0 -17
package/package.json
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@air-jam/mcp-server",
|
|
3
|
-
"version": "0.9.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.9.3",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": ">=22.0.0"
|
|
6
|
+
},
|
|
7
|
+
"description": "Official Air Jam MCP server for project inspection, semantic game sessions, quality gates, and releases",
|
|
5
8
|
"private": false,
|
|
6
9
|
"type": "module",
|
|
7
10
|
"license": "MIT",
|
|
8
11
|
"repository": {
|
|
9
12
|
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/vucinatim/
|
|
13
|
+
"url": "git+https://github.com/vucinatim/air-jam.git",
|
|
11
14
|
"directory": "packages/mcp-server"
|
|
12
15
|
},
|
|
13
|
-
"homepage": "https://github.com/vucinatim/
|
|
16
|
+
"homepage": "https://github.com/vucinatim/air-jam#readme",
|
|
14
17
|
"bugs": {
|
|
15
|
-
"url": "https://github.com/vucinatim/
|
|
18
|
+
"url": "https://github.com/vucinatim/air-jam/issues"
|
|
16
19
|
},
|
|
17
20
|
"publishConfig": {
|
|
18
21
|
"access": "public"
|
|
@@ -24,6 +27,7 @@
|
|
|
24
27
|
"module": "./dist/index.js",
|
|
25
28
|
"types": "./dist/index.d.ts",
|
|
26
29
|
"exports": {
|
|
30
|
+
"./tool-contract": "./tool-contract.json",
|
|
27
31
|
".": {
|
|
28
32
|
"types": "./dist/index.d.ts",
|
|
29
33
|
"import": "./dist/index.js"
|
|
@@ -36,24 +40,24 @@
|
|
|
36
40
|
"files": [
|
|
37
41
|
"bin",
|
|
38
42
|
"dist",
|
|
39
|
-
"src"
|
|
43
|
+
"src",
|
|
44
|
+
"tool-contract.json"
|
|
40
45
|
],
|
|
41
46
|
"dependencies": {
|
|
42
|
-
"@
|
|
43
|
-
"
|
|
47
|
+
"@air-jam/devtools": "0.9.3",
|
|
48
|
+
"@modelcontextprotocol/sdk": "1.32.1",
|
|
44
49
|
"zod": "^4.2.1"
|
|
45
50
|
},
|
|
46
51
|
"devDependencies": {
|
|
47
52
|
"@types/node": "^24.10.1",
|
|
48
53
|
"tsup": "^8.5.1",
|
|
49
|
-
"tsx": "^4.20.6",
|
|
50
54
|
"typescript": "~5.9.3",
|
|
51
55
|
"vitest": "^3.2.4"
|
|
52
56
|
},
|
|
53
57
|
"scripts": {
|
|
54
|
-
"build": "node ../../scripts/ensure-workspace-package-build.mjs @air-jam/devtools
|
|
55
|
-
"test": "
|
|
58
|
+
"build": "node ../../scripts/ensure-workspace-package-build.mjs @air-jam/devtools && tsup",
|
|
59
|
+
"test": "pnpm build && vitest run --config vitest.config.ts",
|
|
56
60
|
"test:watch": "vitest --config vitest.config.ts",
|
|
57
|
-
"typecheck": "node ../../scripts/ensure-workspace-package-build.mjs @air-jam/
|
|
61
|
+
"typecheck": "node ../../scripts/ensure-workspace-package-build.mjs @air-jam/mcp-server && tsc --noEmit && tsc -p tests/tsconfig.json --noEmit"
|
|
58
62
|
}
|
|
59
63
|
}
|
package/src/cli.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
2
|
+
import { AIR_JAM_MCP_SERVER_VERSION } from "./version.js";
|
|
2
3
|
|
|
3
4
|
const HELP_TEXT = `Usage: airjam-mcp [options]
|
|
4
5
|
|
|
5
6
|
Official Air Jam MCP server
|
|
6
7
|
|
|
7
8
|
Options:
|
|
8
|
-
--help
|
|
9
|
+
-h, --help Show this help text
|
|
10
|
+
-V, --version Show the installed package version
|
|
9
11
|
`;
|
|
10
12
|
|
|
11
13
|
const argv = process.argv.slice(2);
|
|
@@ -15,6 +17,11 @@ if (argv.includes("--help") || argv.includes("-h")) {
|
|
|
15
17
|
process.exit(0);
|
|
16
18
|
}
|
|
17
19
|
|
|
20
|
+
if (argv.includes("--version") || argv.includes("-V")) {
|
|
21
|
+
process.stdout.write(`${AIR_JAM_MCP_SERVER_VERSION}\n`);
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
|
|
18
25
|
const { createAirJamMcpServer } = await import("./server.js");
|
|
19
26
|
const server = await createAirJamMcpServer();
|
|
20
27
|
const transport = new StdioServerTransport();
|
package/src/config.ts
CHANGED
|
@@ -1,73 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export {
|
|
2
|
+
AIRJAM_CODEX_PROJECT_MCP_FILE,
|
|
3
|
+
AIRJAM_PROJECT_MCP_FILE,
|
|
4
|
+
createAirJamMcpServerDeclaration,
|
|
5
|
+
createProjectLocalMcpConfig,
|
|
6
|
+
inspectMcpProjectSetup,
|
|
7
|
+
renderMcpClientProfile,
|
|
8
|
+
writeProjectLocalMcpConfig,
|
|
9
|
+
} from "@air-jam/devtools/mcp-config";
|
|
10
|
+
export type {
|
|
11
|
+
AirJamMcpClientProfile,
|
|
12
|
+
AirJamMcpClientProfileRender,
|
|
13
|
+
AirJamMcpRegistrationInspection,
|
|
14
|
+
AirJamMcpServerDeclaration,
|
|
5
15
|
AirJamProjectLocalMcpConfig,
|
|
6
16
|
InspectMcpProjectSetupResult,
|
|
7
|
-
} from "
|
|
8
|
-
|
|
9
|
-
export const AIRJAM_PROJECT_MCP_FILE = ".mcp.json";
|
|
10
|
-
|
|
11
|
-
export const createProjectLocalMcpConfig = (): AirJamProjectLocalMcpConfig => ({
|
|
12
|
-
mcpServers: {
|
|
13
|
-
airjam: {
|
|
14
|
-
command: "pnpm",
|
|
15
|
-
args: ["exec", "airjam-mcp"],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const pathExists = async (targetPath: string): Promise<boolean> => {
|
|
21
|
-
try {
|
|
22
|
-
await access(targetPath);
|
|
23
|
-
return true;
|
|
24
|
-
} catch {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const inspectMcpProjectSetup = async ({
|
|
30
|
-
cwd = process.cwd(),
|
|
31
|
-
}: {
|
|
32
|
-
cwd?: string;
|
|
33
|
-
} = {}): Promise<InspectMcpProjectSetupResult> => {
|
|
34
|
-
const project = await inspectProject({ cwd });
|
|
35
|
-
const configPath = path.join(
|
|
36
|
-
project.context.rootDir,
|
|
37
|
-
AIRJAM_PROJECT_MCP_FILE,
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
projectDir: project.context.rootDir,
|
|
42
|
-
configPath,
|
|
43
|
-
hasConfigFile: await pathExists(configPath),
|
|
44
|
-
hasMcpScript: Boolean(project.scripts.mcp),
|
|
45
|
-
hasMcpDependency: Boolean(project.airJamPackages["@air-jam/mcp-server"]),
|
|
46
|
-
recommendedConfig: createProjectLocalMcpConfig(),
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const writeProjectLocalMcpConfig = async ({
|
|
51
|
-
cwd = process.cwd(),
|
|
52
|
-
force = false,
|
|
53
|
-
}: {
|
|
54
|
-
cwd?: string;
|
|
55
|
-
force?: boolean;
|
|
56
|
-
} = {}): Promise<InspectMcpProjectSetupResult> => {
|
|
57
|
-
const inspection = await inspectMcpProjectSetup({ cwd });
|
|
58
|
-
|
|
59
|
-
if (inspection.hasConfigFile && !force) {
|
|
60
|
-
throw new Error(
|
|
61
|
-
`MCP config already exists at ${inspection.configPath}. Re-run with force to overwrite it.`,
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
await mkdir(path.dirname(inspection.configPath), { recursive: true });
|
|
66
|
-
await writeFile(
|
|
67
|
-
inspection.configPath,
|
|
68
|
-
`${JSON.stringify(inspection.recommendedConfig, null, 2)}\n`,
|
|
69
|
-
"utf8",
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
return inspectMcpProjectSetup({ cwd });
|
|
73
|
-
};
|
|
17
|
+
} from "@air-jam/devtools/mcp-config";
|
package/src/index.ts
CHANGED
package/src/server.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { detectProjectContext } from "@air-jam/devtools
|
|
1
|
+
import { detectProjectContext } from "@air-jam/devtools/context";
|
|
2
2
|
import type {
|
|
3
3
|
CreateTaskRequestHandlerExtra,
|
|
4
4
|
TaskRequestHandlerExtra,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
buildToolDefinitions,
|
|
11
11
|
getRegisteredToolNamesForProjectMode,
|
|
12
12
|
} from "./tools.js";
|
|
13
|
+
import { AIR_JAM_MCP_SERVER_VERSION } from "./version.js";
|
|
13
14
|
|
|
14
15
|
const DEFAULT_TASK_TTL_MS = 5 * 60 * 1000;
|
|
15
16
|
const TASK_CAPABLE_CLIENT_NOTE =
|
|
@@ -55,7 +56,7 @@ export const createAirJamMcpServer = async ({
|
|
|
55
56
|
const server = new McpServer(
|
|
56
57
|
{
|
|
57
58
|
name: "air-jam",
|
|
58
|
-
version:
|
|
59
|
+
version: AIR_JAM_MCP_SERVER_VERSION,
|
|
59
60
|
},
|
|
60
61
|
{
|
|
61
62
|
capabilities: {
|
package/src/tools.ts
CHANGED
|
@@ -1,46 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "@air-jam/devtools-core/agent";
|
|
4
|
-
import { inspectProject } from "@air-jam/devtools-core/context";
|
|
1
|
+
import { inspectGameAgentContract } from "@air-jam/devtools/agent";
|
|
2
|
+
import { inspectProject } from "@air-jam/devtools/context";
|
|
5
3
|
import {
|
|
6
4
|
getDevStatus,
|
|
7
5
|
getTopology,
|
|
8
6
|
resetLocalDev,
|
|
9
7
|
startDev,
|
|
10
8
|
stopDev,
|
|
11
|
-
} from "@air-jam/devtools
|
|
9
|
+
} from "@air-jam/devtools/dev";
|
|
12
10
|
import {
|
|
11
|
+
captureGameSessionVisuals,
|
|
13
12
|
closeGameSession,
|
|
14
13
|
invokeGameSessionAction,
|
|
15
14
|
openGameSession,
|
|
16
15
|
readGameSession,
|
|
17
16
|
sendGameSessionInput,
|
|
18
|
-
} from "@air-jam/devtools
|
|
17
|
+
} from "@air-jam/devtools/game-session";
|
|
18
|
+
import { inspectGame, listGames } from "@air-jam/devtools/games";
|
|
19
|
+
import { readDevLogs } from "@air-jam/devtools/logs";
|
|
20
|
+
import { getPlatformMachineAuthStatus } from "@air-jam/devtools/platform-auth";
|
|
19
21
|
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
readVisualCaptureSummary,
|
|
24
|
-
} from "@air-jam/devtools-core/games";
|
|
25
|
-
import { readDevLogs } from "@air-jam/devtools-core/logs";
|
|
26
|
-
import { getPlatformMachineAuthStatus } from "@air-jam/devtools-core/platform-auth";
|
|
27
|
-
import { runQualityGate } from "@air-jam/devtools-core/quality";
|
|
22
|
+
runCompleteEvaluation,
|
|
23
|
+
runQualityGate,
|
|
24
|
+
} from "@air-jam/devtools/quality";
|
|
28
25
|
import {
|
|
29
26
|
bundleLocalRelease,
|
|
27
|
+
exportPlatformReleaseGeneration,
|
|
28
|
+
finalizePlatformReleaseGeneration,
|
|
30
29
|
inspectLocalRelease,
|
|
31
30
|
inspectPlatformRelease,
|
|
32
31
|
listPlatformReleaseTargets,
|
|
33
32
|
listPlatformReleases,
|
|
34
33
|
publishPlatformRelease,
|
|
35
34
|
submitPlatformRelease,
|
|
35
|
+
uploadPlatformReleaseGeneration,
|
|
36
36
|
validateLocalRelease,
|
|
37
|
-
} from "@air-jam/devtools
|
|
38
|
-
import {
|
|
39
|
-
captureVisuals,
|
|
40
|
-
listVisualScenarios,
|
|
41
|
-
} from "@air-jam/devtools-core/visual";
|
|
37
|
+
} from "@air-jam/devtools/release";
|
|
42
38
|
import type { ToolExecution } from "@modelcontextprotocol/sdk/types.js";
|
|
43
39
|
import { z } from "zod";
|
|
40
|
+
import toolContract from "../tool-contract.json" with { type: "json" };
|
|
44
41
|
|
|
45
42
|
type AirJamProjectMode = "monorepo" | "standalone-game" | "unknown";
|
|
46
43
|
type AirJamQualityGate =
|
|
@@ -119,19 +116,7 @@ const buildTopologySchema = (projectMode: AirJamProjectMode) =>
|
|
|
119
116
|
secure: z.boolean().optional(),
|
|
120
117
|
});
|
|
121
118
|
|
|
122
|
-
const
|
|
123
|
-
z.object({
|
|
124
|
-
cwd: z.string().optional(),
|
|
125
|
-
gameId: z.string().optional(),
|
|
126
|
-
scenarioId: z.string().optional(),
|
|
127
|
-
mode:
|
|
128
|
-
projectMode === "monorepo"
|
|
129
|
-
? z.enum(["standalone-dev", "arcade-test"]).optional()
|
|
130
|
-
: z.literal("standalone-dev").optional(),
|
|
131
|
-
secure: z.boolean().optional(),
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
const buildHarnessModeSchema = (projectMode: AirJamProjectMode) =>
|
|
119
|
+
const buildGameSessionModeSchema = (projectMode: AirJamProjectMode) =>
|
|
135
120
|
projectMode === "monorepo"
|
|
136
121
|
? z.enum(["standalone-dev", "arcade-dev", "arcade-test"]).optional()
|
|
137
122
|
: z.literal("standalone-dev").optional();
|
|
@@ -170,9 +155,29 @@ const RELEASE_SUBMIT_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({
|
|
|
170
155
|
distDir: z.string().optional(),
|
|
171
156
|
bundle: z.string().optional(),
|
|
172
157
|
skipBuild: z.boolean().optional(),
|
|
158
|
+
waitForProcessing: z.boolean().optional(),
|
|
159
|
+
processingTimeoutSeconds: z.number().int().min(1).max(3_600).optional(),
|
|
173
160
|
publish: z.boolean().optional(),
|
|
174
161
|
});
|
|
175
162
|
|
|
163
|
+
const RELEASE_UPLOAD_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({
|
|
164
|
+
releaseId: z.string().min(1),
|
|
165
|
+
cwd: z.string().optional(),
|
|
166
|
+
bundle: z.string().min(1),
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
const RELEASE_FINALIZE_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({
|
|
170
|
+
releaseId: z.string().min(1),
|
|
171
|
+
generationId: z.string().min(1),
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
const RELEASE_EXPORT_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({
|
|
175
|
+
releaseId: z.string().min(1),
|
|
176
|
+
generationId: z.string().min(1),
|
|
177
|
+
cwd: z.string().optional(),
|
|
178
|
+
out: z.string().optional(),
|
|
179
|
+
});
|
|
180
|
+
|
|
176
181
|
const RELEASE_PUBLISH_INPUT_SCHEMA = RELEASE_PLATFORM_INPUT_SCHEMA.extend({
|
|
177
182
|
releaseId: z.string().min(1),
|
|
178
183
|
});
|
|
@@ -209,10 +214,9 @@ const buildConnectControllerSchema = (projectMode: AirJamProjectMode) =>
|
|
|
209
214
|
z.object({
|
|
210
215
|
cwd: z.string().optional(),
|
|
211
216
|
gameId: z.string().optional(),
|
|
212
|
-
mode:
|
|
217
|
+
mode: buildGameSessionModeSchema(projectMode),
|
|
213
218
|
secure: z.boolean().optional(),
|
|
214
219
|
roomId: z.string().min(1).optional(),
|
|
215
|
-
harnessSessionId: z.string().min(1).optional(),
|
|
216
220
|
controllerJoinUrl: z.string().url().optional(),
|
|
217
221
|
controllerId: z.string().min(3).optional(),
|
|
218
222
|
deviceId: z.string().min(8).optional(),
|
|
@@ -230,12 +234,15 @@ export const buildToolDefinitions = ({
|
|
|
230
234
|
const runQualityGateInputSchema = buildQualityGateSchema(projectMode);
|
|
231
235
|
const startDevInputSchema = buildStartDevSchema(projectMode);
|
|
232
236
|
const topologyInputSchema = buildTopologySchema(projectMode);
|
|
233
|
-
const captureVisualsInputSchema = buildCaptureVisualsSchema(projectMode);
|
|
234
237
|
const inspectGameAgentContractInputSchema = z.object({
|
|
235
238
|
cwd: z.string().optional(),
|
|
236
239
|
gameId: z.string().optional(),
|
|
237
240
|
});
|
|
238
241
|
const openGameSessionInputSchema = buildConnectControllerSchema(projectMode);
|
|
242
|
+
const captureGameSessionInputSchema = z.object({
|
|
243
|
+
gameSessionId: z.string().uuid(),
|
|
244
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
245
|
+
});
|
|
239
246
|
const gameSessionInputSchema = z.object({
|
|
240
247
|
gameSessionId: z.string().min(1),
|
|
241
248
|
});
|
|
@@ -299,6 +306,13 @@ export const buildToolDefinitions = ({
|
|
|
299
306
|
run: async (input: z.infer<typeof runQualityGateInputSchema>) =>
|
|
300
307
|
withJsonText(await runQualityGate(input)),
|
|
301
308
|
},
|
|
309
|
+
"airjam.evaluate": {
|
|
310
|
+
description:
|
|
311
|
+
"Run the complete Air Jam game evaluation: typecheck, lint, tests, and a production build. Returns every gate result in one stable document.",
|
|
312
|
+
inputSchema: z.object({ cwd: z.string().optional() }),
|
|
313
|
+
run: async ({ cwd }: { cwd?: string }) =>
|
|
314
|
+
withJsonText(await runCompleteEvaluation({ cwd })),
|
|
315
|
+
},
|
|
302
316
|
"airjam.auth_status": {
|
|
303
317
|
description:
|
|
304
318
|
"Inspect the locally stored Air Jam platform machine session used for hosted release operations.",
|
|
@@ -389,9 +403,72 @@ export const buildToolDefinitions = ({
|
|
|
389
403
|
}),
|
|
390
404
|
),
|
|
391
405
|
},
|
|
406
|
+
"airjam.release_upload": {
|
|
407
|
+
description:
|
|
408
|
+
"Upload an existing hosted release zip as a new immutable generation and return the exact generation needed for resumable finalization.",
|
|
409
|
+
inputSchema: RELEASE_UPLOAD_INPUT_SCHEMA,
|
|
410
|
+
execution: {
|
|
411
|
+
taskSupport: "required",
|
|
412
|
+
},
|
|
413
|
+
run: async ({
|
|
414
|
+
platformUrl,
|
|
415
|
+
releaseId,
|
|
416
|
+
cwd,
|
|
417
|
+
bundle,
|
|
418
|
+
}: z.infer<typeof RELEASE_UPLOAD_INPUT_SCHEMA>) =>
|
|
419
|
+
withJsonText(
|
|
420
|
+
await uploadPlatformReleaseGeneration({
|
|
421
|
+
platformUrl,
|
|
422
|
+
releaseId,
|
|
423
|
+
cwd,
|
|
424
|
+
bundlePath: bundle,
|
|
425
|
+
}),
|
|
426
|
+
),
|
|
427
|
+
},
|
|
428
|
+
"airjam.release_finalize": {
|
|
429
|
+
description:
|
|
430
|
+
"Durably enqueue processing for one exact immutable hosted release generation and return its job; use release inspection to follow or recover it.",
|
|
431
|
+
inputSchema: RELEASE_FINALIZE_INPUT_SCHEMA,
|
|
432
|
+
run: async ({
|
|
433
|
+
platformUrl,
|
|
434
|
+
releaseId,
|
|
435
|
+
generationId,
|
|
436
|
+
}: z.infer<typeof RELEASE_FINALIZE_INPUT_SCHEMA>) =>
|
|
437
|
+
withJsonText(
|
|
438
|
+
await finalizePlatformReleaseGeneration({
|
|
439
|
+
platformUrl,
|
|
440
|
+
releaseId,
|
|
441
|
+
generationId,
|
|
442
|
+
}),
|
|
443
|
+
),
|
|
444
|
+
},
|
|
445
|
+
"airjam.release_export": {
|
|
446
|
+
description:
|
|
447
|
+
"Download one exact immutable hosted release generation without overwriting an existing local archive.",
|
|
448
|
+
inputSchema: RELEASE_EXPORT_INPUT_SCHEMA,
|
|
449
|
+
execution: {
|
|
450
|
+
taskSupport: "required",
|
|
451
|
+
},
|
|
452
|
+
run: async ({
|
|
453
|
+
platformUrl,
|
|
454
|
+
releaseId,
|
|
455
|
+
generationId,
|
|
456
|
+
cwd,
|
|
457
|
+
out,
|
|
458
|
+
}: z.infer<typeof RELEASE_EXPORT_INPUT_SCHEMA>) =>
|
|
459
|
+
withJsonText(
|
|
460
|
+
await exportPlatformReleaseGeneration({
|
|
461
|
+
platformUrl,
|
|
462
|
+
releaseId,
|
|
463
|
+
generationId,
|
|
464
|
+
cwd,
|
|
465
|
+
out,
|
|
466
|
+
}),
|
|
467
|
+
),
|
|
468
|
+
},
|
|
392
469
|
"airjam.release_submit": {
|
|
393
470
|
description:
|
|
394
|
-
"Bundle a standalone Air Jam game if needed, upload it as a hosted release draft,
|
|
471
|
+
"Bundle a standalone Air Jam game if needed, upload it as a hosted release draft, enqueue durable processing, optionally wait, and optionally publish after readiness.",
|
|
395
472
|
inputSchema: RELEASE_SUBMIT_INPUT_SCHEMA,
|
|
396
473
|
execution: {
|
|
397
474
|
taskSupport: "required",
|
|
@@ -404,6 +481,8 @@ export const buildToolDefinitions = ({
|
|
|
404
481
|
distDir,
|
|
405
482
|
bundle,
|
|
406
483
|
skipBuild,
|
|
484
|
+
waitForProcessing,
|
|
485
|
+
processingTimeoutSeconds,
|
|
407
486
|
publish,
|
|
408
487
|
}: z.infer<typeof RELEASE_SUBMIT_INPUT_SCHEMA>) =>
|
|
409
488
|
withJsonText(
|
|
@@ -415,6 +494,10 @@ export const buildToolDefinitions = ({
|
|
|
415
494
|
distDir,
|
|
416
495
|
bundlePath: bundle,
|
|
417
496
|
skipBuild,
|
|
497
|
+
waitForProcessing,
|
|
498
|
+
...(processingTimeoutSeconds === undefined
|
|
499
|
+
? {}
|
|
500
|
+
: { processingTimeoutMs: processingTimeoutSeconds * 1_000 }),
|
|
418
501
|
publish,
|
|
419
502
|
}),
|
|
420
503
|
),
|
|
@@ -442,7 +525,7 @@ export const buildToolDefinitions = ({
|
|
|
442
525
|
},
|
|
443
526
|
"airjam.stop_dev": {
|
|
444
527
|
description:
|
|
445
|
-
"Stop one or more Air Jam dev processes previously started by devtools
|
|
528
|
+
"Stop one or more Air Jam dev processes previously started by devtools.",
|
|
446
529
|
inputSchema: STOP_DEV_INPUT_SCHEMA,
|
|
447
530
|
run: async (input: z.infer<typeof STOP_DEV_INPUT_SCHEMA>) =>
|
|
448
531
|
withJsonText(await stopDev(input)),
|
|
@@ -472,23 +555,6 @@ export const buildToolDefinitions = ({
|
|
|
472
555
|
run: async (input: z.infer<typeof topologyInputSchema>) =>
|
|
473
556
|
withJsonText(await getTopology(input)),
|
|
474
557
|
},
|
|
475
|
-
"airjam.list_visual_scenarios": {
|
|
476
|
-
description:
|
|
477
|
-
"Internal experimental visual harness tool: load one game's visual scenario pack and list scenario ids plus harness action metadata.",
|
|
478
|
-
inputSchema: INSPECT_GAME_INPUT_SCHEMA,
|
|
479
|
-
run: async ({ cwd, gameId }: { cwd?: string; gameId?: string }) =>
|
|
480
|
-
withJsonText(await listVisualScenarios({ cwd, gameId })),
|
|
481
|
-
},
|
|
482
|
-
"airjam.capture_visuals": {
|
|
483
|
-
description:
|
|
484
|
-
"Internal experimental visual harness tool: run Air Jam visual capture for one game and return artifact metadata and screenshot paths. Prefer embedded browser screenshots for normal visual proof.",
|
|
485
|
-
inputSchema: captureVisualsInputSchema,
|
|
486
|
-
execution: {
|
|
487
|
-
taskSupport: "required",
|
|
488
|
-
},
|
|
489
|
-
run: async (input: z.infer<typeof captureVisualsInputSchema>) =>
|
|
490
|
-
withJsonText(await captureVisuals(input)),
|
|
491
|
-
},
|
|
492
558
|
"airjam.open_game_session": {
|
|
493
559
|
description:
|
|
494
560
|
"Open one high-level Air Jam game session by connecting a virtual controller and discovering published semantic game actions for the same room.",
|
|
@@ -517,6 +583,13 @@ export const buildToolDefinitions = ({
|
|
|
517
583
|
run: async (input: z.infer<typeof invokeGameSessionActionInputSchema>) =>
|
|
518
584
|
withJsonText(await invokeGameSessionAction(input)),
|
|
519
585
|
},
|
|
586
|
+
"airjam.capture_game_session_visuals": {
|
|
587
|
+
description:
|
|
588
|
+
"Capture canonical host and controller screenshots from the browser runtime owned by an open game session.",
|
|
589
|
+
inputSchema: captureGameSessionInputSchema,
|
|
590
|
+
run: async (input: z.infer<typeof captureGameSessionInputSchema>) =>
|
|
591
|
+
withJsonText(await captureGameSessionVisuals(input)),
|
|
592
|
+
},
|
|
520
593
|
"airjam.close_game_session": {
|
|
521
594
|
description:
|
|
522
595
|
"Close one previously opened Air Jam game session and disconnect its virtual controller.",
|
|
@@ -524,22 +597,6 @@ export const buildToolDefinitions = ({
|
|
|
524
597
|
run: async ({ gameSessionId }: { gameSessionId: string }) =>
|
|
525
598
|
withJsonText(await closeGameSession({ gameSessionId })),
|
|
526
599
|
},
|
|
527
|
-
"airjam.list_visual_capture_summaries": {
|
|
528
|
-
description:
|
|
529
|
-
"Internal experimental visual harness tool: list existing visual capture summaries already written under .airjam/artifacts/visual.",
|
|
530
|
-
inputSchema: z.object({
|
|
531
|
-
cwd: z.string().optional(),
|
|
532
|
-
}),
|
|
533
|
-
run: async ({ cwd }: { cwd?: string }) =>
|
|
534
|
-
withJsonText(await listVisualCaptureSummaries({ cwd })),
|
|
535
|
-
},
|
|
536
|
-
"airjam.read_visual_capture_summary": {
|
|
537
|
-
description:
|
|
538
|
-
"Internal experimental visual harness tool: read one visual capture summary for a game from .airjam/artifacts/visual/<game>/capture-summary.json.",
|
|
539
|
-
inputSchema: INSPECT_GAME_INPUT_SCHEMA,
|
|
540
|
-
run: async ({ cwd, gameId }: { cwd?: string; gameId?: string }) =>
|
|
541
|
-
withJsonText(await readVisualCaptureSummary({ cwd, gameId })),
|
|
542
|
-
},
|
|
543
600
|
} as const;
|
|
544
601
|
};
|
|
545
602
|
|
|
@@ -548,59 +605,9 @@ export type AirJamMcpToolDefinitions = ReturnType<typeof buildToolDefinitions>;
|
|
|
548
605
|
export const getRegisteredToolNamesForProjectMode = (
|
|
549
606
|
projectMode: AirJamProjectMode,
|
|
550
607
|
): ReadonlyArray<keyof AirJamMcpToolDefinitions> => {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
"
|
|
555
|
-
|
|
556
|
-
"airjam.inspect_game",
|
|
557
|
-
"airjam.inspect_game_agent_contract",
|
|
558
|
-
"airjam.read_logs",
|
|
559
|
-
"airjam.run_quality_gate",
|
|
560
|
-
"airjam.release_list",
|
|
561
|
-
"airjam.release_inspect",
|
|
562
|
-
"airjam.release_publish",
|
|
563
|
-
"airjam.start_dev",
|
|
564
|
-
"airjam.stop_dev",
|
|
565
|
-
"airjam.status",
|
|
566
|
-
"airjam.reset_local",
|
|
567
|
-
"airjam.topology",
|
|
568
|
-
"airjam.open_game_session",
|
|
569
|
-
"airjam.send_game_session_input",
|
|
570
|
-
"airjam.read_game_session",
|
|
571
|
-
"airjam.invoke_game_session_action",
|
|
572
|
-
"airjam.close_game_session",
|
|
573
|
-
] as const;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
if (projectMode === "standalone-game") {
|
|
577
|
-
return [
|
|
578
|
-
"airjam.inspect_project",
|
|
579
|
-
"airjam.auth_status",
|
|
580
|
-
"airjam.list_games",
|
|
581
|
-
"airjam.inspect_game",
|
|
582
|
-
"airjam.inspect_game_agent_contract",
|
|
583
|
-
"airjam.read_logs",
|
|
584
|
-
"airjam.run_quality_gate",
|
|
585
|
-
"airjam.release_doctor",
|
|
586
|
-
"airjam.release_validate",
|
|
587
|
-
"airjam.release_bundle",
|
|
588
|
-
"airjam.release_list",
|
|
589
|
-
"airjam.release_inspect",
|
|
590
|
-
"airjam.release_submit",
|
|
591
|
-
"airjam.release_publish",
|
|
592
|
-
"airjam.start_dev",
|
|
593
|
-
"airjam.stop_dev",
|
|
594
|
-
"airjam.status",
|
|
595
|
-
"airjam.reset_local",
|
|
596
|
-
"airjam.topology",
|
|
597
|
-
"airjam.open_game_session",
|
|
598
|
-
"airjam.send_game_session_input",
|
|
599
|
-
"airjam.read_game_session",
|
|
600
|
-
"airjam.invoke_game_session_action",
|
|
601
|
-
"airjam.close_game_session",
|
|
602
|
-
] as const;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
return ["airjam.inspect_project"] as const;
|
|
608
|
+
const mode =
|
|
609
|
+
projectMode === "monorepo" || projectMode === "standalone-game"
|
|
610
|
+
? projectMode
|
|
611
|
+
: "unknown";
|
|
612
|
+
return toolContract[mode] as ReadonlyArray<keyof AirJamMcpToolDefinitions>;
|
|
606
613
|
};
|
package/src/version.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
|
|
3
|
+
type PackageManifest = {
|
|
4
|
+
version?: unknown;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const manifest = JSON.parse(
|
|
8
|
+
fs.readFileSync(new URL("../package.json", import.meta.url), "utf8"),
|
|
9
|
+
) as PackageManifest;
|
|
10
|
+
|
|
11
|
+
if (typeof manifest.version !== "string" || manifest.version.length === 0) {
|
|
12
|
+
throw new Error("@air-jam/mcp-server package version is missing.");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const AIR_JAM_MCP_SERVER_VERSION = manifest.version;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"monorepo": [
|
|
3
|
+
"airjam.inspect_project",
|
|
4
|
+
"airjam.auth_status",
|
|
5
|
+
"airjam.list_games",
|
|
6
|
+
"airjam.inspect_game",
|
|
7
|
+
"airjam.inspect_game_agent_contract",
|
|
8
|
+
"airjam.read_logs",
|
|
9
|
+
"airjam.run_quality_gate",
|
|
10
|
+
"airjam.evaluate",
|
|
11
|
+
"airjam.release_list",
|
|
12
|
+
"airjam.release_inspect",
|
|
13
|
+
"airjam.release_upload",
|
|
14
|
+
"airjam.release_finalize",
|
|
15
|
+
"airjam.release_export",
|
|
16
|
+
"airjam.release_publish",
|
|
17
|
+
"airjam.start_dev",
|
|
18
|
+
"airjam.stop_dev",
|
|
19
|
+
"airjam.status",
|
|
20
|
+
"airjam.reset_local",
|
|
21
|
+
"airjam.topology",
|
|
22
|
+
"airjam.open_game_session",
|
|
23
|
+
"airjam.send_game_session_input",
|
|
24
|
+
"airjam.read_game_session",
|
|
25
|
+
"airjam.invoke_game_session_action",
|
|
26
|
+
"airjam.capture_game_session_visuals",
|
|
27
|
+
"airjam.close_game_session"
|
|
28
|
+
],
|
|
29
|
+
"standalone-game": [
|
|
30
|
+
"airjam.inspect_project",
|
|
31
|
+
"airjam.auth_status",
|
|
32
|
+
"airjam.list_games",
|
|
33
|
+
"airjam.inspect_game",
|
|
34
|
+
"airjam.inspect_game_agent_contract",
|
|
35
|
+
"airjam.read_logs",
|
|
36
|
+
"airjam.run_quality_gate",
|
|
37
|
+
"airjam.evaluate",
|
|
38
|
+
"airjam.release_doctor",
|
|
39
|
+
"airjam.release_validate",
|
|
40
|
+
"airjam.release_bundle",
|
|
41
|
+
"airjam.release_list",
|
|
42
|
+
"airjam.release_inspect",
|
|
43
|
+
"airjam.release_upload",
|
|
44
|
+
"airjam.release_finalize",
|
|
45
|
+
"airjam.release_export",
|
|
46
|
+
"airjam.release_submit",
|
|
47
|
+
"airjam.release_publish",
|
|
48
|
+
"airjam.start_dev",
|
|
49
|
+
"airjam.stop_dev",
|
|
50
|
+
"airjam.status",
|
|
51
|
+
"airjam.reset_local",
|
|
52
|
+
"airjam.topology",
|
|
53
|
+
"airjam.open_game_session",
|
|
54
|
+
"airjam.send_game_session_input",
|
|
55
|
+
"airjam.read_game_session",
|
|
56
|
+
"airjam.invoke_game_session_action",
|
|
57
|
+
"airjam.capture_game_session_visuals",
|
|
58
|
+
"airjam.close_game_session"
|
|
59
|
+
],
|
|
60
|
+
"unknown": ["airjam.inspect_project"]
|
|
61
|
+
}
|