From ee0b72f43bb1911996a3d0a9a4f6233f9c77a292 Mon Sep 17 00:00:00 2001 From: Mika Kuns Date: Tue, 19 May 2026 14:07:56 +0200 Subject: [PATCH] feat: change default port from 47822 to 37849 (v1.2.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 47822 collided with ClaudeDo.Worker.exe on at least one user's machine. 37849 is high, registered to nobody, and avoids the prior conflict. Both the Node port and the .NET port move together (still wire-compatible). Defaults change only — if a user has a custom port in mailbox.json, that stays. --- README.md | 6 +++--- node/package-lock.json | 4 ++-- node/package.json | 2 +- node/src/cli.ts | 2 +- node/src/config.ts | 2 +- plugin/README.md | 2 +- plugin/commands/mailbox-doctor.md | 12 ++++++------ plugin/commands/mailbox-status.md | 2 +- src/ClaudeMailbox/Cli/ClientCommands.cs | 2 +- src/ClaudeMailbox/Cli/ServiceCommands.cs | 2 +- src/ClaudeMailbox/Config/DaemonConfig.cs | 2 +- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index bf23c69..1e637b7 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Then drop this into your project's `.mcp.json`: "mcpServers": { "mailbox": { "type": "http", - "url": "http://127.0.0.1:47822/mcp" + "url": "http://127.0.0.1:37849/mcp" } } } @@ -96,7 +96,7 @@ dotnet publish src/ClaudeMailbox -c Release -r win-x64 --self-contained -p:Publi Put the resulting `claude-mailbox.exe` on `PATH`. Windows-only `install-service` verbs (admin shell): ``` -claude-mailbox install-service [--port 47822] [--bind 127.0.0.1] [--db-path ] +claude-mailbox install-service [--port 37849] [--bind 127.0.0.1] [--db-path ] claude-mailbox uninstall-service [--purge] ``` @@ -193,7 +193,7 @@ CLI flag > mailbox.json > built-in defaults `mailbox.json` is searched at `~/.claude-mailbox/mailbox.json` (per-user), and on Windows additionally at `%ProgramData%\ClaudeMailbox\mailbox.json` (machine-wide, written by `--service` install). Override with `--config `. -Defaults: port `47822`, bind `127.0.0.1`, database at `~/.claude-mailbox/mailbox.db`. +Defaults: port `37849`, bind `127.0.0.1`, database at `~/.claude-mailbox/mailbox.db`. --- diff --git a/node/package-lock.json b/node/package-lock.json index 8cc668e..bac8cac 100644 --- a/node/package-lock.json +++ b/node/package-lock.json @@ -1,12 +1,12 @@ { "name": "@kuns/claude-mailbox", - "version": "1.1.0", + "version": "1.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@kuns/claude-mailbox", - "version": "1.1.0", + "version": "1.2.0", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "^1.29.0", diff --git a/node/package.json b/node/package.json index 042c403..e87178d 100644 --- a/node/package.json +++ b/node/package.json @@ -1,6 +1,6 @@ { "name": "@kuns/claude-mailbox", - "version": "1.1.0", + "version": "1.2.0", "description": "Standalone MCP mail server that lets parallel Claude sessions coordinate with each other.", "type": "module", "bin": { diff --git a/node/src/cli.ts b/node/src/cli.ts index 2cde8ea..ae6d854 100644 --- a/node/src/cli.ts +++ b/node/src/cli.ts @@ -271,7 +271,7 @@ program program .command("mcp-stdio") .description( - "Run a stdio MCP server that proxies tool calls to the local daemon's REST API. The daemon URL comes from $CLAUDE_MAILBOX_URL (default http://127.0.0.1:47822). Used by the Claude Code plugin's .mcp.json so the URL is configurable per machine without env-substitution in the URL field.", + "Run a stdio MCP server that proxies tool calls to the local daemon's REST API. The daemon URL comes from $CLAUDE_MAILBOX_URL (default http://127.0.0.1:37849). Used by the Claude Code plugin's .mcp.json so the URL is configurable per machine without env-substitution in the URL field.", ) .action(async () => { try { diff --git a/node/src/config.ts b/node/src/config.ts index 5b29299..b116989 100644 --- a/node/src/config.ts +++ b/node/src/config.ts @@ -2,7 +2,7 @@ import { existsSync, readFileSync } from "node:fs"; import { homedir } from "node:os"; import { join, resolve } from "node:path"; -export const DEFAULT_PORT = 47822; +export const DEFAULT_PORT = 37849; export const DEFAULT_BIND = "127.0.0.1"; export interface FileConfig { diff --git a/plugin/README.md b/plugin/README.md index 75ee1b0..2be19dd 100644 --- a/plugin/README.md +++ b/plugin/README.md @@ -14,7 +14,7 @@ The doctor walks the rest: 1. installs the `claude-mailbox` binary via `npm install -g @kuns/claude-mailbox` if missing (asks first) 2. registers the daemon for autostart and starts it if needed -3. health-probes `http://127.0.0.1:47822/health` +3. health-probes `http://127.0.0.1:37849/health` 4. optionally lets you set a **base prefix** (e.g., `backend`) — without one, mailbox names are anonymous (`claude-XXXXXXXX`) 5. runs a self → self smoke test diff --git a/plugin/commands/mailbox-doctor.md b/plugin/commands/mailbox-doctor.md index 789affa..21111b7 100644 --- a/plugin/commands/mailbox-doctor.md +++ b/plugin/commands/mailbox-doctor.md @@ -29,19 +29,19 @@ Run: `claude-mailbox --version` ## Step 2 — port-conflict check (before autostart!) -Default port is 47822. Probe whether anything is already on it: +Default port is 37849. Probe whether anything is already on it: ``` -curl -sf http://127.0.0.1:47822/health +curl -sf http://127.0.0.1:37849/health ``` - **Returns a JSON body with `"status":"ok"` and a `version` field that matches `claude-mailbox --version`** → it's already our daemon, ✓ skip to Step 4. - **Returns 200 with `"status":"ok"` but a different `version`** → it's an older claude-mailbox; treat as running, ✓. -- **Returns non-200, non-JSON, or any other foreign response** → **port conflict**. Some other process owns 47822. +- **Returns non-200, non-JSON, or any other foreign response** → **port conflict**. Some other process owns 37849. - **Connection refused** → port is free, ✓ continue to Step 3. If port conflict detected: -1. Tell the user which process holds the port (Windows: `Get-NetTCPConnection -LocalPort 47822 | Select-Object OwningProcess`, then `Get-Process -Id `; macOS/Linux: `lsof -i :47822`). +1. Tell the user which process holds the port (Windows: `Get-NetTCPConnection -LocalPort 37849 | Select-Object OwningProcess`, then `Get-Process -Id `; macOS/Linux: `lsof -i :37849`). 2. Pick a free port. Default suggestion: **47900**. Verify it's free: `curl -sf http://127.0.0.1:47900/health` should fail with connection refused. 3. Read `~/.claude-mailbox/mailbox.json` (create empty `{}` if missing) and merge `{"port": }`. Write back. 4. Also write the override into `.claude/settings.json` env so the plugin's hooks find the right URL: @@ -65,7 +65,7 @@ If `install-autostart` still fails after both attempts (very rare — would mean ## Step 4 — health probe -Hit `http://127.0.0.1:/health` (use the configured port, not necessarily 47822). Expect a JSON body with `"status":"ok"` AND a `version` matching `claude-mailbox --version`. If unreachable or version mismatch, stop and report. +Hit `http://127.0.0.1:/health` (use the configured port, not necessarily 37849). Expect a JSON body with `"status":"ok"` AND a `version` matching `claude-mailbox --version`. If unreachable or version mismatch, stop and report. ## Step 5 — mailbox identity (base prefix) @@ -100,7 +100,7 @@ Claude-Mailbox doctor binary: daemon: Running (port: , what you did if anything) health: ok - port conflict: none | resolved (moved from 47822 to ) + port conflict: none | resolved (moved from 37849 to ) base prefix: smoke test: passed | failed restart hint: yes if restart_needed, otherwise no diff --git a/plugin/commands/mailbox-status.md b/plugin/commands/mailbox-status.md index 9c6cc7f..b77a0ca 100644 --- a/plugin/commands/mailbox-status.md +++ b/plugin/commands/mailbox-status.md @@ -11,7 +11,7 @@ Print exactly this block, filling in each line: Claude-Mailbox status binary: daemon: - health: <"ok" if GET http://127.0.0.1:47822/health returns 200, else "unreachable"> + health: <"ok" if GET http://127.0.0.1:37849/health returns 200, else "unreachable"> mailbox name: pending: ` if name is set, else "n/a"> ``` diff --git a/src/ClaudeMailbox/Cli/ClientCommands.cs b/src/ClaudeMailbox/Cli/ClientCommands.cs index d59d1b7..554358d 100644 --- a/src/ClaudeMailbox/Cli/ClientCommands.cs +++ b/src/ClaudeMailbox/Cli/ClientCommands.cs @@ -5,7 +5,7 @@ namespace ClaudeMailbox.Cli; public static class ClientCommands { - private const string DefaultUrl = "http://127.0.0.1:47822"; + private const string DefaultUrl = "http://127.0.0.1:37849"; public static async Task RunAsync(string[] args) { diff --git a/src/ClaudeMailbox/Cli/ServiceCommands.cs b/src/ClaudeMailbox/Cli/ServiceCommands.cs index 8a70bdf..04cc6be 100644 --- a/src/ClaudeMailbox/Cli/ServiceCommands.cs +++ b/src/ClaudeMailbox/Cli/ServiceCommands.cs @@ -61,7 +61,7 @@ public static class ServiceCommands if (!File.Exists(configPath)) { var portStr = ClientCommands.GetOption(args, "--port"); - var port = int.TryParse(portStr, out var p) ? p : 47822; + var port = int.TryParse(portStr, out var p) ? p : 37849; var bind = ClientCommands.GetOption(args, "--bind") ?? "127.0.0.1"; var dbPath = ClientCommands.GetOption(args, "--db-path") ?? defaultDbPath; diff --git a/src/ClaudeMailbox/Config/DaemonConfig.cs b/src/ClaudeMailbox/Config/DaemonConfig.cs index 9df833c..a5fbf75 100644 --- a/src/ClaudeMailbox/Config/DaemonConfig.cs +++ b/src/ClaudeMailbox/Config/DaemonConfig.cs @@ -2,7 +2,7 @@ namespace ClaudeMailbox.Config; public sealed class DaemonConfig { - public const int DefaultPort = 47822; + public const int DefaultPort = 37849; public const string DefaultBindAddress = "127.0.0.1"; public int Port { get; init; } = DefaultPort;