← Back to Skills Marketplace
Claw Service Hub
by
TangBoheng
· GitHub ↗
· v0.1.0
· MIT-0
122
Downloads
1
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install claw-service-hub
Description
OpenClaw 服务市场核心 - 服务注册、发现与调用,支持 Provider 注册服务、Consumer 发现服务、WebSocket 隧道调用、Key 授权机制
README (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 数据库路径
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install claw-service-hub - After installation, invoke the skill by name or use
/claw-service-hub - Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.0
Initial release - 服务注册、发现与调用
Metadata
Frequently Asked Questions
What is Claw Service Hub?
OpenClaw 服务市场核心 - 服务注册、发现与调用,支持 Provider 注册服务、Consumer 发现服务、WebSocket 隧道调用、Key 授权机制. It is an AI Agent Skill for Claude Code / OpenClaw, with 122 downloads so far.
How do I install Claw Service Hub?
Run "/install claw-service-hub" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Claw Service Hub free?
Yes, Claw Service Hub is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Claw Service Hub support?
Claw Service Hub is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Claw Service Hub?
It is built and maintained by TangBoheng (@tangboheng); the current version is v0.1.0.
More Skills