← 返回 Skills 市场
tangboheng

Claw Service Hub

作者 TangBoheng · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
122
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install claw-service-hub
功能描述
OpenClaw 服务市场核心 - 服务注册、发现与调用,支持 Provider 注册服务、Consumer 发现服务、WebSocket 隧道调用、Key 授权机制
使用说明 (SKILL.md)

Claw Service Hub

OpenClaw 服务市场核心 - 服务注册、发现与调用

概述

claw_service_hub 是 Claw-Service-Hub 的核心服务包,提供服务的注册、发现、调用等核心功能。

功能

  • 服务注册 - Provider 注册服务到 Hub
  • 服务发现 - Consumer 发现可用服务(支持模糊搜索、价格排序)
  • 服务调用 - 通过 WebSocket 隧道调用服务
  • Key 授权 - 基于调用次数/时间的授权机制
  • 负载均衡 - 多 Provider 场景下的分发
  • 议价功能 - 支持价格协商(negotiation_offer/counter/accept)
  • 评分系统 - 服务评分与评价
  • 帮助命令 - 内置帮助系统

安装

pip install -e .

快速开始

启动 Hub 服务

# 使用 CLI 启动
python -m claw_service_hub.cli

# 或指定端口
python -m claw_service_hub.cli --port 8765

注册服务 (Provider)

from hub_client import HubClient

client = HubClient(
    hub_url="ws://localhost:8765",
    service_id="my-weather-service",
    service_url="http://localhost:8080"
)

await client.register()

发现服务 (Consumer)

from hub_client import HubClient

client = HubClient(hub_url="ws://localhost:8765")

# 列出所有服务
services = await client.discover_services()

# 按名称查找
service = await client.find_service("weather-service")

CLI 命令

# 启动服务
claw-service-hub start

# 注册服务
claw-service-hub register --service-id my-service --url http://localhost:8080

# 列出服务
claw-service-hub list

# 查看状态
claw-service-hub status

与其他模块的关系

claw_service_hub (核心服务)
    │
    ├── claw-trade-hub (交易模块)    - 扩展交易功能
    └── claw-chat-hub (通讯模块)     - 扩展聊天功能

文件结构

claw_service_hub/
├── __init__.py         # 导出 CLI
├── cli.py              # 命令行工具
└── SKILL.md            # 本文件

使用示例

作为 Python 模块

from claw_service_hub import cli
from claw_service_hub.cli import HubClient

# 使用 CLI
cli()

# 或直接使用客户端
import asyncio

async def main():
    client = HubClient(
        hub_url="ws://localhost:8765",
        service_id="my-weather-service",
        service_url="http://localhost:8080"
    )
    await client.register()

asyncio.run(main())

配置

环境变量:

  • HUB_PORT - 服务端口 (默认 8765)
  • HUB_HOST - 绑定地址 (默认 0.0.0.0)
  • STORAGE_PATH - SQLite 数据库路径
安全使用建议
This package appears incomplete or inconsistent: the README and metadata describe a full Hub server but the bundle only contains a CLI that expects a server module (server.main) which is not present. Before installing or running: (1) inspect or obtain the missing server implementation and package metadata (setup.py/pyproject) so dependencies and runtime behavior are clear; (2) do not set or expose sensitive paths/credentials (e.g., STORAGE_PATH pointing at production data) until you confirm storage code and access patterns; (3) be aware the CLI makes network calls (WebSocket/HTTP) to hosts you specify — test in an isolated environment and avoid connecting to untrusted endpoints; (4) confirm required Python dependencies (aiohttp, websockets, click) and review their versions; (5) if the author can provide the missing server.main or clarify why env vars are declared but unused, re-evaluate. My confidence is high because the missing server module and unused env vars are concrete, reproducible inconsistencies.
功能分析
Type: OpenClaw Skill Name: claw-service-hub Version: 0.1.0 The skill bundle implements a service marketplace hub for OpenClaw, providing tools for service registration, discovery, and invocation via WebSockets and REST. The provided files (cli.py, SKILL.md) contain legitimate CLI logic and documentation consistent with the stated functionality, with no evidence of data exfiltration, malicious execution, or prompt injection. The code uses standard libraries like click, aiohttp, and websockets to manage service lifecycle and communication.
能力评估
Purpose & Capability
The skill's description claims a full 'core' Hub (registration, discovery, WebSocket tunneling, storage, authorization, negotiation, load balancing). However the bundle only contains a CLI client (cli.py) and no server implementation (the start command imports server.main.HubServer which is not included). Required env vars include STORAGE_PATH and HUB_HOST but those are not read/used by the provided CLI. This mismatch suggests the provided files are incomplete or the skill metadata overstates capability.
Instruction Scope
SKILL.md instructs users to 'pip install -e .' and to start the Hub with python -m claw_service_hub.cli (implying the package includes a server). In practice the CLI will try to import server.main which is missing and will fail to start a hub. The CLI uses network operations (WebSocket and HTTP requests) to arbitrary hosts; these are expected for a hub client but you should not run it against untrusted endpoints. The docs declare env vars (HUB_PORT, HUB_HOST, STORAGE_PATH) but the CLI sets HUB_PORT/HUB_HTTP_PORT and does not read STORAGE_PATH, so the runtime instructions and code disagree.
Install Mechanism
There is no explicit install spec in the registry metadata (instruction-only skill). SKILL.md suggests 'pip install -e .', but the bundle does not include package metadata files (setup.py/pyproject.toml not shown here). The code imports third-party libs (aiohttp, websockets, click) that would need to be installed; lack of an explicit dependency spec is inconvenient but not itself high risk.
Credentials
Required env vars listed are HUB_PORT, HUB_HOST, STORAGE_PATH. The CLI sets HUB_PORT/HUB_HTTP_PORT defaults but does not read STORAGE_PATH anywhere; HUB_HOST is declared but not used as an environment variable by the code. No credentials are required. Requesting STORAGE_PATH (a database path) is disproportionate given the provided files don't implement storage. This misalignment could be accidental but is unexpected.
Persistence & Privilege
The skill is not marked always:true and does not request elevated system-wide privileges. It does modify process environment variables at runtime (os.environ.setdefault) but does not persist changes beyond the process or modify other skills. Autonomous invocation is allowed by default (no disable-model-invocation), which is normal for skills.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install claw-service-hub
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /claw-service-hub 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release - 服务注册、发现与调用
元数据
Slug claw-service-hub
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Claw Service Hub 是什么?

OpenClaw 服务市场核心 - 服务注册、发现与调用,支持 Provider 注册服务、Consumer 发现服务、WebSocket 隧道调用、Key 授权机制. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 122 次。

如何安装 Claw Service Hub?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install claw-service-hub」即可一键安装,无需额外配置。

Claw Service Hub 是免费的吗?

是的,Claw Service Hub 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Claw Service Hub 支持哪些平台?

Claw Service Hub 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Claw Service Hub?

由 TangBoheng(@tangboheng)开发并维护,当前版本 v0.1.0。

💬 留言讨论