MCP Server for Semgrep Integration - static code analysis with AI
Semgrep MCP server is a hosted integration for AI assistants that speak the Model Context Protocol. MCP Server for Semgrep Integration - static code analysis with AI.
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.
Once Semgrep is connected, these are the calls the assistant has available:
scan_directory — Scanning source code for potential issueslist_rules — Displaying available rules and languages supported by Semgrepanalyze_results — Detailed analysis of scan resultscreate_rule — Creating custom Semgrep rulesfilter_results — Filtering results by various criteriaexport_results — Exporting results in various formatscompare_results — Comparing two sets of results (e.g., before and after changes)Prerequisites — The Prerequisites tool exposed by this serverTesting — The Testing tool exposed by this serverYou will need 2 environment variables: SEMGREP_APP_TOKEN, MCP_SERVER_SEMGREP_ALLOWED_ROOTS. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.
Being a remote server, there is no local install. You register the endpoint with your client, authorise it once, and the tools appear.
This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Semgrep's toolset — scan_directory, list_rules, analyze_results and 6 more — is a fair guide to whether it matches your workflow. It is maintained by Szowesgad; worth a glance at recent repository activity before you build anything load-bearing on it.
This entry was verified against Semgrep's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.
| Tool | What it does |
|---|---|
| scan_directory | Scanning source code for potential issues |
| list_rules | Displaying available rules and languages supported by Semgrep |
| analyze_results | Detailed analysis of scan results |
| create_rule | Creating custom Semgrep rules |
| filter_results | Filtering results by various criteria |
| export_results | Exporting results in various formats |
| compare_results | Comparing two sets of results (e.g., before and after changes) |
| Prerequisites | The Prerequisites tool exposed by this server. |
| Testing | The Testing tool exposed by this server. |
{
"mcpServers": {
"server-semgrep": {
"command": "npx",
"args": ["-y", "mcp-server-semgrep"],
"env": {
"SEMGREP_APP_TOKEN": "your-value",
"MCP_SERVER_SEMGREP_ALLOWED_ROOTS": "your-value"
}
}
}
}Add to claude_desktop_config.json, then restart Claude Desktop.
| Variable | Description | Required |
|---|---|---|
| SEMGREP_APP_TOKEN | Credential the server authenticates with. | Yes |
| MCP_SERVER_SEMGREP_ALLOWED_ROOTS | Configuration value read at startup. | Optional |
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.