wwise-waapi-mcp 1.0.0 → 1.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,38 @@
1
+ # Changelog
2
+
3
+ ## [1.0.1] - 2026-03-28
4
+
5
+ ### Added
6
+
7
+ - **Session domain** (`src/domains/session/tools.ts`): two new discovery tools for managing the WAAPI connection at runtime.
8
+
9
+ | Tool | Description |
10
+ | :-- | :-- |
11
+ | `session.configure` | Update the WAAPI port used to reach Wwise Authoring. Persists the new URL to `config/runtime.json` and disconnects the active session so the next WAAPI call reconnects automatically. |
12
+ | `session.getConfig` | Return the currently configured WAAPI URL and whether a session is active. |
13
+
14
+ - **`setWaapiUrl(url)`** and **`isSessionActive()`** exports in `src/lib/waapiClient.ts`.
15
+
16
+ ### Changed
17
+
18
+ - `session.configure` and `session.getConfig` are registered as `isDiscoveryTool: true`, meaning they appear directly in the MCP `tools/list` response alongside the `catalog.*` tools — no `catalog.executeTool` wrapper needed.
19
+ - `config/domains.json`: added `session` domain metadata entry.
20
+ - `tests/verify.ts`: updated expected discovery tool count from 4 to 6; added assertions for the two new session tools.
21
+ - `README.md` / `README_ZH.md`: updated exposed tools list; expanded "WAAPI connection" section to explain multi-instance port usage.
22
+
23
+ ### Background
24
+
25
+ Each Wwise Authoring instance exposes WAAPI on a separately configurable port (default 8080). When multiple Wwise instances run on the same machine, each must use a different port — if the chosen port is already taken, the later instance fails to start its WAAPI server. `session.configure` provides the runtime entry point for switching between those instances without restarting the MCP server.
26
+
27
+ ---
28
+
29
+ ## [1.0.0] - 2026-03-27
30
+
31
+ Initial release.
32
+
33
+ - Progressive-disclosure MCP surface: only `catalog.*` discovery tools in `tools/list`.
34
+ - Runtime-backed WAAPI tools across 18 domains.
35
+ - stdio and HTTP/SSE transport modes.
36
+ - Standard response envelope `{ ok, data | error }`.
37
+ - Structured logging with sensitive-field redaction.
38
+ - EXE packaging support via `npm run package:exe`.
package/README.md CHANGED
@@ -71,6 +71,8 @@ If all probes fail, startup exits with `waapi_schema_not_found`.
71
71
  - Progressive-disclosure MCP surface:
72
72
  - `tools/list` only exposes discovery tools, not every runtime WAAPI tool
73
73
  - currently exposed discovery tools:
74
+ - `session.configure`
75
+ - `session.getConfig`
74
76
  - `catalog.listDomains`
75
77
  - `catalog.listTools`
76
78
  - `catalog.getToolSchema`
@@ -86,8 +88,6 @@ If all probes fail, startup exits with `waapi_schema_not_found`.
86
88
  - failure: `{ ok: false, error: { code, message, details? } }`
87
89
  - Structured tool call logs with sensitive-field redaction.
88
90
 
89
- Implemented WAAPI surface details are tracked in `docs/implemented-waapi.md`.
90
-
91
91
  ## Transport modes
92
92
 
93
93
  ### stdio mode (default)
@@ -183,6 +183,23 @@ Configure in `config/runtime.json`:
183
183
  }
184
184
  ```
185
185
 
186
+ ### Connecting to a specific Wwise instance
187
+
188
+ Each Wwise instance exposes WAAPI on a configurable port (default 8080).
189
+ If multiple Wwise instances are running on the same machine, each must use a different port — Wwise will refuse to start its WAAPI server if the chosen port is already in use.
190
+
191
+ Use the `session.configure` tool at runtime to switch the target port without restarting the server:
192
+
193
+ ```jsonc
194
+ // Switch to a Wwise instance running on port 8081
195
+ { "port": 8081 }
196
+ ```
197
+
198
+ The change is persisted to `runtime.json` and the current WAAPI session is disconnected.
199
+ The next WAAPI call automatically reconnects to the new port.
200
+
201
+ Use `session.getConfig` to check the currently configured URL and connection status.
202
+
186
203
  ## Access filtering
187
204
 
188
205
  Optional startup filters:
package/README_ZH.md CHANGED
@@ -71,6 +71,8 @@ npm start
71
71
  - 渐进式对外暴露:
72
72
  - MCP 的 `tools/list` 只暴露发现工具,不会一次性暴露所有运行时 WAAPI 工具
73
73
  - 当前对外暴露的发现工具为:
74
+ - `session.configure`
75
+ - `session.getConfig`
74
76
  - `catalog.listDomains`
75
77
  - `catalog.listTools`
76
78
  - `catalog.getToolSchema`
@@ -86,8 +88,6 @@ npm start
86
88
  - 失败:`{ ok: false, error: { code, message, details? } }`
87
89
  - 结构化工具调用日志,并对敏感字段做脱敏处理。
88
90
 
89
- 已实现的 WAAPI 接口覆盖详情见 `docs/implemented-waapi.md`。
90
-
91
91
  ## 传输模式
92
92
 
93
93
  ### stdio 模式(默认)
@@ -183,6 +183,23 @@ ws://127.0.0.1:8080/waapi
183
183
  }
184
184
  ```
185
185
 
186
+ ### 连接到指定的 Wwise 实例
187
+
188
+ 每个 Wwise 实例都有独立可配置的 WAAPI 端口(默认 8080)。
189
+ 同一台机器上如果同时运行多个 Wwise 实例,每个实例必须使用不同的端口——若端口已被占用,后启动的实例将无法初始化其 WAAPI 服务器。
190
+
191
+ 在运行时可通过 `session.configure` 工具切换目标端口,无需重启 MCP 服务器:
192
+
193
+ ```jsonc
194
+ // 切换到运行在 8081 端口的 Wwise 实例
195
+ { "port": 8081 }
196
+ ```
197
+
198
+ 该变更会持久化到 `runtime.json`,同时断开当前 WAAPI 会话。
199
+ 下一次 WAAPI 工具调用时将自动以新端口重新建立连接。
200
+
201
+ 使用 `session.getConfig` 可查看当前配置的连接地址及会话状态。
202
+
186
203
  ## 访问过滤
187
204
 
188
205
  可选的启动过滤变量:
@@ -125,6 +125,13 @@
125
125
  "description": "Sound object authoring operations such as active audio source selection.",
126
126
  "risk": "high",
127
127
  "tags": ["authoring", "sound", "source"]
128
+ },
129
+ {
130
+ "name": "session",
131
+ "title": "Session",
132
+ "description": "WAAPI connection configuration. Controls which Wwise instance the server connects to by setting the WAAPI port.",
133
+ "risk": "low",
134
+ "tags": ["session", "connection", "config"]
128
135
  }
129
136
  ]
130
137
  }
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSessionTools = getSessionTools;
4
+ const v4_1 = require("zod/v4");
5
+ const fs_1 = require("fs");
6
+ const response_js_1 = require("../../lib/response.js");
7
+ const waapiClient_js_1 = require("../../lib/waapiClient.js");
8
+ const runtimePaths_js_1 = require("../../lib/runtimePaths.js");
9
+ const errors_js_1 = require("../../lib/errors.js");
10
+ /** 从 runtime.json 读取当前配置的 WAAPI URL。 */
11
+ function getCurrentWaapiUrl() {
12
+ try {
13
+ const configPath = (0, runtimePaths_js_1.getConfigPath)("runtime.json");
14
+ const config = JSON.parse((0, fs_1.readFileSync)(configPath, "utf-8"));
15
+ return config.waapiUrl?.trim() || "ws://127.0.0.1:8080/waapi";
16
+ }
17
+ catch {
18
+ return "ws://127.0.0.1:8080/waapi";
19
+ }
20
+ }
21
+ /**
22
+ * Session 域工具:管理 MCP 服务器与 Wwise Authoring 实例之间的连接配置。
23
+ * 每个 Wwise 实例可以设置独立的 WAAPI 端口号(默认 8080)。
24
+ * 同一台机器上同时运行多个 Wwise 实例时,每个实例须使用不同端口。
25
+ */
26
+ function getSessionTools() {
27
+ return [
28
+ {
29
+ name: "session.configure",
30
+ title: "Configure WAAPI Connection",
31
+ description: "Update the WAAPI port used to connect to Wwise Authoring. " +
32
+ "Each Wwise instance exposes WAAPI on a configurable port (default 8080). " +
33
+ "When multiple Wwise instances run on the same machine, each must use a different port. " +
34
+ "Calling this tool persists the new port to runtime.json and disconnects the current session. " +
35
+ "The next WAAPI call will automatically reconnect to the new port. " +
36
+ "After calling this tool, ask the user whether to verify the new connection immediately.",
37
+ domain: "session",
38
+ risk: "low",
39
+ permissions: [],
40
+ tags: ["session", "connection", "config"],
41
+ examples: [
42
+ {
43
+ title: "Switch to Wwise instance on port 8081",
44
+ input: { port: 8081 }
45
+ },
46
+ {
47
+ title: "Reset back to the default port 8080",
48
+ input: { port: 8080 }
49
+ }
50
+ ],
51
+ implementationStatus: "implemented",
52
+ callable: true,
53
+ isDiscoveryTool: true,
54
+ inputSchema: {
55
+ port: v4_1.z
56
+ .number()
57
+ .int()
58
+ .min(1)
59
+ .max(65535)
60
+ .describe("WAAPI port number of the target Wwise instance (default: 8080).")
61
+ },
62
+ inputSchemaJson: {
63
+ type: "object",
64
+ properties: {
65
+ port: {
66
+ type: "integer",
67
+ minimum: 1,
68
+ maximum: 65535,
69
+ description: "WAAPI port number of the target Wwise instance (default: 8080)."
70
+ }
71
+ },
72
+ required: ["port"],
73
+ additionalProperties: false
74
+ },
75
+ outputSchemaJson: response_js_1.standardResponseJsonSchema,
76
+ handler: async (rawArgs) => {
77
+ try {
78
+ const args = rawArgs;
79
+ const previousUrl = getCurrentWaapiUrl();
80
+ const newUrl = `ws://127.0.0.1:${args.port}/waapi`;
81
+ (0, waapiClient_js_1.setWaapiUrl)(newUrl);
82
+ await (0, waapiClient_js_1.disconnectWaapi)();
83
+ return (0, response_js_1.ok)({
84
+ previousUrl,
85
+ newUrl,
86
+ message: "WAAPI port updated and current session disconnected. " +
87
+ "The next WAAPI call will connect to the new port automatically."
88
+ });
89
+ }
90
+ catch (error) {
91
+ return (0, errors_js_1.toFailureResponse)(error);
92
+ }
93
+ }
94
+ },
95
+ {
96
+ name: "session.getConfig",
97
+ title: "Get Connection Config",
98
+ description: "Return the current WAAPI connection URL and whether a session is currently active. " +
99
+ "Use this to check which Wwise instance the server is configured to connect to.",
100
+ domain: "session",
101
+ risk: "low",
102
+ permissions: [],
103
+ tags: ["session", "connection", "config"],
104
+ examples: [
105
+ {
106
+ title: "Check current WAAPI connection config"
107
+ }
108
+ ],
109
+ implementationStatus: "implemented",
110
+ callable: true,
111
+ isDiscoveryTool: true,
112
+ outputSchemaJson: response_js_1.standardResponseJsonSchema,
113
+ handler: async () => {
114
+ return (0, response_js_1.ok)({
115
+ url: getCurrentWaapiUrl(),
116
+ isConnected: (0, waapiClient_js_1.isSessionActive)()
117
+ });
118
+ }
119
+ }
120
+ ];
121
+ }
package/dist/src/index.js CHANGED
@@ -29,6 +29,7 @@ const tools_js_15 = require("./domains/log/tools.js");
29
29
  const tools_js_16 = require("./domains/plugin/tools.js");
30
30
  const tools_js_17 = require("./domains/sourceControl/tools.js");
31
31
  const tools_js_18 = require("./domains/sound/tools.js");
32
+ const tools_js_19 = require("./domains/session/tools.js");
32
33
  /** 从 config/domains.json 加载领域元数据列表。 */
33
34
  function loadDomainsConfig() {
34
35
  const document = JSON.parse(node_fs_1.default.readFileSync((0, runtimePaths_js_1.getConfigPath)("domains.json"), "utf8"));
@@ -69,6 +70,7 @@ async function main() {
69
70
  registry.registerTools((0, tools_js_16.getPluginTools)());
70
71
  registry.registerTools((0, tools_js_17.getSourceControlTools)());
71
72
  registry.registerTools((0, tools_js_18.getSoundTools)());
73
+ registry.registerTools((0, tools_js_19.getSessionTools)());
72
74
  registry.registerTools((0, tools_js_1.getCatalogTools)(registry));
73
75
  const policy = toolRegistry_js_1.ToolRegistry.policyFromEnv(process.env);
74
76
  // --- 传输层模式检测 ---
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setWaapiUrl = setWaapiUrl;
4
+ exports.isSessionActive = isSessionActive;
3
5
  exports.getWaapiSession = getWaapiSession;
4
6
  exports.callWaapi = callWaapi;
5
7
  exports.disconnectWaapi = disconnectWaapi;
@@ -19,6 +21,27 @@ function getWaapiUrl() {
19
21
  return "ws://127.0.0.1:8080/waapi";
20
22
  }
21
23
  }
24
+ /**
25
+ * 将新的 WAAPI URL 写入 runtime.json,并不会立即重连。
26
+ * 调用方应在此之后调用 disconnectWaapi(),下次工具调用时将自动以新 URL 重连。
27
+ */
28
+ function setWaapiUrl(url) {
29
+ try {
30
+ const configPath = (0, runtimePaths_js_1.getConfigPath)("runtime.json");
31
+ const config = JSON.parse((0, fs_1.readFileSync)(configPath, "utf-8"));
32
+ config.waapiUrl = url;
33
+ (0, fs_1.writeFileSync)(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
34
+ }
35
+ catch (error) {
36
+ throw new errors_js_1.AppError("config_write_failed", "Failed to update waapiUrl in runtime.json.", {
37
+ cause: error instanceof Error ? error.message : error
38
+ });
39
+ }
40
+ }
41
+ /** 返回当前 WAAPI 会话是否处于活跃状态。 */
42
+ function isSessionActive() {
43
+ return !!activeSession;
44
+ }
22
45
  /** 应用内共享的单例 WAAPI 会话对象。 */
23
46
  let activeSession;
24
47
  /** 连接过程中的 Promise,用于防止并发请求触发多次连接。 */
package/package.json CHANGED
@@ -1,56 +1,57 @@
1
- {
2
- "name": "wwise-waapi-mcp",
3
- "version": "1.0.0",
4
- "description": "Progressive-disclosure MCP server scaffold for Wwise WAAPI",
5
- "main": "dist/src/index.js",
6
- "scripts": {
7
- "build": "tsc -p tsconfig.json",
8
- "dev": "tsx src/index.ts",
9
- "start": "node dist/src/index.js",
10
- "verify": "tsx tests/verify.ts",
11
- "package:exe": "npm run build && pkg package.json --targets node18-win-x64 --output bin/wwise-mcp.exe"
12
- },
13
- "keywords": [
14
- "mcp",
15
- "wwise",
16
- "waapi",
17
- "audio",
18
- "game",
19
- "typescript"
20
- ],
21
- "author": "majorli",
22
- "license": "MIT",
23
- "type": "commonjs",
24
- "bin": {
25
- "wwise-waapi-mcp": "dist/src/index.js"
26
- },
27
- "files": [
28
- "dist/**/*",
29
- "config/**/*",
30
- "README.md",
31
- "README_ZH.md"
32
- ],
33
- "pkg": {
34
- "assets": [
35
- "config/**/*.json"
36
- ],
37
- "scripts": [
38
- "dist/**/*.js"
39
- ]
40
- },
41
- "dependencies": {
42
- "@modelcontextprotocol/sdk": "^1.28.0",
43
- "waapi-client": "^2017.2.1",
44
- "zod": "^4.3.6"
45
- },
46
- "devDependencies": {
47
- "@types/node": "^25.5.0",
48
- "pkg": "^5.8.1",
49
- "tsx": "^4.21.0",
50
- "typescript": "^6.0.2"
51
- },
52
- "repository": {
53
- "type": "git",
54
- "url": "git+https://github.com/Li-Major/wwise-waapi-mcp.git"
55
- }
56
- }
1
+ {
2
+ "name": "wwise-waapi-mcp",
3
+ "version": "1.0.1",
4
+ "description": "Progressive-disclosure MCP server scaffold for Wwise WAAPI",
5
+ "main": "dist/src/index.js",
6
+ "scripts": {
7
+ "build": "tsc -p tsconfig.json",
8
+ "dev": "tsx src/index.ts",
9
+ "start": "node dist/src/index.js",
10
+ "verify": "tsx tests/verify.ts",
11
+ "package:exe": "npm run build && pkg package.json --targets node18-win-x64 --output bin/wwise-mcp.exe"
12
+ },
13
+ "keywords": [
14
+ "mcp",
15
+ "wwise",
16
+ "waapi",
17
+ "audio",
18
+ "game",
19
+ "typescript"
20
+ ],
21
+ "author": "majorli",
22
+ "license": "MIT",
23
+ "type": "commonjs",
24
+ "bin": {
25
+ "wwise-waapi-mcp": "dist/src/index.js"
26
+ },
27
+ "files": [
28
+ "dist/**/*",
29
+ "config/**/*",
30
+ "README.md",
31
+ "README_ZH.md",
32
+ "CHANGELOG.md"
33
+ ],
34
+ "pkg": {
35
+ "assets": [
36
+ "config/**/*.json"
37
+ ],
38
+ "scripts": [
39
+ "dist/**/*.js"
40
+ ]
41
+ },
42
+ "dependencies": {
43
+ "@modelcontextprotocol/sdk": "^1.28.0",
44
+ "waapi-client": "^2017.2.1",
45
+ "zod": "^4.3.6"
46
+ },
47
+ "devDependencies": {
48
+ "@types/node": "^25.5.0",
49
+ "pkg": "^5.8.1",
50
+ "tsx": "^4.21.0",
51
+ "typescript": "^6.0.2"
52
+ },
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/Li-Major/wwise-waapi-mcp.git"
56
+ }
57
+ }