Agent Handshake for Openclaw

Openclaw Skills turns AI servers into discoverable, persistent agents with one-command registration, acceptance, and handshake workflows.

lyliefeng
v0.1.0
Jul 19, 2026
0
441
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install agent-handshake

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install agent-handshake using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Agent Handshake?

Openclaw Skills provides a standardized handshake layer for AI agents: a server publishes its identity, the local side validates and stores it, and future connections can be initiated with a single command. It is built for heterogeneous stacks such as OpenCode, LangChain, CrewAI, generic FastAPI services, and MCP endpoints, making Openclaw Skills a practical discovery and connection layer for mixed agent fleets.

By combining server-side registration, local persistence under references/servers/, and optional Cloudflare Quick Tunnel support, Openclaw Skills lets you connect to agents on a LAN, behind NAT, or on a VPS without losing track of which machine you are talking to. The result is a repeatable CLI workflow that adds memory, identity, and traceability to agent-to-agent and human-to-agent handoffs.

Agent Handshake Use Cases

  • When a user asks to handshake, connect, or discover an OpenCode server from the CLI.
  • When a new OpenCode CLI instance is installed and needs to be registered into local memory.
  • When you need to identify exactly which NAS, cloud host, or LAN machine you are connecting to.
  • When a server sits behind NAT or a firewall and needs a Cloudflare Quick Tunnel for temporary public access.
  • When you want SSH-like remote execution on a VPS via HTTP instead of opening port 22.
  • When Openclaw Skills should maintain a persistent inventory of known AI servers for fast re-handshakes and repeatable automation.

How Agent Handshake Works

  1. The server runs register.sh to collect hostname, OS, architecture, hardware, port, health endpoint, agent type, and SSH fingerprint.
  2. register.sh generates a machine identity JSON under references/servers/<hostname>.json and confirms the agent is reachable.
  3. The local machine receives that identity through copy, accept.sh, or a tunnel, then validates health and reachability.
  4. accept.sh persists the server record locally, updates references/servers/_index.json, and stores the best known address in ~/.agent-handshake.
  5. discover.sh scans the network and matches known identities so Openclaw Skills can tell the user exactly which machine is available.
  6. handshake.sh auto selects the most appropriate URL, displays the server banner, opens the session, and returns the result of the task.
  7. For NAT or VPS scenarios, tunnel.sh or deploy.sh extends the workflow with Cloudflare Quick Tunnel or HTTP-based remote task execution.

Agent Handshake Setup

  1. Install OpenCode CLI on any server that will expose OpenCode Serve, or make sure your FastAPI or MCP agent already has a /health endpoint.
  2. Place the Openclaw Skills directory on the local machine and on each server that will register itself.
  3. Register the server identity from the server side:
chmod +x scripts/*.sh
bash scripts/register.sh
bash scripts/register.sh opencode
  1. Accept the server locally and persist it:
bash scripts/accept.sh lvliefeng http://192.168.5.2:4096
  1. If the server is behind NAT, start a tunnel first and then accept the tunnel URL:
bash scripts/tunnel.sh start
bash scripts/accept.sh lvliefeng https://random-name.trycloudflare.com
  1. Optional OpenCode Serve configuration:
export OPENCODE_AUTH='opencode:opencode123'
export OPENCODE_PORT='4096'
export OPENCODE_PROVIDER='zen'
export OPENCODE_MODEL='deepseek-v4-flash-free'
  1. For VPS deployments, bootstrap the HTTP agent shell:
bash scripts/deploy.sh 4096 user:pass
  1. Verify the end-to-end handshake with an automatic connection:
bash scripts/handshake.sh auto 'list NAS docker projects'

Agent Handshake Data Schema & Taxonomy

Openclaw Skills stores server identity and discovery state as durable JSON records, with a per-host file plus an indexed inventory.

Path Generated by Purpose Key contents
references/servers/<hostname>.json register.sh and accept.sh Persistent per-server identity record hostname, agent_type, protocol, OS, kernel, arch, CPU, memory, disk, LAN IPs, public IP, agent version, port, SSH fingerprint, tunnel URL, generated timestamp
references/servers/_index.json accept.sh Global registry of all known servers servers map, total count, quick lookup keys
~/.agent-handshake accept.sh User-level memory for preferred or last-known endpoints canonical URL, selected LAN or tunnel address, auth hints, local defaults

Metadata taxonomy

  • Identity: hostname, OS, kernel, architecture
  • Agent: agent_type, agent version, protocol, exposed endpoints
  • Network: LAN IPs, public IP, port, tunnel URL
  • Hardware: CPU model, memory size, disk capacity
  • Security: SSH fingerprint, auth mode, Basic Auth secret reference
  • Lifecycle: generation time, last accepted time, health status

Supported agent_type values

  • opencode
  • langchain
  • crewai
  • generic-fastapi
  • generic
  • mcp

Protocol matching rules

  • opencode uses GET /global/health and the session flow through /session
  • langchain and crewai typically expose GET /health and POST /chat
  • generic-fastapi is discovered through GET /health plus /docs or /openapi.json
  • generic is accepted as any HTTP agent that returns a valid health JSON payload
  • mcp is tracked through its MCP endpoint and health discovery path

This schema lets Openclaw Skills remember exactly which machine is which, even when multiple AI servers share the same local network.

Agent Handshake Advanced Features

  • Automatic agent type detection across opencode, langchain, crewai, generic-fastapi, generic, and mcp.
  • Cloudflare Quick Tunnel support for NAT traversal, zero-account temporary HTTPS, and fast remote access.
  • handshake.sh auto chooses the best available address type automatically and shows a server identity banner before connecting.
  • Persistent memory via references/servers/_index.json and ~/.agent-handshake, so Openclaw Skills remembers every registered server.
  • SSH-like remote execution on VPS with agent_shell.py and /run over HTTP Basic Auth.
  • Protocol-aware health verification using /global/health, /health, /openapi.json, and MCP discovery paths.
  • Lightweight deployment that can install a systemd service and auto-start on boot.
  • Discovery, registration, and session handoff are bundled into one CLI-native workflow for multi-server Openclaw Skills setups.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*