opengent
Turn any terminal — phone, laptop, CI box, agent sandbox — into
yourdomain.com/username. No public IP, no port-forwarding,
no third-party tunnel subscription.
Quickstart
Ask your admin for a domain + frp token, then:
curl -sL yourdomain.com/i \
| OPENGENT_SERVER=yourdomain.com OPENGENT_FRP_TOKEN=<given-by-admin> \
bash -s -- yourname
public link (read-only, safe to share): https://yourdomain.com/yourname/
Stop sharing any time: OPENGENT_SERVER=yourdomain.com ./install.sh stop yourname
How it works
client device VPS (public IP + domain)
┌─────────────┐ ┌───────────────────────────────┐
│ ttyd │ frpc ──tcp──▶ │ frps ──▶ Caddy ──▶ routes │
│ (local pty) │ tunnel │ (relay) (TLS) (/user) │
└─────────────┘ └───────────────────────────────┘
│
https://domain.com/yourname
ttyd serves the pty over HTTP/WebSocket, locally — read-only by default, plus an optional second, unguessable writable link. frp punches a TCP tunnel out through NAT/CGNAT — works from a phone on mobile data. Caddy terminates TLS on the VPS and routes each user's path to their tunneled port. A tiny, dependency-free register-api allocates the port and writes the route on signup.
Why
No public IP needed
Runs from behind NAT or CGNAT — a phone, a home network, a sandboxed CI runner.
Per-user isolation
Own ttyd process, own port, own path, own credentials. No shared shell.
Self-hosted
Your VPS, your domain, your TLS certs. No recurring tunnel-service subscription.
Agent-ready
Ships as an MCP server so an AI agent can share its own terminal on demand.
MCP server
Lets an agent (Claude Code, Claude Desktop, etc.) share its own terminal without shelling out manually.
| Tool | Does |
|---|---|
opengent_share | start sharing, returns URL + credentials |
opengent_stop | stop sharing, release the slug |
opengent_list | list shares on this machine + running status |
{
"mcpServers": {
"opengent": {
"command": "node",
"args": ["/path/to/opengent/mcp/index.js"],
"env": {
"OPENGENT_SERVER": "yourdomain.com",
"OPENGENT_FRP_TOKEN": "<given-by-admin>"
}
}
}
}
Run your own relay
git clone https://github.com/Osaka-Research/opengent
cd opengent/server
sudo OPENGENT_DOMAIN=yourdomain.com ./setup.sh
Installs Caddy, frps, and the register-api as systemd services on a fresh Debian/Ubuntu VPS whose domain already points at it.
Before you expose this to strangers
opengent is a minimal scaffold, not a hardened multi-tenant platform:
OPENGENT_FRP_TOKENis one shared secret for every client — rotate it if it leaks.- the registration endpoint is unauthenticated — anyone reaching it can claim a free username.
- the writable link (
OPENGENT_WRITABLE=1) has no password or approval step — the URL itself is the credential. - whoever opens the writable link gets a real shell as whoever ran
install.sh— treat it like a root password.