@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 +59 -0
- package/bin/airjam-mcp.mjs +37 -15
- package/dist/cli.js +481 -7898
- 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 +459 -7727
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +2 -1
- package/dist/server.js +445 -7670
- package/dist/server.js.map +1 -1
- package/dist/tools.d.ts +2 -7
- package/dist/tools.js +407 -7663
- package/dist/tools.js.map +1 -1
- package/package.json +13 -9
- package/src/cli.ts +13 -2
- package/src/config.ts +15 -71
- package/src/index.ts +0 -1
- package/src/server.ts +30 -2
- package/src/tools.ts +274 -177
- package/src/version.ts +15 -0
- package/tool-contract.json +83 -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,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@air-jam/mcp-server",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": ">=22.15.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",
|
|
@@ -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": "1.0.0-beta.1",
|
|
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,15 @@
|
|
|
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
|
|
11
|
+
--embedded-room The embedding application owns the game room: omit tools that
|
|
12
|
+
start a dev server, game host, session or run of their own
|
|
9
13
|
`;
|
|
10
14
|
|
|
11
15
|
const argv = process.argv.slice(2);
|
|
@@ -15,8 +19,15 @@ if (argv.includes("--help") || argv.includes("-h")) {
|
|
|
15
19
|
process.exit(0);
|
|
16
20
|
}
|
|
17
21
|
|
|
22
|
+
if (argv.includes("--version") || argv.includes("-V")) {
|
|
23
|
+
process.stdout.write(`${AIR_JAM_MCP_SERVER_VERSION}\n`);
|
|
24
|
+
process.exit(0);
|
|
25
|
+
}
|
|
26
|
+
|
|
18
27
|
const { createAirJamMcpServer } = await import("./server.js");
|
|
19
|
-
const server = await createAirJamMcpServer(
|
|
28
|
+
const server = await createAirJamMcpServer({
|
|
29
|
+
embeddedRoom: argv.includes("--embedded-room"),
|
|
30
|
+
});
|
|
20
31
|
const transport = new StdioServerTransport();
|
|
21
32
|
|
|
22
33
|
await server.connect(transport);
|
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 =
|
|
@@ -39,10 +40,36 @@ const createToolErrorResult = (error: unknown): CallToolResult => ({
|
|
|
39
40
|
isError: true,
|
|
40
41
|
});
|
|
41
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Tools an embedding application replaces when it owns the game room: it runs
|
|
45
|
+
* the development server, hosts the game and admits test runs into that room,
|
|
46
|
+
* so agents never start another host, dev server or run of their own.
|
|
47
|
+
*/
|
|
48
|
+
const EMBEDDED_ROOM_OMITTED_TOOLS = new Set([
|
|
49
|
+
"airjam.start_dev",
|
|
50
|
+
"airjam.stop_dev",
|
|
51
|
+
"airjam.reset_local",
|
|
52
|
+
"airjam.start_game_run",
|
|
53
|
+
"airjam.stop_game_run",
|
|
54
|
+
"airjam.steer_game_run",
|
|
55
|
+
"airjam.open_game_session",
|
|
56
|
+
"airjam.control_game_session_participant",
|
|
57
|
+
"airjam.send_game_session_input",
|
|
58
|
+
"airjam.read_game_session",
|
|
59
|
+
"airjam.observe_game_session",
|
|
60
|
+
"airjam.read_game_settings",
|
|
61
|
+
"airjam.update_game_settings",
|
|
62
|
+
"airjam.invoke_game_session_action",
|
|
63
|
+
"airjam.capture_game_session_visuals",
|
|
64
|
+
"airjam.close_game_session",
|
|
65
|
+
]);
|
|
66
|
+
|
|
42
67
|
export const createAirJamMcpServer = async ({
|
|
43
68
|
cwd = process.cwd(),
|
|
69
|
+
embeddedRoom = false,
|
|
44
70
|
}: {
|
|
45
71
|
cwd?: string;
|
|
72
|
+
embeddedRoom?: boolean;
|
|
46
73
|
} = {}): Promise<McpServer> => {
|
|
47
74
|
const context = await detectProjectContext({ cwd });
|
|
48
75
|
const toolDefinitions = buildToolDefinitions({
|
|
@@ -55,7 +82,7 @@ export const createAirJamMcpServer = async ({
|
|
|
55
82
|
const server = new McpServer(
|
|
56
83
|
{
|
|
57
84
|
name: "air-jam",
|
|
58
|
-
version:
|
|
85
|
+
version: AIR_JAM_MCP_SERVER_VERSION,
|
|
59
86
|
},
|
|
60
87
|
{
|
|
61
88
|
capabilities: {
|
|
@@ -76,6 +103,7 @@ export const createAirJamMcpServer = async ({
|
|
|
76
103
|
);
|
|
77
104
|
|
|
78
105
|
for (const toolName of registeredToolNames) {
|
|
106
|
+
if (embeddedRoom && EMBEDDED_ROOM_OMITTED_TOOLS.has(toolName)) continue;
|
|
79
107
|
const tool = toolDefinitions[toolName];
|
|
80
108
|
const description = describeToolForRegistration({
|
|
81
109
|
description: tool.description,
|