open-mcp-app 0.0.4 → 0.0.5

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.
@@ -512,11 +512,8 @@ declare class App {
512
512
  /**
513
513
  * Get the HMR port for injecting the live reload client.
514
514
  *
515
- * When MCP_PORT is set (by Creature), derives the HMR port deterministically
516
- * as MCP_PORT + HMR_PORT_OFFSET. This eliminates the race condition where
517
- * the hmr.json file might not exist yet when the server starts.
518
- *
519
- * Falls back to reading hmr.json for non-Creature environments (manual npm run dev).
515
+ * When MCP_HMR_PORT is set (by host), uses that directly.
516
+ * Falls back to reading hmr.json for non-host environments (manual npm run dev).
520
517
  */
521
518
  private getHmrPort;
522
519
  private generateInstanceId;
@@ -13390,7 +13390,6 @@ import fs from "fs";
13390
13390
  import path from "path";
13391
13391
 
13392
13392
  // src/vite/hmr-client.ts
13393
- var HMR_PORT_OFFSET = 1e3;
13394
13393
  var HMR_RELOAD_NOTIFICATION = "ui/notifications/hmr-reload";
13395
13394
  function generateHmrClientScript(port) {
13396
13395
  return `
@@ -14296,19 +14295,16 @@ var App = class {
14296
14295
  }
14297
14296
  /**
14298
14297
  * Get the HMR port for injecting the live reload client.
14299
- *
14300
- * When MCP_PORT is set (by Creature), derives the HMR port deterministically
14301
- * as MCP_PORT + HMR_PORT_OFFSET. This eliminates the race condition where
14302
- * the hmr.json file might not exist yet when the server starts.
14303
- *
14304
- * Falls back to reading hmr.json for non-Creature environments (manual npm run dev).
14298
+ *
14299
+ * When MCP_HMR_PORT is set (by host), uses that directly.
14300
+ * Falls back to reading hmr.json for non-host environments (manual npm run dev).
14305
14301
  */
14306
14302
  getHmrPort() {
14307
14303
  if (!this.isDev) return null;
14308
14304
  if (this.hmrPort !== null) return this.hmrPort;
14309
- const mcpPort = process.env.MCP_PORT ? parseInt(process.env.MCP_PORT, 10) : null;
14310
- if (mcpPort && !isNaN(mcpPort)) {
14311
- this.hmrPort = mcpPort + HMR_PORT_OFFSET;
14305
+ const hmrPortFromHost = process.env.MCP_HMR_PORT ? parseInt(process.env.MCP_HMR_PORT, 10) : null;
14306
+ if (hmrPortFromHost && !isNaN(hmrPortFromHost)) {
14307
+ this.hmrPort = hmrPortFromHost;
14312
14308
  return this.hmrPort;
14313
14309
  }
14314
14310
  const hmrConfig = readHmrConfig();