ClawDaemon MCP

ClawDaemon MCP

Connects Claude Code to a persistent OpenClaw daemon for 24/7 automation of cron jobs, webhooks, and messaging across over 23 platforms. It enables background browser automation and event tracking that persists even when the Claude session is closed.

Category
访问服务器

README

ClawDaemon MCP

An MCP server that connects Claude Code to a persistent OpenClaw daemon for 24/7 automation. Includes a Claude CLI proxy that lets OpenClaw use your Claude Code subscription as its AI brain — no separate API key needed.

What it does

OpenClaw runs as a background daemon on your machine. This MCP server gives Claude Code tools to manage that daemon — create cron jobs, set up webhooks, send messages across 23+ platforms, and automate your browser.

The key difference from other approaches: automations keep running when Claude Code isn't open. When you come back, Claude catches up on everything that happened through an event queue.

Architecture

                        ┌─────────────────────────────────────────────┐
                        │              OpenClaw Daemon (24/7)          │
                        │  ┌─────────┐ ┌──────┐ ┌────────┐ ┌───────┐ │
                        │  │ Discord │ │ Cron │ │Browser │ │ Gmail │ │
                        │  └────┬────┘ └──┬───┘ └───┬────┘ └───┬───┘ │
                        │       └─────────┴─────────┴──────────┘     │
                        │                    │                        │
                        │              Gateway (:18789)               │
                        └──────────┬─────────────────┬───────────────┘
                                   │                 │
              MCP stdio            │  OpenAI API     │
Claude Code ◄──────────► MCP Server│  (:18790)       │
                              │    │                 │
                        SQLite DB  └── Claude Proxy ◄┘
                                         │
                                    claude --print
                                   (your CLI sub)
  • OpenClaw Daemon runs in the background (systemd/launchd). Handles cron, messaging channels, browser automation.
  • MCP Server connects to the daemon and exposes tools for Claude Code.
  • Claude Proxy translates OpenAI API calls to claude --print calls. OpenClaw thinks it's talking to an API, but it's using your Claude Code subscription.
  • Event Queue stores results from automations. When Claude Code reconnects, it polls for missed events.

Prerequisites

Quick Start

1. Install

git clone https://github.com/mordiaky/clawdaemon-mcp.git
cd clawdaemon-mcp
npm install
npm run build

2. Set up OpenClaw

If you haven't installed OpenClaw yet:

git clone https://github.com/openclaw/openclaw.git
cd openclaw
npx pnpm install
npx pnpm build

Start the gateway:

node openclaw.mjs gateway run

The gateway starts on http://127.0.0.1:18789 by default.

3. Connect MCP to Claude Code

claude mcp add clawdaemon -- node /absolute/path/to/clawdaemon-mcp/build/server.js

Optionally add OpenClaw's built-in messaging tools:

claude mcp add openclaw -- node /absolute/path/to/openclaw/openclaw.mjs mcp serve

Restart Claude Code for the tools to load.

4. Set up the Claude Proxy (optional)

The Claude Proxy lets OpenClaw use your Claude Code CLI subscription as its AI model. This means OpenClaw can respond to Discord messages, run heartbeat tasks, and process automations — all powered by Claude, with no separate API key.

Start the proxy

cd clawdaemon-mcp
npm run proxy

The proxy listens on http://127.0.0.1:18790/v1 and translates OpenAI-compatible API calls into claude --print calls.

Configure OpenClaw to use the proxy

Add to your ~/.openclaw/openclaw.json:

{
  "models": {
    "providers": {
      "claude-proxy": {
        "baseUrl": "http://127.0.0.1:18790/v1",
        "api": "openai-completions",
        "models": [
          {
            "id": "claude-cli",
            "name": "Claude via CLI Proxy",
            "input": ["text", "image"],
            "contextWindow": 200000,
            "maxTokens": 8192
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "claude-proxy/claude-cli"
      }
    }
  }
}

Restart the gateway to apply:

openclaw gateway restart

Give the proxy access to your MCP servers

Edit openclaw-mcp-config.json to add any MCP servers you want the proxy-spawned Claude to have access to:

{
  "mcpServers": {
    "clawdaemon": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/clawdaemon-mcp/build/server.js"],
      "env": {}
    },
    "your-other-server": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/your-server/build/index.js"],
      "env": {}
    }
  }
}

The proxy passes this config to claude --print --mcp-config so the Claude instance that responds to messages has full tool access.

MCP Tools

Daemon

Tool What it does
daemon_status Check if OpenClaw gateway is running and healthy

Automation Management

Tool What it does
create_cron Schedule a recurring automation
list_automations List all active automations
delete_automation Remove an automation

Event Polling

Tool What it does
poll_events Get events that happened since last check
acknowledge_event Mark an event as processed
get_event_history Browse past events
prune_events Remove expired events from the queue

Messaging

Tool What it does
send_message Send a message via any connected channel
list_channels List connected messaging channels

Browser Automation

Tool What it does
browser_navigate Open a URL in the browser
browser_extract Get a DOM snapshot of the current page
browser_screenshot Take a screenshot

Configuration

Environment Variables

Variable Default Description
OPENCLAW_GATEWAY_URL ws://127.0.0.1:18789 Gateway WebSocket URL
OPENCLAW_GATEWAY_TOKEN (from ~/.openclaw/openclaw.json) Auth token for gateway
CLAWDAEMON_DB ~/.clawdaemon/events.db Event queue database path
CLAUDE_PROXY_PORT 18790 Port for the Claude CLI proxy

How the Claude Proxy Works

The proxy is a lightweight HTTP server that makes Claude Code CLI look like an OpenAI-compatible API:

  1. OpenClaw sends a standard /v1/chat/completions request
  2. The proxy converts the messages to a prompt string
  3. It spawns claude --print --output-format json --mcp-config openclaw-mcp-config.json
  4. Claude processes the prompt with full MCP tool access
  5. The proxy wraps the response in OpenAI format and returns it
  6. OpenClaw delivers the response to Discord/Telegram/etc.

Supports both streaming (SSE) and non-streaming responses.

Channel Setup (Discord example)

Once the proxy is running and OpenClaw is configured to use it, add a messaging channel:

  1. Create a Discord bot at https://discord.com/developers/applications
  2. Get the bot token, enable Message Content Intent
  3. Add to ~/.openclaw/openclaw.json:
{
  "channels": {
    "discord": {
      "enabled": true,
      "groupPolicy": "open",
      "accounts": {
        "default": {
          "token": "YOUR_DISCORD_BOT_TOKEN"
        }
      }
    }
  }
}
  1. Restart the gateway and invite the bot to your server
  2. DM the bot to trigger pairing, then approve: openclaw pairing approve discord <CODE>

Claude will now respond to Discord messages through the proxy.

Troubleshooting

MCP server won't connect / tools not showing up

  1. Restart Claude Code — MCP tools only load at session start.
  2. Check the gateway is running — Visit http://127.0.0.1:18789.
  3. Check MCP server status — Run /mcp in Claude Code.

Claude Proxy not responding

  1. Check the proxy is runningcurl http://127.0.0.1:18790/v1/models
  2. Check Claude CLI is authenticatedclaude --version
  3. Check proxy logs — Logs go to stderr. Run npm run proxy in a terminal to see them.

Discord bot connects but doesn't receive messages

  1. Enable all three Privileged Gateway Intents in the Discord Developer Portal (Message Content, Server Members, Presence)
  2. Set groupPolicy: "open" in the Discord channel config
  3. DM the bot and complete the pairing flow

"Awaiting gateway readiness" on restart

Discord's WebSocket sometimes doesn't reconnect cleanly. Stop the gateway, wait 15 seconds, then restart:

systemctl --user stop openclaw-gateway.service
sleep 15
openclaw gateway restart

Why this exists

OpenClaw is a powerful automation daemon but its built-in AI requires separate API keys. Claude Code users already have a Claude subscription. This MCP server + proxy lets you use OpenClaw's full automation stack (messaging, cron, browser, webhooks) powered entirely by your existing Claude Code subscription — no additional API costs, no ToS violations.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选