Skip to main content

A Model Context Protocol server for SAST vulnerability analysis and fixing

Project description

SAST 漏洞修复 MCP 服务

本项目提供一个专用于处理静态应用安全测试(SAST)报告的 MCP 服务器,具备SAST报告的Docx文档解析、漏洞修复状态跟踪及修复报告导出等核心功能。本MCP server支持湛卢AI程序员中漏洞修复进行SAST相关漏洞的下修复,参见静态应用安全测试(SAST)修复流程

功能概述

  • Docx转JSON:将SAST报告的Word文档解析转换为结构化JSON格式
  • 漏洞状态管理:自动检测待处理的漏洞JSON文件,支持状态查询与更新
  • 报告导出:基于已修复漏洞数据生成标准CSV格式的修复报告

可用工具

  • convert_sast_docx_to_json - 将SAST报告的docx文档转换为JSON格式

    • file_path (string, 必填): SAST报告docx文件路径
  • get_pending_vulnerability_json_files - 获取.scanissuefix目录中所有待处理的漏洞JSON文件(_new.json)

  • generate_csv_report - 从所有已完成的漏洞JSON文件(_finished.json)生成CSV报告

安装

使用 uv (推荐)

使用 uv 时无需特殊安装。可以直接使用 uvx 运行 sast-fixer-mcp

使用 PIP

或者可以通过 pip 安装 sast-fixer-mcp

pip install sast-fixer-mcp

安装完成后,可以作为脚本运行:

python -m sast_fixer_mcp

配置

使用 Claude Desktop

将以下配置添加到您的 claude_desktop_config.json 中:

使用 uvx
{
  "mcpServers": {
    "sast-fixer": {
      "command": "uvx",
      "args": ["sast-fixer-mcp"]
    }
  }
}
使用 pip 安装
{
  "mcpServers": {
    "sast-fixer": {
      "command": "python",
      "args": ["-m", "sast_fixer_mcp"]
    }
  }
}

湛卢AI程序员集成配置

在湛卢AI程序员MCP服务管理中添加如下配置:

使用 uvx
{
  "mcpServers": {
    "SAST_FIXER_MCP": {
      "command": "uvx",
      "args": ["sast-fixer-mcp"],
      "enabled": true,
      "alwaysAllow": [
        "convert_sast_docx_to_json",
        "get_pending_vulnerability_json_files",
        "generate_csv_report"
      ],
      "timeout": 1800
    }
  }
}
使用 pip 安装
{
  "mcpServers": {
    "SAST_FIXER_MCP": {
      "command": "python",
      "args": ["-m", "sast_fixer_mcp"],
      "enabled": true,
      "alwaysAllow": [
        "convert_sast_docx_to_json",
        "get_pending_vulnerability_json_files",
        "generate_csv_report"
      ],
      "timeout": 1800
    }
  }
}

备注

  • 如使用特定Python环境,建议使用which python命令获取完整路径,如果使用venv或conda环境,请指定python运行文件的绝对路径。
  • 处理较大SAST报告时,请适当调高timeout以避免超时。

全局设置

进入右上角设置,调整以下选项以获得最佳体验:

  • 模型选择:deepseek-v3(当前仅支持该模型进行漏洞修复)

  • 自动批准权限:启用读取、写入、重试、MCP及命令执行权限

  • 执行命令白名单:建议添加以下命令,避免频繁询问权限

    rm -rf .scanissuefix
    mv .scanissuefix
    mkdir -p .scanissuefix
    ren .scanissuefix
    del .scanissuefix
    del ".scanissuefix"
    dir .scanissuefix
    ren ".scanissuefix"
    move .scanissuefix
    

使用流程

  1. 获取目标代码库对应的SAST报告Word文档。
  2. 将代码库克隆到VSCode中并切换至对应分支。
  3. 打开湛卢AI程序员对话框,选择“代码安全漏洞修复”功能。
  4. 将SAST报告的文件路径(相对或绝对)粘贴至对话框,提交后按提示完成漏洞修复。

注意:修复过程中涉及系统命令操作文件目录,请确保VSCode的终端当前路径定位于项目根目录。当出现修复流程不符合预期的情况可尝试使用自然语言和AI程序员对话,如: 继续修复生成csv报告自动修复等。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sast_fixer_mcp-1.0.2.tar.gz (478.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sast_fixer_mcp-1.0.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file sast_fixer_mcp-1.0.2.tar.gz.

File metadata

  • Download URL: sast_fixer_mcp-1.0.2.tar.gz
  • Upload date:
  • Size: 478.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sast_fixer_mcp-1.0.2.tar.gz
Algorithm Hash digest
SHA256 35eac01c8ae02ab1b9006d538e437bccab729e4cf9ebca852c2f8b91755b119a
MD5 db528e85b97adf96161034655400918a
BLAKE2b-256 b985fa3dd727168d21d52ada7d9fb434b303a957ebc8fe7a9e11da373298579c

See more details on using hashes here.

File details

Details for the file sast_fixer_mcp-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: sast_fixer_mcp-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sast_fixer_mcp-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d401e5260a3df96380eaaf77cf7fb9b6f3f9b8626fc33d51c08fc994c2e23765
MD5 0625b04b4605cb1c94ef48f9736485ef
BLAKE2b-256 e33e24cdd15637689a55809a8d689757d316ecf2463957cbf29a62143b8b2aa9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page