NN

n9e/n9e-mcp-server

分析与监控官方

本页由 AI 翻译,技术细节请以原文为准。 查看原文

43 stars 13 forks 质量 66 趋势 20

n9e/n9e-mcp-server 是从 https://github.com/n9e/n9e-mcp-server. 导入的 MCP 服务器候选

概览

n9e/n9e-mcp-server 是从 https://github.com/n9e/n9e-mcp-server. 导入的 MCP 服务器候选

概述(AI 翻译)

英文 |中文

一款用于Nightingale监控系统的MCP(模型上下文协议)服务器。该服务器使AI助手能够通过自然语言与Nightingale API交互,进行警报管理、监控和可观察性任务。

兼容性

  • 夜莺:v8.0.0+

关键用例

  • 警报管理:查询活跃和历史警报,查看警报规则和订阅
  • 目标监控:浏览和搜索被监控的主机/目标,分析目标状态
  • 事件响应:创建和管理警报静音、通知规则和事件管道
  • 团队协作:查询用户、团队和业务组

快速启动

1.获取API令牌

  1. 确保 HTTP.TokenAuth 在 config.toml 中启用:

  2. 登录你的Nightingale网页界面

  3. 导航至个人设置 > 个人资料 > 令牌管理

  4. 创建一个带有适当权限的新令牌

安全提示:安全存储你的 API 令牌。切勿将令牌提交给版本控制。使用环境变量或安全管理秘密。

2.配置MCP客户端

光标(标准模式,默认)

添加你的~/.cursor/mcp.json:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Nightingale MCP Server

English | 中文

An MCP (Model Context Protocol) server for Nightingale monitoring system. This server enables AI assistants to interact with Nightingale APIs for alert management, monitoring, and observability tasks through natural language.

Compatibility

  • Nightingale: v8.0.0+

Key Use Cases

  • Alert Management: Query active and historical alerts, view alert rules and subscriptions
  • Target Monitoring: Browse and search monitored hosts/targets, analyze target status
  • Incident Response: Create and manage alert mutes, notification rules, and event pipelines
  • Team Collaboration: Query users, teams, and business groups

Quick Start

1. Get an API Token

  1. Make sure HTTP.TokenAuth is enabled in config.toml:
  [HTTP.TokenAuth]
  Enable = true
  1. Log in to your Nightingale web interface
  2. Navigate to Personal Settings > Profile > Token Management
  3. Create a new token with appropriate permissions

Security Note: Store your API token securely. Never commit tokens to version control. Use environment variables or secure secret management.

2. Configure MCP Client

Cursor (stdio mode, default)

Add to your ~/.cursor/mcp.json:

{
  "mcpServers": {
    "nightingale": {
      "command": "npx",
      "args": ["-y", "@n9e/n9e-mcp-server", "stdio"],
      "env": {
        "N9E_TOKEN": "your-api-token",
        "N9E_BASE_URL": "http://your-n9e-server:17000"
      }
    }
  }
}

HTTP mode (optional)

To run the server over HTTP (MCP streamable transport, JSON only, no SSE), start the server with the http subcommand.

Shared vs non-shared (HTTP only):

  • --shared=false (default): Token and base URL may be omitted at startup. Each client can provide X-User-Token and X-N9e-Base-Url in mcp.json so everyone uses their own Nightingale identity or instance. If you do set N9E_TOKEN and N9E_BASE_URL at startup, they act as defaults and clients can still override via headers.
  • --shared=true: Startup must set N9E_TOKEN and N9E_BASE_URL. The server uses only this config; client headers X-User-Token and X-N9e-Base-Url are ignored. Use this when the MCP server is a shared org service and users must not override credentials.
# Non-shared: users supply token/URL in mcp.json (or you set defaults at startup)
n9e-mcp-server http --listen :8080

# Shared: one token/URL for all; require at startup, ignore client headers
N9E_TOKEN=xxx N9E_BASE_URL=https://n9e.example.com n9e-mcp-server http --listen :8080 --shared
在 GitHub 查看完整 README

安装

npx -y @n9e/n9e-mcp-server stdio
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "nightingale": { "command": "npx", "args": ["-y", "@n9e/n9e-mcp-server", "stdio"], "env": { "N9E_TOKEN": "your-api-token", "N9E_BASE_URL": "http://your-n9e-server:17000" } } } }