Semgrep Server
Overview
Semgrep Server is a Model Context Protocol (MCP) Server designed for integrating Semgrep into development environments, enabling static code analysis and management of Semgrep rules directly via the MCP protocol.
To use Semgrep Server, clone the repository, install dependencies, and start the server in either production or development mode.
- Conducts static code analysis using Semgrep - Manages Semgrep rules through various MCP tools - Provides functionalities like scanning directories, listing rules, analyzing results, creating new rules, filtering results, exporting results, and comparing results.
- Performing static code analysis on software projects.
- Managing and creating custom Semgrep rules for code quality checks.
- Analyzing and exporting scan results for reporting purposes.
Add to your AI client
Use these steps to connect Semgrep Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"semgrep-mcp-server-stefanskiasan": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-semgrep-mcp-server-stefanskiasan"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"semgrep-mcp-server-stefanskiasan": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-semgrep-mcp-server-stefanskiasan"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"semgrep-mcp-server-stefanskiasan": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-semgrep-mcp-server-stefanskiasan"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"semgrep-mcp-server-stefanskiasan": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-semgrep-mcp-server-stefanskiasan"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"semgrep-mcp-server-stefanskiasan": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-semgrep-mcp-server-stefanskiasan"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"semgrep-mcp-server-stefanskiasan": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-semgrep-mcp-server-stefanskiasan"
]
}
}
}FAQ
What programming languages does Semgrep support?
Semgrep supports a wide range of programming languages including JavaScript, Python, Java, and more.
Is Semgrep Server free to use?
Yes! Semgrep Server is open-source and free to use.
How can I contribute to the Semgrep Server project?
Contributions are welcome! You can contribute by submitting issues or pull requests on the GitHub repository.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":1523,"uuid":"866d91bd-675d-4fec-9dbe-0bde1a22693f","name":"semgrep-mcp-server","title":"Semgrep Server","description":null,"avatar_url":"https://avatars.githubusercontent.com/u/69960390?v=4","created_at":"2025-02-20T16:13:31.654Z","updated_at":"2025-02-23T07:22:07.217Z","status":"created","author_name":"stefanskiasan","author_avatar_url":"https://avatars.githubusercontent.com/u/69960390?v=4","tags":"semgrep,code-analysis,mcp-server","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/stefanskiasan/semgrep-mcp-server","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":null,"user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]