MCP Sumo Logic Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Provides containerization support for easy deployment of the MCP server in Docker environments with configuration through environment variables.

  • Enables searching and querying of Sumo Logic logs using custom queries with configurable time ranges, allowing access to log data stored in Sumo Logic's platform.

MCP 相扑逻辑

与 Sumo Logic 的 API 集成以执行日志搜索的模型上下文协议 (MCP) 服务器。

特征

  • 使用自定义查询搜索 Sumo Logic 日志
  • 可配置的搜索时间范围
  • 错误处理和详细日志记录
  • Docker 支持,轻松部署

环境变量

ENDPOINT=https://api.au.sumologic.com/api/v1 # Sumo Logic API endpoint SUMO_API_ID=your_api_id # Sumo Logic API ID SUMO_API_KEY=your_api_key # Sumo Logic API Key

设置

  1. 克隆存储库
  2. 安装依赖项:
    npm install
  3. 创建包含所需环境变量的.env文件
  4. 构建项目:
    npm run build
  5. 启动服务器:
    npm start

Docker 设置

  1. 构建 Docker 镜像:
    docker build -t mcp/sumologic .
  2. 运行容器(选择一种方法):a.直接使用环境变量:
    docker run -e ENDPOINT=your_endpoint -e SUMO_API_ID=your_api_id -e SUMO_API_KEY=your_api_key mcp/sumologic
    b.使用 .env 文件:
    docker run --env-file .env mcp/sumologic
    注意:确保您的 .env 文件包含所需的环境变量:
    ENDPOINT=your_endpoint SUMO_API_ID=your_api_id SUMO_API_KEY=your_api_key

用法

服务器公开了一个search-sumologic工具,该工具接受以下参数:

  • query (必需):Sumo Logic 搜索查询
  • from (可选):ISO 8601 格式的开始时间
  • to (可选):ISO 8601 格式的结束时间

示例查询:

const query = '_index=app_pro_fiat_cont | json auto | fields log_identifier'; const results = await search(sumoClient, query, { from: '2024-02-23T00:00:00Z', to: '2024-02-24T00:00:00Z', });

错误处理

该服务器包括全面的错误处理和日志记录:

  • 捕获 API 错误并记录详细信息
  • 监控并记录搜索作业状态
  • 网络和身份验证问题得到妥善处理

发展

要在开发模式下运行:

npm run dev

用于测试:

npm test
-
security - not tested
F
license - not found
-
quality - not tested

与 Sumo Logic 的 API 集成,以实现具有可配置查询和时间范围的日志搜索,支持错误处理和通过 Docker 轻松部署。

  1. Features
    1. Environment Variables
      1. Setup
        1. Docker Setup
          1. Usage
            1. Error Handling
              1. Development
                ID: 6vnt6vueaf