← 返回
未分类 Key 中文

Claw Relay — Browser Access for AI Agents

Control a remote browser through Claw Relay using the CLI client. Use when you need to navigate authenticated websites, click buttons, fill forms, take scree...
通过 CLI 客户端使用 Claw Relay 控制远程浏览器。适用于需要登录的网站导航、点击按钮、填写表单、截取屏幕截图等场景。
andreagriffiths11 andreagriffiths11 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 560
下载
💾 3
安装
1
版本
#latest

概述

Claw Relay — OpenClaw CLI Client

> If your platform supports MCP (Copilot CLI, Claude Desktop, Gemini CLI), use skills/browser/SKILL.md instead. This skill is for OpenClaw, nanobot, ZeroClaw, and other agents that call tools via exec.

⚠️ IMPORTANT: No MCP Required

Do NOT write an MCP server, bridge, or wrapper. You already have everything you need:

  • The exec tool (built into OpenClaw)
  • The relay-client.cjs script (in this folder)

That's it. One exec call per browser action. No MCP, no bridge, no custom server.

Setup

Set environment variables (or pass as flags):

export CLAW_RELAY_URL="wss://relay.clawrelay.dev/"
export CLAW_RELAY_TOKEN="your-token"
export CLAW_RELAY_AGENT="your-agent-id"

The client script is at skills/openclaw/relay-client.cjs in the claw-relay repo.

Usage

node relay-client.cjs [--url URL] [--token TOKEN] [--agent-id ID] ACTION [ARGS...]

Flags override env vars. Every invocation connects, authenticates, performs ONE action, prints JSON, and exits.

Actions

ActionArgsDescription
---------------------------
navigateNavigate to URL
snapshotGet accessibility tree with element refs
screenshot[filepath]Take screenshot; saves to filepath if given
clickClick element by ref
fill Replace input content with text
type Append text to input
pressPress keyboard key (Enter, Tab, Escape, etc.)
hoverHover over element
select Select dropdown option(s)
evaluateRun JavaScript in the page
closeClose the browser tab

Workflow

navigate → snapshot → find ref → act → snapshot → verify
  1. Navigate to the target URL
  2. Snapshot to read the page and get element refs (e.g. e3, e7)
  3. Act — click, fill, type, press using refs from the snapshot
  4. Verify — snapshot again to confirm the page changed

Example: Search GitHub

# Step 1: Navigate
node relay-client.cjs navigate https://github.com

# Step 2: Snapshot to find the search input ref
node relay-client.cjs snapshot

# Step 3: Fill the search box (say ref is e3)
node relay-client.cjs fill e3 claw-relay

# Step 4: Press Enter
node relay-client.cjs press Enter

# Step 5: Snapshot to read results
node relay-client.cjs snapshot

Example: Click a Button

# Find the button
node relay-client.cjs snapshot
# Output shows button at ref e7

# Click it
node relay-client.cjs click e7

# Verify
node relay-client.cjs snapshot

Example: Take a Screenshot

node relay-client.cjs screenshot /tmp/page.png
# Output: {"ok":true,"path":"/tmp/page.png","bytes":...}

Example: Run JavaScript

node relay-client.cjs evaluate "document.title"

OpenClaw exec Integration

Use the exec tool directly. Each call connects, authenticates, performs one action, and exits:

exec: node /path/to/relay-client.cjs snapshot
exec: node /path/to/relay-client.cjs navigate https://github.com
exec: node /path/to/relay-client.cjs click e3

Set CLAW_RELAY_URL, CLAW_RELAY_TOKEN, and CLAW_RELAY_AGENT in your environment or pass them as flags each time.

Do NOT try to keep a persistent connection, start a background process, or write wrapper scripts. The CLI handles connection lifecycle automatically.

Security Constraints

  • Allowlist — your agent can only access sites explicitly allowed in its config
  • Blocklist — banking, email, and auth providers are always blocked regardless of allowlist
  • Rate limiting — actions are rate-limited per agent
  • Audit log — every action is logged with agent ID, action, target, and result

Troubleshooting

"Invalid token or agent_id"

  • Agent ID is case-sensitive. Check config.yaml for exact casing (e.g., Rustyrusty)
  • Make sure the token matches exactly — no extra spaces or line breaks
  • The relay must be restarted after editing config.yaml

"Agent lacks scope for 'navigate'"

  • Your agent's scopes in config.yaml don't include the action you're trying to use
  • Common scopes: read (snapshot/screenshot), navigate, interact (click/fill/type), execute (evaluate)
  • Ask the relay admin to update your scopes

Script errors

  • "require is not defined" — the script must be .cjs, not .js (the repo uses ES modules)
  • "Cannot find module 'ws'" — run npm install in the relay-server/ directory first

Common mistakes

  • ❌ Writing an MCP server or bridge — you don't need one
  • ❌ Keeping a persistent connection — each call is stateless
  • ❌ Wrapping the CLI in another script — just call it directly via exec

What Makes This Different

Local browser tools require agent and browser on the same machine. Claw Relay doesn't. Your agent runs anywhere and controls the user's real browser remotely — real cookies, real sessions, real logins. No headless browser, no fake profiles.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-03 04:56 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Agent Context

andreagriffiths11
一个持久的本地记忆系统,专为AI编码代理设计。采用双文件架构:AGENTS.md(已提交,共享)和.agents.local.md(被git忽略,个人使用)。代理在会话开始时读取两者,会话结束时更新草稿板,逐步优化稳定模式。适用于Claud
★ 0 📥 418
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,385 📥 321,021
ai-agent

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,232 📥 268,321