Skip to content
GitHub

Native Host

The native host install is the recommended deployment method for macOS and Linux. It runs Gatelet as a system service under a dedicated OS user, providing genuine agent isolation through Unix file permissions.

Agent (your user) Gatelet (_gatelet user)
───────────────── ──────────────────────
Can reach localhost:4000 Owns /var/lib/gatelet/ (mode 700)
Can reach localhost:4001 Stores admin token, DB, credentials
Cannot read /var/lib/gatelet/ ← Unix permissions block access
Cannot authenticate on :4001 ← No admin token

The agent can only interact with the MCP endpoint on port 4000, which requires an API key and enforces configured policies. The admin port (4001) is reachable but useless without the token.

PathOwnerModeContents
/usr/local/lib/gatelet/rootread-onlyApplication files (dist/, node_modules/)
/var/lib/gatelet/_gatelet / gatelet700Database, admin token, credentials
/var/lib/gatelet/admin.token_gatelet / gatelet600Admin authentication token
/var/lib/gatelet/gatelet.db_gatelet / gatelet600SQLite database
Terminal window
# Status
sudo launchctl print system/dev.gatelet
# Logs
cat /var/lib/gatelet/gatelet.log
# Stop / Start
sudo launchctl bootout system/dev.gatelet
sudo launchctl bootstrap system /Library/LaunchDaemons/dev.gatelet.plist
# Uninstall
sudo launchctl bootout system/dev.gatelet
sudo rm /Library/LaunchDaemons/dev.gatelet.plist
Terminal window
# Status
sudo systemctl status gatelet
# Logs
sudo journalctl -u gatelet -f
# Stop / Start
sudo systemctl stop gatelet
sudo systemctl start gatelet
# Uninstall
sudo systemctl disable --now gatelet
sudo rm /etc/systemd/system/gatelet.service
Terminal window
sudo cat /var/lib/gatelet/admin.token

The token is only readable by root and the Gatelet service user. Your agent cannot read it.

Re-run the install script. It preserves your existing data directory and admin token:

Terminal window
curl -fsSL https://gatelet.dev/install-host.sh | bash

The install script configures these via the service file:

VariableValue
GATELET_DATA_DIR/var/lib/gatelet
GATELET_ADMIN_TOKEN_FILE/var/lib/gatelet/admin.token
NODE_ENVproduction

To customize ports, edit the service file directly:

  • macOS: /Library/LaunchDaemons/dev.gatelet.plist
  • Linux: /etc/systemd/system/gatelet.service

The systemd unit includes security directives:

DirectiveEffect
NoNewPrivileges=trueProcess cannot gain new privileges
ProtectSystem=strictFilesystem is read-only except allowed paths
ProtectHome=true/home is inaccessible
ReadWritePaths=/var/lib/gateletOnly the data directory is writable
PrivateTmp=trueIsolated /tmp

”Session not found” after restarting Gatelet

Section titled “”Session not found” after restarting Gatelet”

Gatelet holds up to 20 MCP sessions in memory. When the service restarts, all sessions are lost. Connected agents will receive a “Session not found” error on their next request.

Most MCP clients should automatically re-initialize a new session when this happens (the MCP spec requires clients to handle HTTP 404 this way), but some clients — including Claude Code at the time of writing — surface the error instead. If this happens, restart your agent or reconnect the MCP server from your client.

To install from a local build instead of downloading:

Terminal window
npm run build
GATELET_LOCAL=1 bash install-host.sh