Back to MCP directory
publicPublicdnsLocal runtime

mcp-server

FastAlert的官方MCP服务器,允许AI助手通过API列出通知频道并发送富文本通知消息。

article

README

🚀 FastAlert MCP 服务器

FastAlert MCP 服务器是 FastAlert 的官方模型上下文协议(MCP)服务器。该服务器允许 AI 代理(如 Claude、ChatGPT 和 Cursor)列出你的频道列表,并通过 FastAlert API 直接发送通知。

✨ 主要特性

  • 频道发现:列出你所有的频道,并可选择按名称进行过滤。
  • 发送通知:向一个或多个频道发送丰富的消息(包括标题、内容、操作、图像)。

🚀 快速开始

{
  "mcpServers": {
    "fastalert": {
      "command": "npx",
      "args": ["-y", "fastalert-mcp-server"],
      "env": {
        "API_KEY": "your-api-key-here"
      }
    }
  }
}

你可以访问 FastAlert 并导航到 设置 来找到你的 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(字符串,必需):目标频道的唯一标识符。
  • title(字符串,必需):警报通知的标题。
  • content(字符串,必需):通知的正文文本。
  • action(字符串,可选):操作类型('call'、'email'、'website'、'image')。
  • 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.

📚 详细文档

与大语言模型(LLMs)的集成

在 Cursor 中配置

  1. 转到 设置 -> MCP
  2. 点击 添加新的 MCP 服务器
  3. 名称:FastAlert
  4. 类型:command
  5. 命令:npx -y fastalert-mcp-server
  6. 环境变量:添加 API_KEY

在 ChatGPT 中配置

  1. 转到 设置 -> 集成
  2. 点击 添加 MCP 服务器
  3. 使用你的服务器的托管 URL(例如,https://mcp.fastalert.now/mcp)。
  4. 按照 OAuth 提示操作。

在 Claude 中配置

  1. 打开 claude_desktop_config.json
  2. 添加以下条目:
{
  "mcpServers": {
    "fastalert": {
      "command": "npx",
      "args": ["-y", "fastalert-mcp-server"],
      "env": {
        "API_KEY": "your-api-key-here"
      }
    }
  }
}

📦 安装指南

要求

  • Node:建议使用 18 或更高版本。
  • API_KEY:需要有效的 FastAlert API 密钥进行身份验证。

本地安装

  1. 克隆仓库
  2. 复制示例环境文件:
    cp .env.example .env
    
  3. .env 中配置环境变量。
  4. 安装依赖:
    npm install
    
  5. 构建项目:
    npm run build
    
  6. 运行检查器测试:
    npm run inspector
    
  7. 本地运行:
    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 许可证。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client