Semgrep MCP Server

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Enables cloning repositories for code analysis and scanning with Semgrep.

  • Supports working with Semgrep rules defined in YAML format, allowing for rule creation and management.

Semgrep 服务器

用于将 Semgrep 集成到开发环境中的模型上下文协议 (MCP) 服务器。该服务器允许直接通过 MCP 协议执行静态代码分析和管理 Semgrep 规则。

安装

# Repository klonen git clone [repository-url] cd semgrep-server # Abhängigkeiten installieren npm install # Server bauen npm run build

使用

可以通过以下方式启动服务器:

# Produktionsmodus npm start # Entwicklungsmodus npm run dev

可用工具

该服务器提供以下 MCP 工具:

  • scan_directory :在目录中运行 Semgrep 扫描
  • list_rules :列出可用的 Semgrep 规则
  • analyze_results :分析扫描结果
  • create_rule :创建一个新的 Semgrep 规则
  • filter_results :根据各种标准过滤扫描结果
  • export_results :以各种格式导出扫描结果
  • compare_results :比较两个扫描结果

发展

该项目使用 TypeScript 编写,并使用 MCP SDK 进行服务器实现。

项目结构

semgrep-server/ ├── src/ # Quellcode ├── build/ # Kompilierte JavaScript-Dateien ├── test.js # Testdateien └── test-rule.yaml # Beispiel Semgrep-Regel

依赖项

  • Node.js 和 npm
  • TypeScript
  • MCP SDK
  • 用于 HTTP 请求的 Axios

执照

该项目已获得 ISC 许可。更多详细信息请参阅LICENSE文件。

-
security - not tested
A
license - permissive license
-
quality - not tested

通过 MCP 协议实现 Semgrep 在开发环境中的集成,支持静态代码分析、规则管理和扫描结果操作。

  1. Installation
    1. Verwendung
      1. Verfügbare Tools
        1. Entwicklung
          1. Projektstruktur
          2. Abhängigkeiten
        2. Lizenz
          ID: 1kb2h7qn0c