Give AI agents safe, structured access to your Linux servers.
HostMesh is a local-first control plane for MCP-compatible clients such as Cursor, Claude Code, and Codex. The Portal, policy engine, identities, audit log, and SQLite database stay on your machine; remote Linux hosts run a deterministic agent reached through SSH.
Install the Local Control Plane on macOS or Linux (amd64 or arm64):
curl -fsSL https://github.com/sotarak/hostmesh/releases/latest/download/install-hostmesh.sh | bashThe installer downloads the release archive, verifies its SHA-256 checksum, installs hostmesh into ~/.local/bin, and starts a per-user service. It uses LaunchAgent on macOS and a systemd user service on Linux. No root daemon or shell-profile edit is required.
The Portal opens at http://127.0.0.1:47821. To inspect the script before running it, download install-hostmesh.sh from the release page first.
To build instead:
git clone https://github.com/sotarak/hostmesh.git
cd hostmesh
make build
./bin/hostmesh startSee Installation for upgrades, service locations, manual builds, and uninstall options.
- Open the Portal and create a workspace.
- Go to Servers → Add server.
- Enter the SSH host, port, user, and labels.
- Copy the generated command and the one-time enrollment token.
- Run the command on the Ubuntu server and enter the token when prompted.
curl -fsSL https://github.com/sotarak/hostmesh/releases/latest/download/install-agent.sh | sudo bashThe token is read from /dev/tty, so it does not appear in shell history or process arguments. It is short-lived, single-use, and bound to one workspace and server. The agent listens only on 127.0.0.1:7443; HostMesh reaches it through an SSH tunnel.
- Local Portal, API, SQLite state, controller identity, and one stdio MCP server.
- Workspace-scoped server registry and label selectors.
- SSH-first enrollment with permanent Ed25519 controller/agent trust.
- Signed, target-bound controller requests and agent responses.
- Semantic system, process, file, service, and network inspection.
- Reusable custom policies with managed templates and server attachments.
- Deny-by-default evaluation with
DENY > APPROVAL > ALLOW. - Agent-side hard denies, bounded execution/output, and two-phase audit events.
- Local server removal separated from remote agent uninstall.
Current implementation status and future work live in Project status and roadmap, not in this README.
Cursor / Claude Code / Codex
│
│ MCP (stdio)
▼
┌─────────────────────────────┐
│ HostMesh Local Control Plane│
│ Portal · Workspaces · Policy│
│ Connections · Audit · SQLite│
└──────────────┬──────────────┘
│ SSH tunnel
▼
┌─────────────────────────────┐
│ Linux server │
│ hostmesh-agent │
│ 127.0.0.1:7443 │
└─────────────────────────────┘
Every remote operation follows the same path:
MCP → workspace target resolution → persisted policy → audit start
→ SSH transport → signed agent request → agent validation
→ signed response → audit completion
The Portal includes reusable policy templates:
- Default read-only diagnostics for the normal inspection workflow.
- Log files reader for
file.readbeneath/var/log/**only. - System inspector for system, process, service, and network metadata without file access.
Templates are cloned into editable custom policies and attached to servers. Use Replace current policies when reducing a server to least privilege; adding policies unions their rules. No matching rule means deny.
Ensure hostmesh is on the MCP client's PATH, then configure one local MCP server:
{
"mcpServers": {
"hostmesh": {
"command": "hostmesh",
"args": ["mcp"]
}
}
}Choose the default workspace with hostmesh workspace use <workspace-id>. Tools target a server by name/ID or a bounded label selector; HostMesh never creates one MCP namespace per server. See MCP.
Remove a remote Ubuntu agent while preserving its identity/state:
curl -fsSL https://github.com/sotarak/hostmesh/releases/latest/download/uninstall-agent.sh | sudo bashRemove the local controller while preserving local data:
curl -fsSL https://github.com/sotarak/hostmesh/releases/latest/download/uninstall-hostmesh.sh | bashBoth uninstallers support --purge; destructive purge requires an interactive confirmation or explicit --yes. Removing a server in the Portal only removes its local registry data—it never SSHes into the host or uninstalls the agent.
HostMesh is localhost-only and local-first, but it is not yet presented as production-grade security software. Important controls include workspace isolation, one-time enrollment, permanent identities, signed target-bound protocol messages, policy resource constraints, agent hard denies, checksum-verified artifacts, and bounded audit-safe operations.
Review the threat model and current limitations in Security. Report vulnerabilities through SECURITY.md, not a public issue.
- Installation
- Architecture
- Enrollment
- Policies
- Portal
- MCP
- Development
- GitHub Releases
- Project status and roadmap
Focused issues and pull requests are welcome. Read CONTRIBUTING.md and AGENTS.md before changing protocol, policy, enrollment, transport, or other trust boundaries.