Skip to content

sync_gate 0.2.0

Latest

Choose a tag to compare

@KAYOKG KAYOKG released this 28 Nov 15:44

sync_gate 0.2.0

Hardening of the files sync_gate trusts, limits and recovery for the MCP hub, and the MCP 2026-07-28 replies. Changes since 0.1.4 (#23 to #34, and #35). Two changes can stop a config from loading: read Breaking before you update.

Breaking

  • An MCP server's cwd must be absolute (#32). In [mcp.<name>], cwd must be "inherit" or an absolute path. A relative cwd no longer loads, and that includes /x on Windows, which is not absolute there. env and env_from names must be valid variable names (not empty, no =, no NUL). Before, a relative cwd was resolved from the daemon's folder by the hub and from the session's folder by the relay. Fix: write the full path, or "inherit".
  • Files another account can change are refused (#34). config.toml and the other files sync_gate trusts (the adoption record, the shims, the stored commands of queued tickets, the daemon's records, the PostgreSQL cluster it runs) are refused when an account other than yours can change them. On Windows, the owner and the permissions of the data folder, its parents and each file are checked; a link or other reparse point, a share, or a drive that is not local and fixed is refused, and the message gives the icacls command that fixes it. On Linux and macOS, a file must be yours, not writable by group or others, and have one link: a config.toml owned by another account (root included), for example under /etc, or in a folder your group can write, is not read. sync_gate never repairs a refused file; what to do for each one is in SECURITY.md.

Security hardening

  • Every file sync_gate trusts is checked and then read from the same handle, and a file another program has open for writing is refused.
  • File names that Windows would change or read as something else (a final dot or space, a stream, a device name) are refused before the path is resolved.
  • The control and hub pipes name the user as their owner, as the guest pipe already did (#24).
  • The installer checks its own folder and files (bin\, launcher.cmd, install-state.json, rollback\) with sync_gate paths --check, run by the downloaded binary verified against SHA256SUMS, before it reads its state or resumes a rollback. An uninstall without the installed binary reads no state.
  • The hub answers a client request without "jsonrpc":"2.0" with -32600, before it reaches any queue or server.

Hub

  • Rejected initialize (#31). When the first shared server answers the hub's initialize with an error, its sessions run the server themselves instead of failing. A timed-out initialize still restarts through the backoff.
  • Subscribers (#31). A session whose instance is in crash backoff is served by a ready instance; its resources/subscribe and resources/unsubscribe still wait for the instance that holds them.
  • Recovery (#31). An unsupported server is probed again after 10 minutes. A key is not retired, and an extra instance is not shrunk, while its crashes still count towards a crash loop.
  • Relay fallback (#29). When the hub is lost, the relay replays the client's initialize (up to 8 MiB, any field order) to its own server and checks the whole reply. If it cannot, the session ends with an error instead of running a server that never saw the handshake.
  • Supervisor (#30). Restart notes carry the exit code. Startup cleanup honors stop_grace_secs (1 to 300, default 5) under one total deadline and keeps the state of a child it cannot stop or identify. Each spawn gets its own launch id, so a reused pid never inherits an exit code.
  • One request deadline (#23). A request queued in the hub or the mux keeps the deadline it got when the client sent it, instead of a fresh one when it leaves the queue.
  • Memory (#24, #33). Hub memory is net of what a just-admitted job reserved, and the core counts hub units not measured yet.

MCP spec

#32, for a stateless server, where the hub speaks the 2026-07-28 revision to its clients:

  • a version other than 2026-07-28 gets -32022 with supported and requested;
  • a request missing clientCapabilities gets -32602;
  • results carry resultType;
  • subscriptions/listen is acknowledged with an empty notifications filter; a legacy client still gets -32601;
  • list_changed goes only to sessions that opened with initialize;
  • server/discover is answered as a modern request on a stateless server.

Limits

#33. Fixed values, documented in docs/install.md. A session cut by a limit runs its server itself, as when the hub is down.

Limit Value
Connections to the hub at once 256; one more is closed before anything is read
Write deadline per message to a session 30 s; past it the session is disconnected (stopped reading for 30 s)
Budget shared by every hub queue 256 MiB; past it, a queue holding more than its share takes nothing more
Deadline of the initialize replay the server's request_timeout_secs (default 300)

Fixes

  • Leftover processes on Windows (#27, #28). The recorded start time of a leftover process is the full 100 ns creation time instead of whole seconds, and the check and the stop go through one handle. Rows written in seconds by older versions are forgotten without touching the process.
  • sync_gate wait N while another wait renews the same ticket (#34). It used to exit 2 and ask you to run the original command again while the other wait was running it. It now retries for up to 1 s and, if the renewal lasts, exits 1 as busy.
  • pg_ctl start with no server.log (#13, #26). The starter gets three distinct standard handles; on the GitHub Windows runner, 114 failures in 32000 starts before, 0 in 32000 after.

Plugin

  • New installs use the Sync Labs catalog: claude plugin marketplace add sync-labs-team/plugins and sync-gate@sync-labs (#25). The old sync_gate catalog still works.

Install

Windows (PowerShell):

irm https://gate.synclabs.team/install.ps1 | iex

macOS and Linux:

curl -fsSL https://gate.synclabs.team/install.sh | sh

If an earlier version is installed, the same command updates it. Fix a relative MCP cwd first, or the daemon will not load that config. More in docs/install.md.

Downgrade

Pin the older version with the same command:

& ([scriptblock]::Create((irm https://gate.synclabs.team/install.ps1))) -Version 0.1.4
curl -fsSL https://gate.synclabs.team/install.sh | sh -s -- --version 0.1.4

A version before 0.2.0 cannot check the installer's files; the installer says so and goes on because you pinned it. On Windows, going back to 0.1.1 or older loses the value a SYNC_GATE_* user variable had before sync_gate first wrote it. Details in docs/install.md.

Known limits

From SECURITY.md:

  • Pending command files are readable by other accounts on Windows when a sandbox setup grants them read access to the profile. Do not put a secret on the command line.
  • A refused file is not repaired, and what is checked is its state when it is read: a program that opened a file for writing before its permissions were fixed keeps that access.
  • The program files and the logon task are checked by the installer only, once, before it starts. An uninstall trusts the installed sync_gate.exe to check.
  • A shims folder already on your user PATH keeps running until you delete it and run sync_gate shims install.
  • The release binaries are not code-signed. Check them against SHA256SUMS.
  • The update check calls GitHub once every update_check_days, and the cost key shown in sync_gate status reaches the agent's model provider.

From #2, still open:

  • The hub pipe has no cross-account test yet, and the elevated-daemon case was checked by reading the code, not on a machine.
  • notifications/message from a stateless server stays dropped (no request id to route it on stdio), and the relay keeps an acknowledged subscriptions/listen id in flight until the connection ends.
  • Incoming-line buffers are outside the 256 MiB budget, writes to a server's stdin have no deadline, and the budget ceiling shows only in the log.
  • Large messages are parsed twice, and the time spent under the per-server lock is not measured yet.

Files

File System
sync_gate-0.2.0-x86_64-pc-windows-msvc.zip Windows x64
sync_gate-0.2.0-x86_64-unknown-linux-musl.tar.gz Linux x64 (static)
sync_gate-0.2.0-aarch64-unknown-linux-musl.tar.gz Linux ARM64 (static)
install.ps1, install.sh installers
SHA256SUMS checksums of all files above

License

MIT or Apache-2.0, at your option.