agend-sh
OfficialIntegrates with Cloudflare-managed domains: register a zone with a Cloudflare API token (Zone:DNS:Edit, Zone:Zone:Read, Account:Cloudflare Tunnel:Edit), then expose an agent's service on a custom hostname via a Cloudflare tunnel, in addition to the default public HTTPS URLs returned by port exposure.
agend gives your agent a persistent, isolated Linux environment it can drive through MCP. It can run code, edit files, use Python REPLs and Vim, start services, and expose a preview URL. You can open a shell yourself or watch the agent's interactive terminal as it works.
Build | Interact | Show the work |
Run commands and background tasks. Transfer files. Keep projects in your remote workspace. | Drive REPLs and terminal apps through a PTY, with feedback when the terminal enters an input wait. | Open a browser preview or mirror the interactive session with |
Quick start
1. Install
Linux / macOS
curl -fsSL https://agend.sh/i | shWindows · PowerShell
irm https://agend.sh/i.ps1 | iexHomebrew · Linux / macOS
brew install agend-sh/tap/agendThe script installers verify the release signature and archive SHA-256 checksum. The Unix installer writes to /usr/local/bin and may ask for sudo. The Windows installer writes to %LOCALAPPDATA%\agend\bin and adds it to your user PATH. Releases support amd64 and arm64 on all three platforms.
agend version2. Sign in
agend loginComplete authentication in the browser. Creating an account with email and a password instead:
agend signup --email you@example.comsignup prompts for a password and signs you in on success. You do not need to run login again.
3. Create your workspace
agend env create --name my-workspace
agend ping
agend exec 'python3 --version'Creation selects the new environment for CLI commands. Its size follows your account's default profile. Use agend profiles to see available sizes, quotas, and sleep policies; pass a returned profile ID with agend env create --profile <profile-id> to choose another size.
4. Connect your agent
agend config claude-codeOr configure a different client:
agend config codex cursor geminiRestart or reload your client's MCP integration, then try this prompt:
Use agend's
list_environmentsto findmy-workspace. Start an interactive Python REPL there, calculate 6 × 7, then exit the REPL.
Your agent discovers the environment and drives it with MCP tools. An Agend account and available environment quota are required; the CLI alone does not provision a free local machine.
agend-sh is listed in the official MCP Registry
as io.github.agend-sh/agend-sh. For Docker-based installation, see the
container package and connection guide.
Also available on Smithery.
For clients that support MCPB extensions, see the bundle guide.
Related MCP server: CodeAgent MCP
Interactive terminals
The terminal can report that it entered an input wait. That gives the agent process feedback while it drives a REPL or terminal app.
For example, call shell_exec with:
{
"environment": "my-workspace",
"command": "python3 -q",
"interactive": true
}A response can look like this:
status: awaiting_input
>>>
prompt_type: interactive
input_wait: trueContinue through shell_send_raw:
{
"environment": "my-workspace",
"input": "print('hello from agend')\n"
}status: awaiting_input
print('hello from agend')
hello from agend
>>>
input_wait: trueThen send exit()\n through shell_send_raw to close Python.
Reading the response
Field | Meaning |
| The command ended. Check |
| The interactive process is still alive. This status alone does not prove it is waiting for input. |
| An input-wait event was observed while collecting this response: the terminal reader lacked sufficient input and entered its wait path. |
| No new event was observed in this response. It does not cancel a previous event or prove the process stopped waiting. |
| A foreground command exceeded its time budget. |
The input-wait signal is an event, not a persistent state query or a guarantee that an application or service is ready. It depends on support in the environment's guest stack.
For REPLs and TUIs, set interactive: true and use shell_send_raw for subsequent input. Include \n when you want Enter. Use shell_resize when the viewport changes. Quit through the app's own command, or use shell_interrupt to close the session. One interactive session can be active per environment; finish it before starting another shell_exec.
An interactive process stays alive between tool calls and is not killed when its response collection times out. After a completed tool response, disconnecting the MCP client does not itself stop the process: reconnect to the same environment to continue. Environment sleep, a crash, or a cold reset can affect its lifetime.
Watch your agent work
agend watchWatch mirrors the selected environment's interactive session, replays retained output, and follows new updates. It sends no input to the remote process. Press q or Ctrl+C to stop watching; the agent's session continues.
For a screen recording:
agend watch --typing-delay 40msMatch your terminal's size to the remote session for an accurate display. Watch follows output collected by the agent's tool calls; it does not poll the guest for output between those calls. It shows interactive sessions, not ordinary command output or background-task logs.
Want to work in the environment yourself?
agend connectThis opens a live terminal with keyboard input and terminal resizing. Run exit to close the shell. It requires a terminal on stdin and uses the same single interactive-session slot as MCP, so close the agent's interactive app first.
Share a browser preview
Have your agent start a service using shell_exec:
{
"environment": "my-workspace",
"command": "python3 -m http.server 8080 --bind 0.0.0.0 --directory /home/agend-user/readme-demo",
"run_in_background": true
}Create /home/agend-user/readme-demo and put your demo files there first. Bind the service to 0.0.0.0 so the tunnel can reach it.
Then call port_expose:
{
"environment": "my-workspace",
"port": 8080
}The response contains a public HTTPS URL. Allow time for the tunnel and DNS to become reachable. port_list shows active exposures; port_unexpose removes one. Exposing a port makes that service reachable from the internet.
For your own Cloudflare-managed domain, register its zone with agend domain add example.com, then pass domain: "app.example.com" to port_expose. Registration prompts for a Cloudflare API token with Zone:DNS:Edit, Zone:Zone:Read, and Account:Cloudflare Tunnel:Edit permissions; scripts can supply it through AGEND_CF_TOKEN. agend domain list returns the domain IDs used by agend domain remove <domain-id>.
Connect your agent
agend config detects supported clients installed on your machine. Preview its choices before writing:
agend config --dry-run
agend configYou can also select clients explicitly:
Client | Command |
Claude Code |
|
Claude Desktop |
|
Codex |
|
Cursor / Windsurf |
|
Gemini CLI / Antigravity |
|
VS Code / Zed / JetBrains |
|
Cline / Roo Code |
|
OpenCode / GitHub Copilot CLI |
|
Amazon Q / Goose / Continue |
|
Configuration registers agend mcp as a local stdio server. The client must be able to find the installed binary; on Windows, the config writer uses its absolute path. Client-specific config paths and formats are handled by agend config.
For clients that use the mcpServers JSON format:
{
"mcpServers": {
"agend": {
"command": "agend",
"args": ["mcp"]
}
}
}Use the absolute binary path if the client does not inherit your shell's PATH. This is a generic example; some clients use a different schema. agend mcp reads JSON-RPC from stdin and writes protocol responses to stdout; logs go to stderr. Tool results are MCP text content, including fields such as status and input_wait.
MCP tools
The CLI exposes 23 tools. Call list_environments to discover IDs and names. Environment-specific tools require an environment argument and accept either an ID or a name. env_create, list_environments, profiles_list, and reload_config do not need one.
Area | Tool | What it does |
Environments |
| Discover environments, names, descriptions, state, and tier. |
| Show available sizes, quotas, and usage. | |
| Create an environment; optional | |
| Edit or clear an environment name and description. | |
| Inspect state and metadata without waking the environment. | |
| Wake a sleeping environment. | |
| Last-resort recovery for a stuck environment; requires a diagnostic reason. | |
Shell |
| Run a command with a timeout, head/tail truncation, interactive mode, or background mode. |
| Send bytes to an interactive app; no newline is appended. | |
| Answer a simple prompt in an active terminal session; appends a newline. Use | |
| Resize the active PTY. | |
| Interrupt a command or close the interactive session. | |
| Read a background task's output and status. | |
| Stop a background task. | |
Files |
| Atomically write text to a remote file. |
| Transfer a local file to the environment. | |
| Transfer a remote file to the local machine. | |
| Move or rename a remote file. | |
Networking |
| Expose a service through a public HTTPS tunnel. |
| List exposed ports and URLs. | |
| Remove an exposure; optionally target one domain. | |
Diagnostics |
| Inspect disk, memory, CPU, and processes. |
| Reload credentials after changes in another terminal and reset connections. |
interactive and run_in_background are mutually exclusive. Background execution returns a task_id for the task tools.
Local paths in file_upload and file_download are confined to the MCP server's working directory, or to AGEND_LOCAL_ROOT if you set it in the server's environment. Downloads return transfer metadata; read text with shell_exec or open the downloaded local file. For large files, downloading directly inside the remote environment with curl or wget is usually faster.
CLI reference
CLI commands operate on the selected environment. Use environment IDs with agend env use and other CLI environment commands; MCP tools also resolve names.
agend env list
agend env use <env-id>
agend exec 'pwd'Environments and accounts
Command | Purpose |
| List profiles available to your account. |
| Provision and select a workspace. |
| List environments. |
| Select an environment; wakes it if sleeping. |
| Edit metadata; |
| Inspect state without waking it. |
| Wake a sleeping environment. |
| Recover a genuinely stuck environment through a cold boot. |
| Permanently delete an environment and its data. |
| Show authentication and selected-environment status. |
| Create an account and sign in with a password prompt. |
| Authenticate through your browser. |
| Sign in with an email and password. |
| Save a direct API token. |
| List saved accounts. |
| Switch accounts. |
| Remove a saved account. |
| Remove the active account's local credentials, or all saved accounts. |
Cold reset preserves the persistent data disk but discards guest memory, processes, sessions, and snapshots. It is a recovery operation. Creating, selecting, or executing in an environment can boot or wake it; env status is the read-only inspection path.
Shell, files, and tasks
Command | Purpose |
| Open a live interactive terminal. |
| Mirror the interactive session without sending input. |
| Execute a remote command. |
| Answer a simple prompt; appends a newline. |
| Resize the active PTY. |
| Interrupt the active command/session. |
| Check connectivity and show backend version. |
| Print remote file content to stdout. |
| Write supplied content to a remote file. |
| Move or rename a remote file. |
| Read background-task output. |
| Stop a background task. |
exec supports --timeout in milliseconds (default: 30000), --head, --tail, --background, and --interactive. For a live terminal, use connect; for an agent driving a REPL or TUI, use MCP's interactive tool workflow.
For example:
agend file-put /home/agend-user/hello.txt 'hello from agend'
agend file-get /home/agend-user/hello.txt
agend exec --timeout 60000 'python3 --version'file-get writes file metadata to stderr. file-put takes content, not a local filename; use MCP's file_upload for local file transfer. Both CLI file commands support --encoding text or --encoding base64; file-put also supports --create-dirs, --overwrite, and --mode.
A team owns shared environments. A lease gives a member exclusive access until it is released or expires.
Command | Purpose |
| Create a team you own. |
| List your teams. |
| Invite a member. |
| Accept an invitation. |
| List members. |
| List shared environments and lease status. |
| Inspect profiles available to a team. |
| Provision a shared environment. |
| Acquire an exclusive lease. |
| Extend the lease. |
| Release it. |
When the selected environment belongs to a team, agend mcp attempts to acquire its lease, heartbeats while connected, and releases it on normal shutdown. A lease held by another member blocks access. A hard-killed client can leave a lease until its expiry.
Updates and troubleshooting
agend updateThe updater verifies the signed checksum manifest and archive before replacing the binary. An already running MCP process continues using its current version until restarted. Release builds also check automatically for updates at most once per 24 hours; set AGEND_NO_AUTOUPDATE=1 to disable those automatic checks. For a Homebrew-managed install, use brew upgrade agend.
Situation | What to do |
Installer prints | Use |
Agent cannot find the server | Check |
CLI has no selected environment | Run |
New environment is not reachable yet | Inspect |
Input reports no active session | Start the app with |
| This can occur intermittently in the current backend after a shell has run successfully. See the verification report; start a new |
Local file path is rejected | Keep it inside the MCP working directory or configure |
Browser preview URL does not open yet | Check that the service is running and bound to |
Environment appears stuck | Inspect |
Corporate proxy blocks connectivity | Set |
Credentials and per-account environment selection live in ~/.config/agend/credentials.json, with owner-only file permissions on Unix. On Windows, ~ is your user profile and access is governed by Windows filesystem permissions. For scripted email/password authentication, use AGEND_PASSWORD; the CLI prompts otherwise.
Development
Requires Go 1.26.9+. From a source checkout:
git clone https://github.com/agend-sh/cli.git
cd cli
make build
./bin/agend versionmake install builds and copies the binary to /usr/local/bin; that directory must be writable. On Windows, build directly with go build -o agend.exe ./cmd/agend.
go test ./...
go vet ./...CI builds, tests, and vets on Linux and Windows, with additional cross-compilation checks. Version tags trigger GoReleaser to publish Linux/macOS tarballs and Windows zip archives for amd64 and arm64, a checksum manifest, and its Sigstore signature bundle. The Homebrew tap updates through its own workflow. make release is a local Unix cross-build target, not the publishing workflow.
See the README verification report for the tested release, live checks, current issues, and coverage limits.
Your MCP agent
│ stdio / JSON-RPC
▼
agend mcp ──────────────── agend connect / agend watch
│ authenticated gRPC over a WebSocket tunnel
▼
Environment backend
│
▼
Isolated Linux workspaceThe MCP bridge resolves each environment's endpoint on demand, keeps a connection pool, and handles connection recovery. Direct CLI shell access uses the same backend. You do not need to install a separate tunnel client.
Path | Purpose |
| Entry point and injected version. |
| CLI commands, client configuration, and updates. |
| JSON-RPC server, tool definitions, connection pool, and local-path rules. |
| Backend client and transport. |
| Control-plane HTTP client. |
| Accounts, credentials, and browser authentication. |
| Connection-error classification. |
| Generated protobuf and gRPC definitions. |
License
MIT.
This server cannot be deployed
Related MCP Connectors
Persistent Linux computers for AI agents: desktop, signed-in browser, vault, apps and shell.
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Persistent Linux microVMs for agents: root, internet, sub-second resume and a public URL.
Real Linux labs your AI agent deploys, routes and runs, with domains, TLS, DBs and an audit log.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenancePersistent, secure LXC sandbox environments for AI agents with native MCP support.305Apache 2.0
- AlicenseAqualityBmaintenanceSelf-hosted MCP server that gives AI assistants a real Linux development environment: file editing, shell commands, tmux terminals, and browser screenshots, with bounded access through a project registry and write gates.39MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to operate a persistent Linux sandbox in the cloud, running commands, managing files, using Git, and publishing artifacts through a Streamable HTTP MCP endpoint.-
- FlicenseBqualityBmaintenanceEnables AI agents to create and control persistent terminal sessions, run and monitor asynchronous jobs, page through ordered event history, and resolve registered device connection details without exposing stored secrets. Exposes 15 MCP tools over stdio that mirror a REST API, keeping session state alive independently of the agent that started it.15-