This guide explains the current kmsg + OpenClaw integration model.
Core Model
There are two different interfaces:
- MCP, via
kmsg mcp-server - real-time streaming, via
kmsg watch "<chat>" --json
Today, MCP is still request/response only. It exposes:
kmsg_readkmsg_sendkmsg_send_image
watch is not an MCP tool. If you want real-time auto-reply, run watch --json as a separate process and feed each event into OpenClaw or a small wrapper around it.
Recommended Architecture
Use two processes:
kmsg mcp-serverkmsg watch "채팅방 이름" --json
The flow is:
watch --jsonemits a new KakaoTalk event- your supervisor passes that event to OpenClaw
- OpenClaw drafts a reply
- the reply is sent with
kmsg_sendthrough MCP, orkmsg senddirectly
This separation matters:
- MCP handles tool calls cleanly
watchhandles low-latency inbound detection- you do not need a streaming MCP extension to operate today
Prerequisites
- macOS with KakaoTalk installed
- Accessibility permission granted for
kmsg kmsginstalled and working
Check first:
kmsg --version
kmsg status
MCP Setup
Run the MCP server:
kmsg mcp-server
The stdio server accepts both MCP Content-Length framing and newline-delimited JSON-RPC input. It replies with the same framing style as the current request, so older OpenClaw-style clients and simpler NDJSON supervisors can use the same binary.
Config example:
{
"mcpServers": {
"kmsg": {
"command": "kmsg",
"args": ["mcp-server"],
"env": {
"KMSG_DEFAULT_DEEP_RECOVERY": "false",
"KMSG_TRACE_DEFAULT": "false"
}
}
}
}
You can copy:
docs/openclaw.mcp.example.json
Real-Time Watch Setup
Run a dedicated watch process for the chat you want to automate:
kmsg watch "채팅방 이름" --json
watch --json emits one JSON object per detected event on stdout.
Example:
{
"chat": "홍길동",
"detected_at": "2026-03-25T10:20:30.123Z",
"event": "message",
"message": {
"author": "홍길동",
"time_raw": "10:20",
"body": "새 메시지"
}
}
Notes:
watchnow defaults to 200ms polling- startup uses a short warm-up to avoid backfill
- messages earlier than the watch start cutoff are suppressed
--trace-axlogs stay onstderr
Tool Contracts
kmsg_read
Input:
{
"chat": "채팅방 이름",
"limit": 20,
"deep_recovery": false,
"keep_window": false,
"trace_ax": false
}
Success shape:
{
"ok": true,
"chat": "채팅방 이름",
"fetched_at": "2026-02-26T03:10:10.123Z",
"count": 20,
"messages": [
{
"author": "홍길동",
"time_raw": "00:27",
"body": "밤이 깊었네"
}
],
"meta": {
"latency_ms": 1820
}
}
kmsg_send
Input:
{
"chat": "채팅방 이름",
"message": "테스트 메시지",
"confirm": false,
"deep_recovery": false,
"keep_window": false,
"trace_ax": false
}
Notes:
confirm=falseor omitted sends immediatelyconfirm=truedoes not send and returnsCONFIRMATION_REQUIRED
kmsg_send_image
Input:
{
"chat": "채팅방 이름",
"image_path": "/path/to/image.png",
"confirm": false,
"deep_recovery": false,
"keep_window": false,
"trace_ax": false
}
Operating Modes
Recommended: Draft Then Approve
watch --jsonemits a message- OpenClaw drafts a reply
- user approves
- send with
kmsg_send
This is the safest default because KakaoTalk is a personal chat surface and mistakes are expensive.
Minimal send call:
{
"name": "kmsg_send",
"arguments": {
"chat": "홍길동",
"message": "검토 후 전송합니다.",
"confirm": false
}
}
Advanced: Full Auto-Reply
watch --jsonemits a message- OpenClaw generates a reply automatically
- your supervisor immediately calls
kmsg_send
Use this only with guardrails. At minimum:
- ignore your own messages
- restrict to specific chat rooms
- add cooldown / loop protection
- log every outbound message
Quick Start
Minimal manual setup:
kmsg mcp-server
In another process:
kmsg watch "채팅방 이름" --json
Then wire the watch events into OpenClaw and send replies through MCP kmsg_send.
Troubleshooting
If watch fails:
kmsg watch "채팅방 이름" --json --trace-axkmsg inspect --window 0 --depth 20
If MCP fails:
kmsg mcp-serverkmsg status- confirm Accessibility permission and KakaoTalk readiness
- if a client sends JSON lines instead of
Content-Lengthframes, keep one JSON-RPC request per line