使用说明
快速警报MCP服务器
官方模型上下文协议(MCP)服务器 快速警报。此服务器允许AI代理(如Claude、ChatGPT和Cursor)列出您的频道,并通过FastAlert API直接发送通知。
特性
- 信道发现:使用可选的名称过滤列出所有频道。
- 发送通知:向一个或多个频道发送丰富的消息(标题、内容、动作、图像)。
快速开始
{
"mcpServers": {
"fastalert": {
"command": "npx",
"args": ["-y", "fastalert-mcp-server"],
"env": {
"API_KEY": "your-api-key-here"
}
}
}
}
您可以通过访问找到您的API密钥 快速警报 并导航到 设置.
可用工具
以下工具可通过此MCP服务器使用。AI助手可以调用每个工具来执行特定的操作。
1. list_channels
返回可用FastAlert频道的列表。
输入参数:
name(字符串,可选):按名称过滤频道的搜索词。
呼叫示例:
{
"name": "Service Alerts"
}
结构化JSON输出(默认):
{
"status": true,
"message": "You have fetch channels successfully",
"data": {
"channels": [
{
"uuid": "sdf12sdf-6541-5d56-s5sd-1fa513e88a81",
"name": "Service Alerts",
"subscriber": 1000
}
]
}
}
人类可读文本输出:
Here are your FastAlert channels:
Service Alerts
UUID: sdf12sdf-6541-5d56-s5sd-1fa513e88a81
Subscribers: 1000
2. send_message
向一个或多个通道发送通知消息。
输入参数:
channel-uuid(string,必填):目标通道的唯一标识符。title(string,必填):警报通知的标题。content(string,必填):通知的正文。action(字符串,可选):操作类型(“呼叫”、“电子邮件”、“网站”、“图像”)。action_value(字符串,可选):操作的值(例如,URL或电话号码)。image(字符串,可选):要包含的图像的URL或标识符。
呼叫示例:
{
"channel-uuid": "sdf12sdf-6541-5d56-s5sd-1fa513e88a81",
"title": "System Update",
"content": "A new version of the system is now live.",
"action": "website",
"action_value": "https://fastalert.now/updates"
}
结构化JSON输出(默认):
{
"status": true,
"message": "Message has been sent successfully"
}
人类可读文本输出:
Message Sent Successfully!
Your message "System Update" has been sent to Service Alerts.
Channel UUID: sdf12sdf-6541-5d56-s5sd-1fa513e88a81
Title: System Update
Content: A new version of the system is now live.
与LLM集成
光标中的配置
- 首选 设置 -> 主控程序.
- 点击 添加新的MCP服务器.
- 姓名:
FastAlert - 类型:
command - 命令:
npx -y fastalert-mcp-server - 环境:添加
API_KEY.
ChatGPT中的配置
- 首选 设置 -> 集成.
- 点击 添加MCP服务器.
- 使用服务器的托管URL(例如。,
https://mcp.fastalert.now/mcp). - 按照OAuth提示进行操作。
Claude中的配置
- 打开
claude_desktop_config.json. - 添加以下条目:
{
"mcpServers": {
"fastalert": {
"command": "npx",
"args": ["-y", "fastalert-mcp-server"],
"env": {
"API_KEY": "your-api-key-here"
}
}
}
}
设置和开发
需求
- 节点:建议使用18或更高版本。
- API_密钥:身份验证需要有效的FastAlert API密钥。
本地安装
- 克隆存储库
- 复制示例环境文件:
cp .env.example .env - 在中配置环境变量
.env. - 安装依赖项:
npm install - 构建项目:
npm run build - 运行检查员测试:
npm run inspector - 在本地运行:
npm start
配置(环境变量)
应在您的 .env 文件:
| 变量 | 描述 | 示例 |
|---|---|---|
API_URL |
FastAlert API端点 | https://api.fastalert.now/api |
FRONT_URL |
您的前端应用程序URL | https://fastalert.now |
BASE_URL |
承载此MCP服务器的公共URL | http://localhost:3000 |
API_KEY |
您的FastAlert API密钥 | your-api-key-here |
PORT |
(可选)运行服务器的端口 | 3000 |
贡献
欢迎投稿!请随时提交拉取请求。
许可证
该项目根据MIT许可证获得许可。