Osaka-Research · open source

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.

View on GitHub Quickstart MCP tool

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.

ToolDoes
opengent_sharestart sharing, returns URL + credentials
opengent_stopstop sharing, release the slug
opengent_listlist 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: