内容
# 星际现金流 — MCP 服务器、AI 技能与 Hermes 工具
驱动 **星际现金流** 转售商 API 以适应任何 AI 代理。星际现金流是一个 CPA 交换平台,提供真实的 Telegram 操作 — 频道订阅者、提升和机器人启动,由经过验证的真实用户(而非机器人)完成。API 与 [JustAnotherPanel](https://justanotherpanel.com/) / Perfect-Panel 兼容。
本仓库提供一份 API 合同,支持三种接口:
| 接口 | 路径 | 适用场景 |
| --- | --- | --- |
| **MCP 服务器** (TypeScript) | `src/` → `dist/` | Claude Desktop, Claude Code, 任意 MCP 主机(Hermes 也兼容 MCP) |
| **通用技能** | `skill/SKILL.md` + `skill/openapi.yaml` | Claude Code 技能,ChatGPT 自定义 GPT 操作(导入 OpenAPI) |
| **Hermes 技能 + CLI** | `hermes/SKILL.md` + `hermes/scripts/` | 自托管 [Hermes 代理](https://github.com/nousresearch/hermes-agent),或任意 shell |
## API 概览
`POST https://api-stars.ros.media/api/v2` — 表单编码,根据 `action` 调度:
| 操作 | 字段 | 返回值 |
| --- | --- | --- |
| `services` | — | 目录(id, name, USD rate /1000, min, max) |
| `balance` | `key` | `{ balance, currency }` |
| `add` | `key, service, link, quantity` | `{ order }` — **消耗余额** |
| `status` | `key, order` / `orders` | `{ charge, start_count, status, remains, currency }` |
| `cancel` | `key, orders` | `{ canceled: [ids] }` — 退款余款 |
从 [`@StarsCashFlowbot`](https://t.me/StarsCashFlowbot) → *转售商* 获取 API 密钥。除 `services` 外,所有操作均需要密钥;密钥持有 USD 余额。速率限制:60 请求/分钟/密钥。
## 🔴 资金安全
`add` 操作扣除真实 USD。每个接口均先估算订单价格,拒绝未经显式确认的支出:
- **MCP** — `create_order` 分两步:第一次调用返回成本估算;仅当再次调用并附带 `confirm: true` 时才下单。
- **CLI** — `order` / `cancel` 打印估算结果,除非传递 `--confirm`,否则不执行任何操作。
- **技能** — 指示代理估算价格、显示成本并在订购前获得确认。
切勿硬编码或打印密钥 — 从 `STARS_CASH_FLOW_API_KEY` 读取。
## MCP 服务器
```bash
npm install
npm run build
```
在 MCP 主机(Claude Desktop / Claude Code `mcp.json`)中注册:
```json
{
"mcpServers": {
"stars-cash-flow": {
"command": "node",
"args": ["/abs/path/to/stars-cash-flow-mcp/dist/index.js"],
"env": {
"STARS_CASH_FLOW_API_KEY": "your-key",
"STARS_CASH_FLOW_API_BASE": "https://api-stars.ros.media/api/v2"
}
}
}
}
```
工具:`list_services`, `get_balance`, `create_order` (需确认),`order_status`, `cancel_order`.
## 通用技能(Claude Code / ChatGPT)
- **Claude Code:** 将 `skill/SKILL.md` 复制到 `.claude/skills/stars-cash-flow/`。
- **ChatGPT 自定义 GPT:** 创建 GPT → *操作* → 导入 `skill/openapi.yaml`;添加密钥作为身份验证头或指示用户提供密钥。
## Hermes 代理
将技能复制到 Hermes 的技能树中,并在提示时设置密钥:
```bash
mkdir -p ~/.hermes/skills/telegram/stars-cash-flow
cp -r hermes/SKILL.md hermes/scripts ~/.hermes/skills/telegram/stars-cash-flow/
export STARS_CASH_FLOW_API_KEY=your-key
```
然后 `/stars-cash-flow price 1000 subscribers for @mychannel`。Hermes 也兼容 MCP,因此上述 MCP 服务器在此也适用。
## 许可证
MIT — 请参阅 [LICENSE](LICENSE)。