mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-03 22:59:54 +08:00
* feat(cli): openclaw attach — launch Claude Code bound to a gateway session with scoped MCP tools * fix(cli): use token-only MCP config for attach --------- Co-authored-by: Ayaan Zaidi <hi@obviy.us>
1.2 KiB
1.2 KiB
summary, read_when, title
| summary | read_when | title | ||
|---|---|---|---|---|
| CLI reference for `openclaw attach` (launch Claude Code with a scoped Gateway MCP grant) |
|
Attach CLI |
openclaw attach launches Claude Code with a strict temporary MCP config bound
to one Gateway session.
openclaw attach
openclaw attach --session agent:main:telegram:123 --ttl 600000
openclaw attach --print-config
Options:
--session <key>binds the grant to a Gateway session. Defaults to the main session.--ttl <ms>requests a positive grant TTL in milliseconds. The Gateway applies its own ceiling.--bin <path>selects the Claude Code binary. Defaults toclaude.--print-configwrites the temporary.mcp.json, prints the launch command and env, and leaves the grant live until TTL expiry.
The bearer token is passed through environment variables, not argv. OpenClaw
launches Claude Code with --strict-mcp-config --mcp-config <path> so ambient
Claude MCP servers do not join the attached session. Normal launches revoke the
grant when the Claude Code process exits.
See also: Gateway CLI, MCP CLI, and ACP CLI.