semgrep/mcp
If you are the rightful owner of mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Semgrep MCP Server is a Model Context Protocol server that uses Semgrep to scan code for security vulnerabilities.
Tools
Functions exposed to the LLM to take actions
semgrep_rule_schema
Get the schema for a Semgrep rule
Use this tool when you need to:
- get the schema required to write a Semgrep rule
- need to see what fields are available for a Semgrep rule
- verify what fields are available for a Semgrep rule
- verify the syntax for a Semgrep rule is correct
get_supported_languages
Returns a list of supported languages by Semgrep
Only use this tool if you are not sure what languages Semgrep supports.
semgrep_findings
Fetches findings from the Semgrep AppSec Platform Findings API.
This function retrieves security, code quality, and supply chain findings that have already been identified by previous Semgrep scans and uploaded to the Semgrep AppSec platform. It does NOT perform a new scan or analyze code directly. Instead, it queries the Semgrep API to access historical scan results for a given repository or set of repositories.
Use this function when a prompt requests a summary, list, or analysis of existing findings, such as: - "Please list the top 10 security findings and propose solutions for them." - "Show all open critical vulnerabilities in this repository." - "Summarize the most recent Semgrep scan results."
This function is ideal for:
- Reviewing, listing, or summarizing findings from past scans.
- Providing actionable insights or remediation advice based on existing scan data.
Do NOT use this function to perform a new scan or check code that has not yet been analyzed by Semgrep. For new scans, use the appropriate scanning function.
Args: issue_type (Optional[List[str]]): Filter findings by type (e.g., ['sast'], ['sca']). status (Optional[str]): Filter findings by status (e.g., 'open' for unresolved findings). repos (Optional[List[str]]): List of repository names to filter results. severities (Optional[List[str]]): Filter findings by severity (e.g., ['critical', 'high']). confidence (Optional[List[str]]): Filter findings by confidence level (e.g., ['high']). autotriage_verdict (Optional[str]): Filter findings by auto-triage verdict (e.g., 'true_positive'). page (Optional[int]): Page number for paginated results. page_size (int): Number of findings per page (default: 100, max: 3000).
Returns: List[Finding]: A list of findings matching the specified filters, where each finding contains details such as rule ID, description, severity, file location, and remediation guidance if available.
semgrep_scan_with_custom_rule
Runs a Semgrep scan with a custom rule on provided code content and returns the findings in JSON format
Use this tool when you need to:
- scan code files for specific security vulnerability not covered by the default Semgrep rules
- scan code files for specific issue not covered by the default Semgrep rules
semgrep_scan
Runs a Semgrep scan on provided code content and returns the findings in JSON format
Use this tool when you need to:
- scan code files for security vulnerabilities
- scan code files for other issues
security_check
Runs a fast security check on code and returns any issues found.
Use this tool when you need to:
- scan code for security vulnerabilities
- verify that code is secure
- double check that code is secure before committing
- get a second opinion on code security
If there are any issues found, you MUST fix them or offer to fix them and explain to the user why it's important to fix. If there are no issues, you can be reasonably confident that the code is secure.
get_abstract_syntax_tree
Returns the Abstract Syntax Tree (AST) for the provided code file in JSON format
Use this tool when you need to:
- get the Abstract Syntax Tree (AST) for the provided code file - get the AST of a file
- understand the structure of the code in a more granular way
- see what a parser sees in the code
Prompts
Interactive templates invoked by user choice
write_custom_semgrep_rule
Write a custom Semgrep rule for the provided code and language
Use this prompt when you need to:
- write a custom Semgrep rule
- write a Semgrep rule for a specific issue or pattern
Resources
Contextual data attached and managed by the client
get_semgrep_rule_schema
URI: semgrep://rule/schema
MIME: text/plain
Specification of the Semgrep rule YAML syntax using JSON schema.