内容
">
<a href="https://three.ws"><img src="https://three.ws/three-ws-mcp-icon.svgthree.ws" width="88" height="88"></ap>
<h1 align="center">@three-ws/alerts-mcp</h1>
<p align="center"><strong>从任何 AI 代理运行自己的 pump.fun 监控 — 定义警报规则,通过应用内 / 签名 webhook / Telegram 交付,并读取已触发的警报历史。</strong></p>
<p align="center">
<a href="https://www.npmjs.com/package/@three-ws/alerts-mcp"><img alt="npm" src="https://img.shields.io/npm/v/@three-ws/alerts-mcp?logo=npm&color=cb3837"></a>
<img alt="license" src="https://img.shields.io/npm/l/@three-ws/alerts-mcp?color=3b82f6">
<img alt="node" src="https://img.shields.io/node/v/@three-ws/alerts-mcp?color=339933&logo=node.js">
<a href="https://registry.modelcontextprotocol.io/?q=io.github.nirholas"><img alt="MCP Registry" src="https://img.shields.io/badge/MCP%20Registry-io.github.nirholas-0ea5e9"></a>
<a href="https://three.ws"><img alt="three.ws" src="https://img.shields.io/badge/built%20by-three.ws-000"></a>
</p>
---
> 一个 [Model Context Protocol](https://modelcontextprotocol.io) 服务器,将 three.ws pump.fun **alerts** 接口转换为基于代理驱动控制平面。定义 pump.fun 事件规则 — 值穿越、鲸鱼购买、新上线 — 让 three.ws cron 评估这些规则并在应用内、webhook 和 Telegram 上交付。同时读取实际触发的警报及其每个通道的交付健康状况。
规则是**账户范围**的:每个调用都 three.ws 会话,因此服务器只读取和写入**您的**规则和**您的**警报历史。pumpfun-monitor cron 在服务器端执行监视,因此您的规则在多个设备上触发,无需打开仪表板。
## 安装
```bash
npm install @three-ws/alerts-mcp
```
或使用 `npx`(无需安装):
```bash
npx-ws/alerts-m```
## 快速开始
**Claude Code**命令:
```bash
cp add alerts -_WS_SESSION=your-__Host-sid-cookie -- ny @three-ws/alerts-mcp
```
**Claude Cursor**(`claude_desktop_config.json` 或 `mcp.json`):
```json
{
"m": {
"alerts": {
" "npx",
"args": ["-y", "@three-ws/alerts-mcp"],
"env": "THREE_WS_SESSION": "yourHost-sid-cookie }
}
}
```
使用 MCP Inspector:
```bashREE_WS_SESSION=… npx -y @modelcontextprotocol/inspector npx @three/alerts-mcp
```
## 身份验证
每个工具都是的。设置 **`TH_SESSION`** 为从登录的 [three.ws](https://three.ws) 浏览器会话中获取的 `__Host-sid 值(开发者工具 → 应用程序 → `__Host-sid`它的方式与浏览器相同;对于写入操作,它首先从 `/api/cs` 获取一次性 CSRF token 并回显它,与网站完全像密码一样保护会话值。不涉及 Solana 密钥者。
## 工具
| 工具 | 类型 |
| ------------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------| `list_alert_rules | 只读 |您的警报规则及其实时交付健康状况 — `last_f`、最近的失败、最近的每个通道的结果。 |
| `create_alert_rule` | 写入(追加) 定义一个新的 pump.fun 事件规则。不可幂等 — 都添加一个规则(最多 50 个)。 |
update_alert_rule` | 写入(幂等) 整阈值、暂停/恢复 (`enabled)、交换交付通道或更改 `kind`传递的字段会更改。 |
| `delete_alert_rule` | 写入(破坏性 | 永久删除规则及其触发/交付历史。优先update_alert_rule` 和 `enabled:false` 暂停。 |
| `get_alert_history` | 只读 | 读取实际触发的警报,按最新顺序 — 每个警报都有摘要、源 `rule_id` 和完整有效载荷。 |
### 规则类型和目标
| `kind` | 目标 | `threshold` |
| -------------- | ------------------------------- | ------------------------- |
| `graduation` | 全局,或 `target_mint` / `target_agent` || `price_ab | `target_mint`(必填) |
| `price_below` | `int`(必填) | 美元市值 |
| `whale_buy` | `target_mint`(必填) | SOL 最小购买金额 |
| `new_mint` | `target_agent`(必填) | — |
至少一个交付通道必须开启:`deliver_in_app`(默认 true)、`webhook_url`(HTTPS — 为验证 `webhook-signature` 头部生成每个规则的 `webhook_secret`)和/或 `telegram_chat`(数字聊天 ID 或 `@username`)。`cooldown_seconds`(5–86400,默认 300)限制重复触发。
> 规则中引用的任何币都是**您提供的运行时输入**。three.ws 仅推广 **$THREE** (`FeMbDoX7R1Psc4GEcvJdsbNbbfztcyDCatJVJpump`)。
## 示例
```jsonc
// create_alert_rule — 当跟踪代理的币毕业时,通过 webhook + Telegram 警报
> {
"kind": "graduation",
"target_agent": "8a1c…-uuid",
"webhook_url": "https://hooks.example.com/pump",
"telegram_chat": "123456789",
"cooldown_seconds": 600
}
{
"ok": true,
"rule": {
"id": "…", "kind": "graduation", "label_display": "Graduations · 跟踪代理",
"target_agent": "8a1c…-uuid", "deliver_in_app": true,
"webhook_url": "https://hooks.example.com/pump",
"webhook_secret": "whsec_…", "telegram_chat": "123456789",
"cooldown_seconds": 600, "enabled": true,
"last_fired_at": null, "recent_failures": 0, "recent_deliveries": []
}
}
```
```jsonc
// get_alert_history — 最新触发的警报
> { "limit": 2 }
{
"ok": true, "count": 2, "unread_count": 1,
"alerts": [
{ "id": 1841, "fired_at": "2026-06-24T…Z", "read": false,
"summary": "鲸鱼购买了 12.50 SOL ($2,310) 的 $THREE",
"rule_id": "…", "kind": "whale_buy", "mint": "FeMb…pump", "symbol": "THREE",
"event": { "amount_sol": 12.5, "amount_usd": 2310, "buyer": "…", "tx": "…" } }
]
}
```
## 要求
- **Node.js >= 20.**
- 已登录的 three.ws 会话(`THREE_WS_SESSION`)。
- 可以访问 `https://three.ws`(或您自己的 `THREE_WS_BASE`)。
### 环境变量
| 变量 | 必需 | 默认值 | 说明 |
| --------------------- | -------- | ------------------ | ------------------------------------------------------------ |
| `THREE_WS_SESSION` | **是** | — | 您的 `__Host-sid` cookie 值。账户凭证 — 机密。 |
| `THREE_WS_BASE` | 否 | `https://three.ws` | 仅在自托管/预览部署时覆盖。 |
| `THREE_WS_TIMEOUT_MS` | 否 | `20000` | 每个请求的超时时间(毫秒)。 |
## 链接
- 首页:https://three.ws
- 更新日志:https://three.ws/changelog
- 问题:https://github.com/nirholas/three.ws/issues
- 许可证:Apache-2.0 — 见 [LICENSE](./LICENSE)
---
<p align="center">
<sub>
three.ws SDK 套件的一部分 — 3D AI 代理、链上身份和代理支付。<br/>
<a href="https://three.ws">网站</a> · <a href="https://three.ws/changelog">更新日志</a> · <a href="https://github.com/nirholas/three.ws">GitHub</a>
</sub>
</p>
## 许可证
Copyright © 2026 nirholas. All rights reserved.
本软件为专有软件 — 见 [LICENSE](./LICENSE)。未经版权所有者明确书面许可,不得授予任何权利。