Repository navigation
feat!: Funnel off by default, safe stop_share, structured share_status, bounded CLI calls (0.2.0) - #61
Merged
Conversation
Timeouts (#34): - CliProvider.run enforces a per-call deadline (default 10s, override via TAILSCALE_MCP_TIMEOUT_MS) through an AbortSignal the runner honors, plus a hard fallback if a runner ignores it; timeouts raise TIMEOUT with a remedy. serve keeps inspecting partial output so a blocked serve still reports SERVE_NOT_ENABLED. - ping_all has a 45s overall deadline: in-flight pings are cancelled, unstarted ones skipped, and the response reports timedOut with per-row errors. Ping parsing (#33): - All pong lines are parsed; path/latency come from the last (settled) reply, with attempts and replies counts. - path is direct | derp | peer-relay | unknown; peer-relay and TSMP/ICMP replies are no longer labeled direct. Latency is parsed as a Go duration (0s, 1.234s, 850us), which the old "in (\d+)ms" regex missed. Closes #33 Closes #34 Co-Authored-By: Claude Opus 5.5 <[email protected]>
share_status parses tailscale serve status --json (ipn.ServeConfig) into endpoints with url, serve port, mount path, target, a per-endpoint public flag (AllowFunnel), and foreground-session marking, plus TCP forwards and a top-level publicExposure. CLIs without --json fall back to the text form (publicExposure: null). Also gives the real-process runner test enough time to start on slow machines. Closes #43 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e/after
stop_share with no arguments used to run serve reset, wiping shares the
server never created. It now stops nothing and returns TARGET_REQUIRED
listing the active endpoints. Targets are exactly one of httpsPort/path
(one mount), mine=true (mounts share_port created this session), or
all=true (the old reset-everything behavior). Every call returns removed
and remaining endpoints, from share_status before and after.
BREAKING CHANGE: stop_share {} no longer clears the serve config; use
stop_share {"all": true}.
Closes #41
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- share_port public=true returns FUNNEL_DISABLED (before any CLI call) unless TAILSCALE_MCP_ALLOW_FUNNEL=1; the tool description says so, so agents know before trying. - TAILSCALE_MCP_READONLY=1 leaves share_port and stop_share unregistered and makes generate_ssh_config refuse write=true (READ_ONLY); status, share_status, ping_all, and the ssh dry run remain. - Env parsing moves to src/config.ts (also wiring TAILSCALE_MCP_BIN and TAILSCALE_MCP_TIMEOUT_MS); malformed values stop the server at startup instead of silently falling back. BREAKING CHANGE: Funnel requires TAILSCALE_MCP_ALLOW_FUNNEL=1. Closes #40 Co-Authored-By: Claude Opus 5.5 <[email protected]>
mcp-tools.json is now a vitest file snapshot of what a default install advertises via listTools(), so the test suite (and therefore CI) fails whenever a tool changes without regenerating it. npm run gen:tools rewrites it. The regenerated file picks up descriptions, constraints, and fields that had drifted from the hand-maintained version. Contributor docs now point at gen:tools instead of hand edits. Closes #36 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This batch finishes the safety work: no tool can expose a port to the internet or wipe shares by default, every CLI call is bounded, and the docs can't drift from the tools. It releases as 0.2.0 because two defaults change (see Breaking). There's one commit per issue.
share_port {"public": true}returnsFUNNEL_DISABLEDbefore any CLI call unlessTAILSCALE_MCP_ALLOW_FUNNEL=1is set. The tool description says so up front.TAILSCALE_MCP_READONLY=1leavesshare_portandstop_shareunregistered, andgenerate_ssh_configrefuses writes.src/config.ts, and a malformed value stops startup.stop_sharesafety (stop_share with no arguments wipes all Serve/Funnel config, including shares not made by this server #41)httpsPort/path,mine: true(shares created this session), orall: true.removedandremaining.share_status(share_status: return structured endpoints with an explicit public/Funnel flag #43)serve status --json(ipn.ServeConfig) into endpoints with a per-endpointpublicflag,publicExposure, TCP forwards, and foreground sessions.TAILSCALE_MCP_TIMEOUT_MS) via an AbortSignal, with a hard fallback if a runner ignores it. Timeouts return a structuredTIMEOUTerror.ping_allis capped at 45s and returns partial results withtimedOut.servestill inspects partial output, so a blocked serve reportsSERVE_NOT_ENABLED.pathisdirect | derp | peer-relay | unknown, plusattempts/replies.in (\d+)msregex missed0sand1.234s.mcp-tools.jsonis a vitest file snapshot oflistTools().npm run gen:toolsregenerates it, and CI fails when it's stale.Breaking
TAILSCALE_MCP_ALLOW_FUNNEL=1.stop_share {}no longer resets everything; use{"all": true}.share_statusoutput is structured, and the rawstatustext appears only on old CLIs.pathgainspeer-relayandunknown.Sources checked
ipn/serve.go(ServeConfig/WebServerConfig/HTTPHandler)cmd/tailscale/cli/ping.go(pong line format,peer-relay(...), rounded Go-duration latency, per-attempt timeout lines,--until-directexit behavior)RemoveWebHandler(..., cleanupFunnel=true)). That answers the open question from fix: ssh-config safety, macOS CLI resolution, share paths, test typecheck (0.1.4) #60.Test plan
npm run typecheck(src + tests)CI=true npm test: 91/91 on Linux (WSL, Node 22); 90 + 1 POSIX-only skip on Windowsmcp-tools.json(including withCI=true) and passes afternpm run gen:toolsdist/index.jsover stdio against the real Tailscale 1.102.3 CLI:stop_share {}refusedserve status --json({}) parseddefaultCliRunnertest)serve status --jsonfixture and the multi-pong/peer-relay lines are hand-built from the Go source above. The weekly contract tests in Weekly contract tests against the real tailscale CLI to catch output-format drift #47 should capture real ones.Closes #33
Closes #34
Closes #36
Closes #40
Closes #41
Closes #43
🤖 Generated with Claude Code