简体中文 · Home · Self-hosting
Send this to your agent:
Please configure Agenterm as an MCP server for this agent using Streamable HTTP at https://agenterm.net/mcp. Preserve my existing configuration, check the connection afterward, and tell me if I need to restart or reload.
These examples use the hosted Agenterm service. If a configuration file already exists, merge the agenterm entry rather than replacing other settings.
Codex: Run in a terminal (applies to the CLI and IDE extension):
codex mcp add agenterm --url https://agenterm.net/mcpClaude Code: Run in a terminal to add it for all projects for your user:
claude mcp add --transport http --scope user agenterm https://agenterm.net/mcpGemini CLI: Run in a terminal to add it to your user configuration:
gemini mcp add --transport http --scope user agenterm https://agenterm.net/mcpReload the MCP configuration or restart your agent, then check its MCP settings for the connection status. Other agents that support Streamable HTTP can use the same URL.
For self-hosting, use the MCP address printed at startup and configure your agent to send the management key as an HTTP Bearer credential. Keep the key out of version control.
- Describe the task to your agent and ask it to create an invitation for the target computer.
- Privately send the invitation link to the person at the target computer. When the server issues an invitation without a short link, share the connection command for their operating system. Keep the management key and
control_tokenwith the agent. - On the target computer, open the invitation link or run the shared connection command. If you have the updated Rust CLI, choose I have, then Open terminal app. For first-time setup or if the browser cannot open the updated client, run the command for your operating system. Review the server and approve or deny remote control in the CLI, not on the web page.
- Keep the agent conversation active while the device connects, then start the task. The other person can see commands and output in the client and disconnect at any time.
- Close or disconnect the client when finished.
Short links and codes are available for single-device invitations when the server administrator enables short codes. To connect multiple computers, ask the agent for a multi-device invitation, share the connection command, and identify the target device before each operation.
While a single device is connected, its short link, code, and connection token cannot start another connection. They become available again after disconnection if the token is still valid. The tenth successful short-code redemption retires the link and code. Opening the invitation page does not count toward that limit.
After a successful persistent connection, the client saves the server address locally. Entering a six-character code opens a list of saved servers; choose the one that issued it. The client contacts only the selected server and preserves its HTTP or HTTPS scheme. With no history, paste the short-code address as issued. The CLI uses HTTP for addresses without a scheme. For HTTPS, keep the https:// prefix.
The maintained client is the Rust CLI. Paste a connection token or short-code address to connect. Use the arrow keys or mouse wheel to scroll and drag to select and copy text. Press Esc to clear a selection, then Ctrl+C to disconnect. Temporary connections exit, while persistent connections return to the connection form.
Temporary connections disconnect after five minutes of inactivity, excluding time spent running commands. Persistent connections stay open until disconnected. Regardless of how you open the invitation, choose the mode in the CLI's authorization prompt, which preselects temporary. See how the Rust CLI registers browser links.
Persistent authorization keeps a reusable client in the following directories:
| OS | Cache directory |
|---|---|
| macOS | ~/Library/Application Support/Agenterm/cli |
| Linux | ${XDG_CONFIG_HOME:-~/.config}/Agenterm/cli |
| Windows | %APPDATA%\Agenterm\cli |
The sender can set create_client.connection_mode to "temporary" so the authorization menu offers temporary approval or denial. This requires CLI 0.20.17 or later.
Use CLI 0.20.16 or later. Run the one-click command from the invitation and select temporary authorization. The installer downloads and runs the client in the system temporary directory. Agenterm streams terminal output without creating a local session log. It can write temporary scripts to run commands. On normal exit the installer removes its downloaded copy and temporary files. Changes made by the assistance task and any existing client installation are preserved. If the installer is forcibly stopped or the device loses power, temporary files can remain.
Make sure both the agent and target computer can reach the service; 127.0.0.1 only works on the same computer. If an invitation no longer works, ask the agent to create a new one. For version mismatches, use the server and client from the same release. If another connection is active, close the other client first.
The client automatically attempts to reconnect without replaying commands. With resume credentials, a single-device CLI process can replace its own stale connection after an interruption. Keep the client open and ask the agent to check the device and task state after reconnecting. Connecting a device does not wake an agent conversation that has already ended.
Agenterm provides terminal assistance, not a remote desktop. Windows supports simple interactive input; full-screen programs requiring a real terminal may not work.
Use p2p_transfer_start through MCP to start a direct connection to a device using a persistent Rust CLI connection. Once both ends are connected, you can copy files in either direction over the same connection, one file per copy. Closing the client stops its P2P helper. See the P2P component guide.
A connection grants terminal access with the target computer's current user permissions; authorize only people you trust. The agent, server, and target client can see commands and output. Keep invitations and tokens private, and avoid sending passwords or other secrets through sessions. Disconnecting cannot undo completed operations. Use HTTPS on untrusted networks.
Developers can consult the MCP tool reference.