Skip to main content

SAST vulnerability fixing service for MCP

Project description

sast-fixer-mcp: SAST Fixer MCP Server

A Model Context Protocol (MCP) server that provides dedicated handling of Static Application Security Testing (SAST) reports. It includes capabilities for parsing DOCX reports, tracking vulnerability remediation statuses, and exporting comprehensive fix reports. Seamless integration with Zhanlu AI Programmer enables automated remediation for vulnerabilities identified in SAST processes.

Features

  • DOCX Report Processing: Convert SAST reports from DOCX format to structured JSON
  • Vulnerability Tracking: Track remediation status of security vulnerabilities
  • Report Generation: Generate comprehensive CSV reports of fixed vulnerabilities
  • MCP Integration: Full integration with Model Context Protocol servers
  • Automated Workflow: Streamlined vulnerability fixing process with AI assistance

Available Tools

  • convert_sast_docx_to_json - Converts SAST reports from DOCX format to JSON

    • file_path (string, required): Path to the SAST report DOCX file
  • get_pending_vulnerability_json_files - Retrieves all pending vulnerability JSON files (_new.json) from the .scanissuefix directory

  • generate_csv_report - Generates a CSV report from all resolved vulnerability JSON files (_finished.json)

Prerequisites

  • Python 3.10 or higher is required. Verify your Python version:
python --version  # or python3 --version
  • Check if you have the appropriate Python environment installed:
which python  # or which python3

Install Python

If you do not have Python installed or your version is not match the prerequisites, it's recommended to install the most stable version of Python 3.12 using the following direct download links:

Upgrade Python

If your current Python version does not meet the required standard, download and install the recommended Python 3.12 version using the above links. Ensure your system's PATH points to the new Python installation.

Installation

Using uv (Recommended)

First, install uv if you haven't already:

pip install uv

When using uv no specific installation is needed. We will use uvx to directly run sast-fixer-mcp.

Run the SAST Fixer MCP server directly:

uvx sast-fixer-mcp

Using pip

Alternatively you can install sast-fixer-mcp via pip:

pip install sast-fixer-mcp

After installation, you can run it as a script using:

python -m sast_fixer_mcp

Configuration

Usage with VS Code Extension zhanlu AI Programmer

For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code.

Using uvx
{
  "mcpServers": {
    "sast-fixer-mcp": {
      "command": "uvx",
      "args": ["sast-fixer-mcp"]
    }
  }
}
Using pip installation
{
  "mcpServers": {
    "sast-fixer-mcp": {
      "command": "python",
      "args": ["-m", "sast_fixer_mcp"]
    }
  }
}

Configuration Notes:

  • For specific Python environments, use which python to get the full path. For venv or conda environments, specify the absolute path to the python executable.
  • For large SAST reports, increase the timeout setting to avoid timeouts.

Usage Workflow

  1. Obtain SAST Report: Get the SAST report Word document for your target codebase
  2. Setup Repository: Clone the codebase and switch to the appropriate branch
  3. Start Analysis: Use AI assistant with SAST Fixer MCP integration for security vulnerability analysis
  4. Process Report: Convert DOCX report to JSON format using the convert_sast_docx_to_json tool
  5. Track Progress: Monitor vulnerability remediation using pending and completed file tracking
  6. Generate Reports: Create comprehensive CSV reports of fixed vulnerabilities

Important Notes:

  • Ensure your working directory is positioned at the project root during the fixing process
  • For continued analysis, use natural language commands like: "continue fixing", "generate csv report", "analyze vulnerabilities", etc.
  • The tool creates a .scanissuefix directory to track vulnerability status

Debugging

You can use the MCP inspector to debug the server. For uvx installations:

npx @modelcontextprotocol/inspector uvx sast-fixer-mcp

Or if you've installed the package in a specific directory or are developing on it:

cd path/to/servers/src/sast_fixer_mcp
npx @modelcontextprotocol/inspector uv run sast-fixer-mcp

Development

If you are doing local development, there are two ways to test your changes:

  1. Run the MCP inspector to test your changes. See Debugging for run instructions.

Local Development Setup

For local development:

cd src/sast_fixer_mcp
uv sync
uv run python -m sast_fixer_mcp --verbose --working-directory /path/to/test/project

Run tests:

uv run pytest

Run linting and type checking:

uv run ruff check
uv run pyright

Build

cd .\mcp-servers\servers\sast_fixer_mcp\
uv build
twine upload .\dist\*


License

MIT License - see LICENSE file for details.

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.7.tar.gz (4.9 MB 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.7-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sast_fixer_mcp-1.0.7.tar.gz
  • Upload date:
  • Size: 4.9 MB
  • 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.7.tar.gz
Algorithm Hash digest
SHA256 fb69e853615b0a9c6412aa7e2d2166d0f99f1021c17c3ff17cb97db59262826c
MD5 b96b7c089cf05e7377c1e10eb4bf040d
BLAKE2b-256 63c834727f8c411ac0e2ab821b5e8916ef8d6f5b12cc04b78db4c196bb9adb12

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sast_fixer_mcp-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 8.9 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 597152ca6d642c37a03522f77ce45d0b55b8a1db2b1525cf98165ed61921de5c
MD5 b6c74ec3c8eb5d3ea25561e7fe09535d
BLAKE2b-256 0c24f92624c1f8a17afea15487fb6c6abbcc8a0f9cd59be467edbc92393b1a6f

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