cherry-mcp
HTTP 桥接器使 MCP 服务器保持活动状态并通过 REST 公开它们。专为需要 MCP 工具而没有本机 MCP 支持的 OpenClaw 代理而构建。
安装 / 下载方式
TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:totalclaw~bitbrujo-cherry-mcpcURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~bitbrujo-cherry-mcp/file -o bitbrujo-cherry-mcp.md# Cherry MCP 🍒
## Origin Story
Built during a late-night session trying to use MCP servers with OpenClaw. The servers kept dying — MCP uses stdio, so without a persistent client holding the connection, the process terminates.
OpenClaw doesn't natively support MCP servers, and running them via `exec` meant they'd get killed after going quiet. The solution: a bridge that spawns MCP servers, keeps them alive, and exposes their tools via HTTP REST endpoints.
Named after my emoji. 🍒
*— EULOxGOS, Feb 2026*
## Why
MCP servers use stdio — they die without a persistent client. Cherry MCP:
- Spawns MCP servers as child processes
- Keeps them alive (auto-restart on crash)
- Exposes HTTP endpoints for each server
## Quick Start
```bash
# Add a server
node cli.js add-server github npx @anthropic/mcp-github
# Set env vars for the server
node cli.js set-env github GITHUB_TOKEN ghp_xxx
# Start
pm2 start bridge.js --name cherry-mcp
```
## CLI
```bash
# Servers
node cli.js add-server <name> <command> [args...]
node cli.js remove-server <name>
node cli.js list-servers
# Environment variables
node cli.js set-env <server> <KEY> <value>
node cli.js remove-env <server> <KEY>
# Security
node cli.js set-rate-limit <rpm> # requests per minute
node cli.js set-allowed-ips <ip>... # IP allowlist
node cli.js enable-audit-log # log requests
# Other
node cli.js show-config
node cli.js restart
```
## HTTP API
```bash
# List servers
curl http://localhost:3456/
# List tools
curl http://localhost:3456/<server>/tools
# Call a tool
curl -X POST http://localhost:3456/<server>/call \
-H "Content-Type: application/json" \
-d '{"tool": "search", "arguments": {"query": "test"}}'
# Restart server
curl -X POST http://localhost:3456/<server>/restart
```
## Security
- Binds to `127.0.0.1` only (not exposed to network)
- Optional rate limiting
- Optional IP allowlist
- Optional audit logging
- 1MB max payload
### ⚠️ Important Notes
**Commands are user-configured only.** The bridge executes commands specified in `config.json` — it does not accept arbitrary commands via HTTP. You control what runs.
**Don't commit secrets.** If you store API keys via `set-env`, they're saved in plain text in `config.json`. Add it to `.gitignore` or use environment variables instead:
```bash
# Alternative: set env vars before starting
export GITHUB_TOKEN=ghp_xxx
pm2 start bridge.js --name cherry-mcp
```
Then reference in config without the value:
```json
{
"servers": {
"github": {
"command": "npx",
"args": ["@anthropic/mcp-github"],
"env": {}
}
}
}
```
The server inherits your shell environment.
## Running
```bash
# pm2 (recommended)
pm2 start bridge.js --name cherry-mcp
pm2 save
# Auto-start on boot
pm2 startup
```
---
## 中文说明
# Cherry MCP 🍒
## 起源故事
诞生于一个深夜会话,当时尝试在 OpenClaw 中使用 MCP 服务器。这些服务器不断挂掉 —— MCP 使用 stdio,因此没有持久客户端保持连接时,进程就会终止。
OpenClaw 本身并不支持 MCP 服务器,而通过 `exec` 运行它们意味着它们在安静一段时间后会被杀死。解决方案:一个桥接器,用于生成 MCP 服务器、保持它们存活,并通过 HTTP REST 端点公开它们的工具。
以我的 emoji 命名。🍒
*— EULOxGOS, Feb 2026*
## 为什么
MCP 服务器使用 stdio —— 没有持久客户端时它们会挂掉。Cherry MCP:
- 将 MCP 服务器作为子进程生成
- 保持它们存活(崩溃时自动重启)
- 为每个服务器公开 HTTP 端点
## 快速开始
```bash
# Add a server
node cli.js add-server github npx @anthropic/mcp-github
# Set env vars for the server
node cli.js set-env github GITHUB_TOKEN ghp_xxx
# Start
pm2 start bridge.js --name cherry-mcp
```
## CLI
```bash
# Servers
node cli.js add-server <name> <command> [args...]
node cli.js remove-server <name>
node cli.js list-servers
# Environment variables
node cli.js set-env <server> <KEY> <value>
node cli.js remove-env <server> <KEY>
# Security
node cli.js set-rate-limit <rpm> # requests per minute
node cli.js set-allowed-ips <ip>... # IP allowlist
node cli.js enable-audit-log # log requests
# Other
node cli.js show-config
node cli.js restart
```
## HTTP API
```bash
# List servers
curl http://localhost:3456/
# List tools
curl http://localhost:3456/<server>/tools
# Call a tool
curl -X POST http://localhost:3456/<server>/call \
-H "Content-Type: application/json" \
-d '{"tool": "search", "arguments": {"query": "test"}}'
# Restart server
curl -X POST http://localhost:3456/<server>/restart
```
## 安全
- 仅绑定到 `127.0.0.1`(不暴露到网络)
- 可选的速率限制
- 可选的 IP 白名单
- 可选的审计日志
- 最大 1MB 负载
### ⚠️ 重要说明
**命令仅由用户配置。** 桥接器执行 `config.json` 中指定的命令 —— 它不接受通过 HTTP 传入的任意命令。你控制运行什么。
**不要提交密钥。** 如果你通过 `set-env` 存储 API 密钥,它们会以明文形式保存在 `config.json` 中。请将其添加到 `.gitignore`,或改用环境变量:
```bash
# Alternative: set env vars before starting
export GITHUB_TOKEN=ghp_xxx
pm2 start bridge.js --name cherry-mcp
```
然后在配置中引用而不带具体值:
```json
{
"servers": {
"github": {
"command": "npx",
"args": ["@anthropic/mcp-github"],
"env": {}
}
}
}
```
服务器会继承你的 shell 环境。
## 运行
```bash
# pm2 (recommended)
pm2 start bridge.js --name cherry-mcp
pm2 save
# Auto-start on boot
pm2 startup
```