Semgrep MCP Server

MCP Server for Semgrep Integration - static code analysis with AI

Remote serverstreamable-httpPython

What is the Semgrep MCP Server?

MCP Server for Semgrep Integration - static code analysis with AI

What you get

MCP Server Semgrep is a Model Context Protocol compliant server that integrates the powerful Semgrep static analysis tool with AI assistants like Anthropic Claude. It enables advanced code analysis, security vulnerability detection, and code quality improvements directly through a conversational interface.

  • Direct integration with the official MCP SDK
  • Simplified architecture with consolidated handlers
  • Clean ES Modules implementation
  • Efficient error handling and path validation for security
  • Interface and documentation in both English and Polish
  • Comprehensive unit tests

Configuration and credentials

  • Node.js v18+ - TypeScript (for development)

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
scan_directoryScanning source code for potential issues
list_rulesDisplaying available rules and languages supported by Semgrep
analyze_resultsDetailed analysis of scan results
create_ruleCreating custom Semgrep rules
filter_resultsFiltering results by various criteria
export_resultsExporting results in various formats
compare_resultsComparing two sets of results (e.g., before and after changes)

How to install the Semgrep MCP Server

{
  "mcpServers": {
    "semgrep": {
      "command": "node",
      "args": [
        "/your_path/mcp-server-semgrep/build/index.js"
      ],
      "env": {
        "SEMGREP_APP_TOKEN": "YOUR_SEMGREP_APP_TOKEN",
        "MCP_SERVER_SEMGREP_ALLOWED_ROOTS": "/Users/you/projects"
      }
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

  • Node.js v18+ - TypeScript (for development)
VariableDescriptionRequired
SEMGREP_APP_TOKENDeclared in the maintainer’s client configuration.Check documentation
MCP_SERVER_SEMGREP_ALLOWED_ROOTSDeclared in the maintainer’s client configuration.Check documentation

Example prompts to try

  • “Use Semgrep to scan directory.”
  • “Use Semgrep to list rules.”
  • “Use Semgrep to analyze results.”

Frequently asked questions

MCP Server for Semgrep Integration - static code analysis with AI Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.