Semgrep MCP Server

Official

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
start_scan_from_content

Starts a Semgrep scan with code content provided directly

Args: ctx: MCP context for sending notifications code_files: List of dictionaries with 'filename' and 'content' keys config: Semgrep configuration (e.g. "auto" or absolute path to rule file)

Returns: Dictionary with scan information

get_scan_status

Gets the current status of a scan

Args: scan_id: Identifier for the scan

Returns: Dictionary with scan status information

get_scan_results

Gets the results of a completed scan

Args: scan_id: Identifier for the scan

Returns: Dictionary with scan results

get_supported_languages

Returns a list of supported languages by Semgrep

Returns: List of supported languages

semgrep_scan

Runs a Semgrep scan on provided code content and returns the findings in JSON format

Args: code_files: List of dictionaries with 'filename' and 'content' keys config: Semgrep configuration (e.g. "auto" or absolute path to rule file)

Returns: Dictionary with scan results in Semgrep JSON format

start_scan

Starts a Semgrep scan with progress updates via notifications

Args: ctx: MCP context for sending notifications target_path: Absolute path to the file or directory to scan config: Semgrep configuration (e.g. "auto" or absolute path to rule file)

Returns: Dictionary with scan information