项目简介

InsightFinder MCP 服务器是一个基于 Model Context Protocol (MCP) 的应用程序后端,它允许大型语言模型(LLM)客户端通过标准化的方式访问 InsightFinder 平台的完整功能集。

主要功能

  • 事件管理:获取和查询系统事件、事故时间线数据
  • 异常检测:分析日志异常、指标异常和预测性事故
  • 系统监控:查询部署事件、跟踪数据和系统框架信息
  • 数据分析:获取指标时间序列数据和元数据
  • JIRA 集成:创建和管理 JIRA 工单
  • 资源访问:提供对系统资源和项目数据的访问能力
  • 工具调用:注册和执行各种 InsightFinder 平台功能
  • 多传输协议:支持 stdio、HTTP、HTTPS 和 SSE 流式传输

安装步骤

环境要求

  • Python 3.8 或更高版本
  • pip 包管理器
  • (可选)Docker 用于容器化部署
  • (可选)nginx 用于 HTTPS 部署

1. 克隆仓库

git clone https://github.com/insightfinder/insightfinder-mcp-server
cd insightfinder-mcp-server

2. 创建虚拟环境

python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

3. 安装依赖

pip install -e .

服务器配置

MCP 客户端需要配置以下信息来连接 InsightFinder MCP 服务器:

{
  "insightfinder": {
    "command": "python",
    "args": ["-m", "insightfinder_mcp_server.main"]

4. 运行服务器

**选项 1: stdio 传输(推荐用于 MCP 客户端)

python -m insightfinder_mcp_server.main

选项 2: HTTP 传输

export TRANSPORT_TYPE=http
export SERVER_HOST=0.0.0.0
export SERVER_PORT=8000
export HTTP_AUTH_ENABLED=true
export HTTP_API_KEY=your-secure-api-key
python -m insightfinder_mcp_server.main

基本使用方法

InsightFinder 凭证配置

所有 InsightFinder 操作都需要通过 HTTP 头部提供凭证:

  • 'X-IF-License-Key':您的 InsightFinder 许可证密钥
  • 'X-IF-User-Name':您的 InsightFinder 用户名

HTTP 请求示例

# 健康检查
curl -H "X-API-Key: your-api-key" http://localhost:8000/health

MCP 工具调用示例

curl -X POST \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -H "X-IF-License-Key: your-license-key" \
  -H "X-IF-User-Name: your-username" \
  -d '{"timeRange":"1d","status":"open"}' \
  http://localhost:8000/tools/list_incidents

服务器启动后,MCP 客户端可以通过配置的连接方式访问 InsightFinder 平台的所有监控和管理功能。

信息

分类

开发者工具