Claw远程控制
claw-relay-openclaw
by andreagriffiths11
Control a remote browser through Claw Relay using the CLI client. Use when you need to navigate authenticated websites, click buttons, fill forms, take screenshots, or read page content on a user's real browser — and your platform doesn't support MCP. Triggers on remote browser control, authenticated browsing, real browser, cookie-based access, browser relay.
安装
claude skill add --url https://github.com/openclaw/skills文档
Claw Relay — OpenClaw CLI Client
If your platform supports MCP (Copilot CLI, Claude Desktop, Gemini CLI), use
skills/browser/SKILL.mdinstead. This skill is for OpenClaw, nanobot, ZeroClaw, and other agents that call tools viaexec.
⚠️ IMPORTANT: No MCP Required
Do NOT write an MCP server, bridge, or wrapper. You already have everything you need:
- The
exectool (built into OpenClaw) - The
relay-client.cjsscript (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
| Action | Args | Description |
|---|---|---|
navigate | <url> | Navigate to URL |
snapshot | — | Get accessibility tree with element refs |
screenshot | [filepath] | Take screenshot; saves to filepath if given |
click | <ref> | Click element by ref |
fill | <ref> <text> | Replace input content with text |
type | <ref> <text> | Append text to input |
press | <key> | Press keyboard key (Enter, Tab, Escape, etc.) |
hover | <ref> | Hover over element |
select | <ref> <values...> | Select dropdown option(s) |
evaluate | <js> | Run JavaScript in the page |
close | — | Close the browser tab |
Workflow
navigate → snapshot → find ref → act → snapshot → verify
- Navigate to the target URL
- Snapshot to read the page and get element refs (e.g.
e3,e7) - Act — click, fill, type, press using refs from the snapshot
- 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.yamlfor exact casing (e.g.,Rusty≠rusty) - 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
scopesinconfig.yamldon'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 installin therelay-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.
相关 MCP 服务
Puppeteer 浏览器控制
编辑精选by Anthropic
Puppeteer 是让 Claude 自动操作浏览器进行网页抓取和测试的 MCP 服务器。
✎ 这个服务器解决了手动编写 Puppeteer 脚本的繁琐问题,适合需要自动化网页交互的开发者,比如抓取动态内容或做端到端测试。不过,作为参考实现,它可能缺少生产级的安全防护,建议在可控环境中使用。
Brave 搜索
编辑精选by Anthropic
Brave Search 是让 Claude 直接调用 Brave 搜索 API 获取实时网络信息的 MCP 服务器。
✎ 如果你想让 AI 助手帮你搜索最新资讯或技术文档,这个工具能绕过传统搜索的限制,直接返回结构化数据。特别适合需要实时信息的开发者,比如查 API 更新或竞品动态。不过它依赖 Brave 的 API 配额,高频使用可能受限。
网页抓取
编辑精选by Anthropic
Fetch 是 MCP 官方参考服务器,让 AI 能抓取网页并转为 Markdown 格式。
✎ 这个服务器解决了 AI 直接处理网页内容时格式混乱的问题,适合需要让 Claude 分析在线文档或新闻的开发者。不过作为参考实现,它缺乏生产级的安全配置,你得自己处理反爬虫和隐私风险。