@firfi/huly-mcp 0.53.1 → 0.55.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 CHANGED
@@ -45,6 +45,7 @@ The standard configuration uses a Huly API token and works with most MCP clients
45
45
  "command": "npx",
46
46
  "args": ["-y", "@firfi/huly-mcp@latest"],
47
47
  "env": {
48
+ "MCP_TRANSPORT": "stdio-resident",
48
49
  "HULY_URL": "https://your-huly-instance.example.com",
49
50
  "HULY_TOKEN": "your-huly-api-token",
50
51
  "HULY_WORKSPACE": "yourworkspace"
@@ -73,6 +74,7 @@ Use Codex's MCP manager:
73
74
 
74
75
  ```bash
75
76
  codex mcp add huly \
77
+ --env MCP_TRANSPORT=stdio-resident \
76
78
  --env HULY_URL=https://your-huly-instance.example.com \
77
79
  --env HULY_TOKEN=your-huly-api-token \
78
80
  --env HULY_WORKSPACE=yourworkspace \
@@ -87,6 +89,7 @@ command = "npx"
87
89
  args = ["-y", "@firfi/huly-mcp@latest"]
88
90
 
89
91
  [mcp_servers.huly.env]
92
+ MCP_TRANSPORT = "stdio-resident"
90
93
  HULY_URL = "https://your-huly-instance.example.com"
91
94
  HULY_TOKEN = "your-huly-api-token"
92
95
  HULY_WORKSPACE = "yourworkspace"
@@ -99,6 +102,7 @@ HULY_WORKSPACE = "yourworkspace"
99
102
 
100
103
  ```bash
101
104
  claude mcp add huly \
105
+ -e MCP_TRANSPORT=stdio-resident \
102
106
  -e HULY_URL=https://your-huly-instance.example.com \
103
107
  -e HULY_TOKEN=your-huly-api-token \
104
108
  -e HULY_WORKSPACE=yourworkspace \
@@ -131,6 +135,7 @@ Add with Command Palette → "MCP: Add Server", or put this in a VS Code MCP con
131
135
  "command": "npx",
132
136
  "args": ["-y", "@firfi/huly-mcp@latest"],
133
137
  "env": {
138
+ "MCP_TRANSPORT": "stdio-resident",
134
139
  "HULY_URL": "https://your-huly-instance.example.com",
135
140
  "HULY_TOKEN": "your-huly-api-token",
136
141
  "HULY_WORKSPACE": "yourworkspace"
@@ -168,6 +173,7 @@ Open the global configuration file (`~/.config/opencode/opencode.json`) and merg
168
173
  "type": "local",
169
174
  "command": ["npx", "-y", "@firfi/huly-mcp@latest"],
170
175
  "environment": {
176
+ "MCP_TRANSPORT": "stdio-resident",
171
177
  "HULY_URL": "https://your-huly-instance.example.com",
172
178
  "HULY_TOKEN": "your-huly-api-token",
173
179
  "HULY_WORKSPACE": "yourworkspace"
@@ -206,7 +212,7 @@ The `@latest` tag asks the package runner for the newest version. Some MCP clien
206
212
  | **VS Code / Cursor** | Restart the MCP server from the command palette/configured client or reload the window |
207
213
  | **OpenCode** | Restart OpenCode or start a new session after config changes |
208
214
  | **Pi** | Run `/mcp reconnect huly`, then `/reload` if the registered direct-tool surface changed |
209
- | **npx (manual)** | `npx -y @firfi/huly-mcp@latest` — the `-y` flag auto-confirms install prompts |
215
+ | **npx (manual)** | `MCP_TRANSPORT=stdio-resident npx -y @firfi/huly-mcp@latest` — the `-y` flag auto-confirms install prompts |
210
216
 
211
217
  ## Maintainer Production Release
212
218
 
@@ -220,6 +226,18 @@ Use this exact command even when a newer Node.js version is active on the host.
220
226
  exact Node.js versions certified by CI; this is intentionally narrower than the package's runtime requirement. See
221
227
  the [production release guide](docs/NPM_PRODUCTION_RELEASE.md) for preflight checks, rerun behavior, and verification.
222
228
 
229
+ ## Shared resident stdio
230
+
231
+ The setup examples explicitly select `MCP_TRANSPORT=stdio-resident`. MCP clients still use stdio, while compatible clients under the same OS user share a Node backend through small native bridges. Linux and macOS arm64/x64 binaries are included; no Rust installation is needed. If the native bridge cannot run, startup falls back to ordinary stdio before accepting requests. A failed active resident never reconnects or replays requests.
232
+
233
+ Omitting `MCP_TRANSPORT` still selects ordinary `stdio`, preserving existing installations. Set `MCP_TRANSPORT=stdio` explicitly to keep a separate backend per client. Restart the MCP client after changing the setting.
234
+
235
+ ## Manual resident backend
236
+
237
+ The experimental [manual resident backend path](docs/resident-manual.md) lets
238
+ independent stdio hosts select one explicitly started local backend through a
239
+ private attachment file. Full qualification remains pending.
240
+
223
241
  ## HTTP Transport
224
242
 
225
243
  By default, the server uses stdio transport. For HTTP transport:
@@ -264,7 +282,7 @@ Authorization: Bearer <MCP_AUTH_TOKEN>
264
282
 
265
283
  ### Shared CLI and stdio profiles
266
284
 
267
- Save a profile with `huly auth login --profile work`, then set `HULY_PROFILE=work` in the stdio MCP server's environment. Both processes must run under the same OS user and configuration directory. Stdio never follows the active CLI profile implicitly. Saved tokens are bound to their instance URL and workspace; changes require login again or complete environment credential injection. See the [CLI profile instructions](packages/huly-cli/README.md#authentication-and-profiles). HTTP configuration remains unchanged.
285
+ Save a profile with `huly auth login --profile work`, then set `MCP_TRANSPORT=stdio-resident` and `HULY_PROFILE=work` in the stdio MCP server's environment. Both processes must run under the same OS user and configuration directory. Stdio never follows the active CLI profile implicitly. Saved tokens are bound to their instance URL and workspace; changes require login again or complete environment credential injection. See the [CLI profile instructions](packages/huly-cli/README.md#authentication-and-profiles). HTTP configuration remains unchanged.
268
286
 
269
287
  ### Hosted HTTP Header Configuration
270
288
 
@@ -293,7 +311,8 @@ For a Smithery publish schema example, see [docs/SMITHERY_URL_PUBLISH.md](docs/S
293
311
  | `HULY_PASSWORD` | Auth* | Compatibility fallback: account password |
294
312
  | `HULY_WORKSPACE` | Yes | Workspace identifier |
295
313
  | `HULY_CONNECTION_TIMEOUT` | No | Connection timeout in ms. Omit to use the package default. |
296
- | `MCP_TRANSPORT` | No | Transport type: `stdio` (default) or `http` |
314
+ | `MCP_TRANSPORT` | No | Transport type: `stdio` (package default), `stdio-resident` (recommended in setup examples), or `http` |
315
+ | `MCP_PRELOAD_TOOLS` | No | Load every tool handler before serving requests. Defaults to `false`; use `true` for smoke tests that check all handler imports. |
297
316
  | `MCP_HTTP_PORT` | No | HTTP server port (falls back to `PORT`, then 3000) |
298
317
  | `MCP_HTTP_HOST` | No | HTTP server host. Omit to bind to the package default loopback host. |
299
318
  | `MCP_AUTH_TOKEN` | No | Optional bearer token required by HTTP clients for `/mcp`. This protects the MCP endpoint only; it is not a Huly API token. |
@@ -306,6 +325,14 @@ For a Smithery publish schema example, see [docs/SMITHERY_URL_PUBLISH.md](docs/S
306
325
  *Auth: Prefer `HULY_TOKEN`. Use `HULY_EMAIL` + `HULY_PASSWORD` only when the Huly deployment does not support a
307
326
  managed API token or another compatibility constraint requires password authentication.
308
327
 
328
+ ## Startup and initialization
329
+
330
+ Tool discovery reads a generated catalog without loading operation handlers or waiting for Huly. Handlers load by tool group on demand; concurrent calls share the group's load. Run `pnpm update-tool-catalog` after changing tool definitions. Builds reject a stale catalog.
331
+
332
+ For stdio, the first tool-list request starts the process-owned Huly connection in the background. Calls that need the full Huly model wait for the same initialization. Cancelling a waiting call does not cancel initialization for other calls. A failed model initialization can be retried by a later call. Project listing uses a separate REST read and does not wait for the full model. Other operations retain the full model and their existing behavior.
333
+
334
+ The default transport remains stdio: each process launched by an MCP host owns its connection and model. HTTP lets clients share one running server. Connections created from request credential headers initialize the model only when needed; the CLI also uses this on-demand policy.
335
+
309
336
  ## Built-in Diagnostic Tools
310
337
 
311
338
  `get_version` returns the current server version and latest npm version.
@@ -1189,6 +1216,22 @@ When resolved tool exposure is `proxy`, clients see the built-in tools plus thes
1189
1216
 
1190
1217
  <!-- tools:end -->
1191
1218
 
1219
+ ## Building from source
1220
+
1221
+ Published packages include the native resident bridge; Rust is a build dependency.
1222
+ Source builds require Node.js, pnpm, Rustup, Python 3, and Bash. Prepare the pinned
1223
+ Rust toolchain, Zig linker, and cross-compilation SDK once:
1224
+
1225
+ ```bash
1226
+ pnpm setup:native
1227
+ pnpm build
1228
+ pnpm test:native
1229
+ ```
1230
+
1231
+ Build tools are kept in a platform-specific user cache, outside the checkout and
1232
+ published package. The bridge is a single Rust I/O loop; MCP protocol processing,
1233
+ authorization, and cancellation remain in the shared Node backend.
1234
+
1192
1235
  ## Troubleshooting
1193
1236
 
1194
1237
  ### Password fallback with special characters
@@ -1214,6 +1257,7 @@ For Claude JSON config, the shell-sensitive characters above can be written dire
1214
1257
  "command": "npx",
1215
1258
  "args": ["-y", "@firfi/huly-mcp@latest"],
1216
1259
  "env": {
1260
+ "MCP_TRANSPORT": "stdio-resident",
1217
1261
  "HULY_URL": "https://your-huly-instance.com",
1218
1262
  "HULY_EMAIL": "you@example.com",
1219
1263
  "HULY_PASSWORD": "p@ss*w0rd!#%",