Skip to content

fix: ssh-config safety, macOS CLI resolution, share paths, test typecheck (0.1.4) - #60

Merged
TMHSDigital merged 5 commits into
mainfrom
fix/issue-batch-1
Oct 25, 2026
Merged

TMHSDigital merged 5 commits into
mainfrom
fix/issue-batch-1

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Summary

This PR fixes a batch of correctness and safety issues and releases them as 0.1.4. There's one commit per issue cluster.

README, mcp-tools.json, and CHANGELOG are updated to match.

Output change: with httpsPort/path, stop_share now reports stopped as {httpsPort, path} instead of a bare port number.

Test plan

  • npm run typecheck (src + tests)
  • npm test: 60/60 on Linux (WSL, Node 22); 59 + 1 POSIX-only skip on Windows
  • Built dist/index.js exercised over stdio against the real Tailscale 1.102.3 CLI: TAILSCALE_MCP_BIN override, BINARY_NOT_FOUND / DAEMON_NOT_RUNNING payloads, path validation errors
  • Not verified against a live tailnet: the exact access-denied wording on Linux, and whether serve --https=443 --set-path=<p> off also clears Funnel for that mount (tracked with the contract tests in Weekly contract tests against the real tailscale CLI to catch output-format drift #47)

Closes #31
Closes #32
Closes #35
Closes #42
Closes #53
Closes #54
Closes #55

🤖 Generated with Claude Code

TMHSDigital and others added 5 commits October 25, 2026 16:20
Adds tsconfig.test.json so npm run typecheck covers src/**/__tests__, fixes
the 12 latent TS2345 errors by sharing a payload() helper that accepts the
SDK's callTool union, and adds a typecheck step to the CI workflow.

Closes #35

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…writes

- Markers are matched as whole lines; orphaned, reversed, or duplicated
  markers raise SSH_CONFIG_MARKERS_CORRUPT and leave the file untouched,
  so a repeat run can no longer delete user content. CRLF is preserved.
- Host aliases come from the first MagicDNS label (sanitized OS hostname
  fallback), are always a single [a-z0-9-] token, and collisions get a
  numeric suffix reported under renamed. Mullvad exit nodes and sharee
  nodes are skipped and reported (includeShared opts back in).
- Writes go through a temp file + rename, keep the previous config as
  config.tailscale-mcp.bak, create files 0600 / ~/.ssh 0700, keep existing
  modes, write through symlinks, and skip no-op rewrites. Only ENOENT is
  treated as a missing config; other read errors return
  SSH_CONFIG_UNREADABLE.

Closes #31
Closes #32
Closes #42

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…enied

- Try /Applications/Tailscale.app/Contents/MacOS/Tailscale and the
  Homebrew prefixes after a PATH miss on macOS (generalizing the Windows
  fallback), with a macOS-specific BINARY_NOT_FOUND remedy.
- TAILSCALE_MCP_BIN overrides binary resolution on every platform; a
  missing explicit path reports the configured path and skips fallbacks.
- Access/permission denied output from serve, funnel, and reset maps to a
  new PERMISSION_DENIED code with the Linux operator remedy
  (sudo tailscale set --operator=$USER).

Closes #53
Closes #54

Co-Authored-By: Claude Opus 5.5 <[email protected]>
stop_share takes an optional path (default "/") mapped to
serve --https=<port> --set-path=<path> off, so a share created at a path
can be stopped without serve reset wiping every share. share_port and
stop_share validate paths at the schema (leading slash, URL-safe
characters, no dot segments) and drop trailing slashes so both tools name
the same mount.

Closes #55

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added code tests Test suite and coverage ci CI/CD workflows labels Oct 25, 2026
@TMHSDigital
TMHSDigital merged commit 9ea857c into main Oct 25, 2026
6 checks passed
@TMHSDigital
TMHSDigital deleted the fix/issue-batch-1 branch October 25, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment