MCP Server for Semgrep Integration - static code analysis with AI
MCP Server for Semgrep Integration - static code analysis with AI. The mcp mcp server wraps that behind the Model Context Protocol, so an assistant can use it through 9 defined tools rather than through you.
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.
Everything the assistant can do here goes through one of these:
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 serverBeing a remote server, there is no local install. You register the endpoint with your client, authorise it once, and the tools appear.
You 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.
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. MCP'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 div0.space; worth a glance at recent repository activity before you build anything load-bearing on it.
We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.
| 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": {
"semgrep-1": {
"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.