TRAECNclaw MCP
Overview
Use TRAECNclaw through its real stdio MCP server, backed by the local HTTP gateway and TraeCN CDP automation. Keep this skill portable across agents: discover current capabilities from the server, call compact readiness tools before side effects, and verify claims with repo scripts or MCP responses.
Agent Contract
- Treat this as a client-neutral skill for any agent that can read instructions and call stdio MCP tools.
- Do not depend on Codex-only tools, browser automation, Computer Use, or manual UI control when the MCP server can perform the operation.
- Use the MCP tool names returned by
tools/list; the stdio MCP surface usestraecn_*names that may differ from OpenClaw wrapper names and stable command IDs. - Prefer machine-readable outputs (
traecn_get_capabilities,traecn_preflight, task status, proof status) over prose screenshots or manual observation. - Keep generated client config examples editable by the caller: always use absolute paths for local checkouts and documented env vars for host, port, and token.
- Treat
tools/listas profile-scoped. Defaultpublicexposes the common 20 tools;TRAECN_MCP_TOOL_PROFILE=opsexposes operational tools;TRAECN_MCP_TOOL_PROFILE=fullexposes every explicit tool.
Operating Workflow
- Confirm Node 22+ is available and the gateway host can reach TraeCN.
- For a published package install, prefer the package-provided
traecnclaw-mcpbin when it is on the agent hostPATH:
{
"mcpServers": {
"traecn": {
"command": "traecnclaw-mcp",
"env": {
"TRAECN_HOST": "127.0.0.1",
"TRAECN_PORT": "8788",
"TRAECN_GATEWAY_TOKEN": "",
"TRAECN_MCP_TOOL_PROFILE": "public"
}
}
}
}
- For a source checkout, configure the MCP client with an absolute
mcp-server.jspath:
{
"mcpServers": {
"traecn": {
"command": "node",
"args": ["/absolute/path/to/TRAECNclaw/mcp-server.js"],
"env": {
"TRAECN_HOST": "127.0.0.1",
"TRAECN_PORT": "8788",
"TRAECN_GATEWAY_TOKEN": "",
"TRAECN_MCP_TOOL_PROFILE": "public"
}
}
}
}
- Choose a tool profile deliberately:
publicfor general agents,opsfor recovery/proof workflows,fullfor compatibility audits and low-level diagnostics. - Start the gateway separately when needed with
npm run start:gateway; useTRAECN_ENABLE_MOCK_BRIDGE=1 npm run start:gatewayonly for mock-mode development. - Discover before acting: list MCP tools, call
traecn_get_capabilities, then calltraecn_preflightwith the intended command and params. - For side-effecting operations, call
traecn_plan_operationortraecn_preflightfirst and honor any confirmation, readiness, queue, or dialog result. - Use
traecn_list_commandsplustraecn_run_commandwhen a client needs the stable command catalog rather than individual MCP tool names.
Tool Selection
- Short tasks: use
traecn_run_taskafter a cleantraecn_preflight. - Long or queued tasks: use
traecn_queue_task,traecn_wait_task, andtraecn_poll_task; usetraecn_preflightfor queue state inpublic, ortraecn_get_queue_statusonly infull. - Code review: use
traecn_review_codeas the first-class review action. - Model and mode control: use
traecn_switch_model,traecn_switch_mode, andtraecn_create_chat. - Settings through stdio MCP: use
traecn_get_settingsandtraecn_set_setting. - Dialogs: use
traecn_get_dialog_statusandtraecn_respond_dialoginpublic; usetraecn_dismiss_dialogonly when running thefullcompatibility profile. - Review gates, cleanup, and recovery: use the
opsprofile tools such astraecn_get_review_gate_status,traecn_resolve_review_gate,traecn_restart_debug_session, cleanup tools, and long-queue proof tools. - Unattended workflows: use
traecn_run_unattended_workflowinpublic; use direct Solo/proof/cleanup tools only from the profile that exposes them. - Full current catalog and cross-agent config notes: read references/mcp-surface.md when choosing an exact MCP tool or configuring a client.
Profile Scale
public: 20 tools. Use for default published agent integrations.ops: 32 tools. Use for recovery, cleanup, Solo conversation control, and long-queue proof work.full: 36 tools. Use for audits, compatibility checks, and clients that intentionally want every explicit shortcut.
Validation
- Run
node -e "console.log(require('./mcp-server').MCP_TOOLS.map(t => t.name).join('\n'))"to verify the live tool list from code. - Run
npm run doctorfor local environment readiness. - Run
npm testfor the maintained in-repo test sequence after behavior changes. - Run
npm run acceptance:audit -- --require-completebefore claiming unattended end-to-end TraeCN workflow readiness. - For release-style changes, run
npm run test:allwhen practical.
Safety Rules
- Keep the gateway bound to
127.0.0.1unless remote access is intentionally required. - Never commit
.env, tokens, authorization headers, raw TraeCN profile data,audit-logs,demo-output,logs, ornode_modules. - Prefer MCP/HTTP/CLI surfaces over GUI-control paths when the MCP server can perform the operation.
- Treat live TraeCN dialog text, gateway health, cleanup state, and external model queue behavior as environment-specific until revalidated.