Cherry MCP:MCP 服务器的持久化 HTTP 桥接器 - Openclaw Skills

作者:互联网

2026-03-25

AI快讯

什么是 Cherry MCP?

Cherry MCP 是一个强大的桥接器,旨在克服模型上下文协议(MCP)的持久性挑战。由于 MCP 服务器通常通过 stdio 进行通信,它们会在调用进程结束时立即终止。该技能通过将 MCP 服务器作为持久子进程启动来解决此问题,确保它们保持活跃并随时可以执行工具。

通过将这些 stdio 进程转换为可靠的 HTTP REST 终端,Cherry MCP 允许 Openclaw Skills 与各种兼容 MCP 的工具(如 GitHub、搜索引擎或数据库)进行交互,而无需原生 MCP 实现。它作为一个中间件层,处理进程健康状况、环境变量和安全访问。

下载入口:https://github.com/openclaw/skills/tree/main/skills/bitbrujo/cherry-mcp

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install cherry-mcp

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 cherry-mcp。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Cherry MCP 应用场景

  • 使缺乏原生 MCP 支持的 AI 代理能够使用模型上下文协议工具。
  • 维持与基于 stdio 的服务器的长期连接,以防止频繁重启。
  • 创建集中式 HTTP 网关,用于管理多个 MCP 服务器(例如 GitHub、文件系统、Google 搜索)。
  • 为需要触发 MCP 特定功能的自动化脚本提供稳定的 REST API。
Cherry MCP 工作原理
  1. 用户通过 CLI 添加 MCP 服务器配置,定义入口命令和参数。
  2. Cherry MCP 将服务器作为子进程启动,并保持打开的 stdio 管道以维持连接。
  3. 桥接器启动一个 HTTP 服务器(默认为 localhost)以传入的工具请求。
  4. 收到 REST 调用时,桥接器将 JSON 负载转换为通过 stdio 发送的符合 MCP 标准的工具执行请求。
  5. 捕获服务器响应并作为标准 HTTP 响应返回给调用者。

Cherry MCP 配置指南

要开始使用 Cherry MCP,请使用提供的 CLI 注册服务器,然后启动桥接守护进程。

# 添加 MCP 服务器(例如 GitHub MCP 服务器)
node cli.js add-server github npx @anthropic/mcp-github

# 安全地配置敏感凭据
node cli.js set-env github GITHUB_TOKEN 您的个人访问令牌

# 使用 PM2 启动桥接器以实现后台持久化
pm2 start bridge.js --name cherry-mcp

Cherry MCP 数据架构与分类体系

Cherry MCP 以 JSON 格式在本地管理其配置。它跟踪服务器定义和安全参数,以确保在 Openclaw Skills 环境中无缝运行。

组件 描述
servers 将服务器名称映射到其可执行命令和参数。
env 存储特定 MCP 服务器身份验证所需的环境变量。
security 管理 IP 白名单、频率限制 (RPM) 和审计日志状态。
audit_log (可选)记录工具执行历史记录,以便进行调试和坚控。
name: cherry-mcp
description: HTTP bridge that keeps MCP servers alive and exposes them via REST. Built for OpenClaw agents that need MCP tools without native MCP support.
tags: mcp, bridge, rest, api, openclaw, http, tools, automation, stdio

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

# 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

# Servers
node cli.js add-server   [args...]
node cli.js remove-server 
node cli.js list-servers

# Environment variables
node cli.js set-env   
node cli.js remove-env  

# Security
node cli.js set-rate-limit       # requests per minute
node cli.js set-allowed-ips ...   # IP allowlist
node cli.js enable-audit-log          # log requests

# Other
node cli.js show-config
node cli.js restart

HTTP API

# List servers
curl http://localhost:3456/

# List tools
curl http://localhost:3456//tools

# Call a tool
curl -X POST http://localhost:3456//call r
  -H "Content-Type: application/json" r
  -d '{"tool": "search", "arguments": {"query": "test"}}'

# Restart server
curl -X POST http://localhost:3456//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:

# 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:

{
  "servers": {
    "github": {
      "command": "npx",
      "args": ["@anthropic/mcp-github"],
      "env": {}
    }
  }
}

The server inherits your shell environment.

Running

# pm2 (recommended)
pm2 start bridge.js --name cherry-mcp
pm2 save

# Auto-start on boot
pm2 startup