Skip to content
← All MCP servers

Is the Semgrep MCP server safe? What it can reach

What the Semgrep MCP server can read, write and delete, how it signs in, and how to limit it in Claude Code and Codex.

Official serverChecked

Semgrep’s official MCP server now ships inside the semgrep CLI as semgrep mcp; the standalone semgrep/mcp repo is archived. It runs locally and mostly scans code. An optional SEMGREP_APP_TOKEN lets it read findings from the Semgrep AppSec Platform. Individual tools can be switched off with environment variables.

Who maintains it

ImplementationKindStatus
semgrep mcp (inside the Semgrep CLI)Officialactive
semgrep/mcp (standalone, semgrep-mcp on PyPI)Officialarchived

It runs as a local process on your machine.

How it signs in

Scanning needs no account. For platform tools, an optional Semgrep AppSec Platform token (SEMGREP_APP_TOKEN) acts with that token’s access to your organization’s findings.

What its tools can do

KindTools
Readsemgrep_scan, semgrep_scan_with_custom_rule, semgrep_scan_supply_chain, semgrep_scan_remote, get_abstract_syntax_tree, semgrep_rule_schema, get_supported_languages, semgrep_findings, semgrep_whoami
Writenone documented
Can’t be undonenone documented

Names are from the registered tools in the semgrep repo’s server code; the new README doesn’t list them. semgrep_scan_remote exists only when SEMGREP_IS_HOSTED=true, and semgrep_whoami is removed on stdio. The archived README used older names such as security_check.

Built-in limits

OptionWhat it does
SEMGREP_SCAN_DISABLED, SEMGREP_SCAN_WITH_CUSTOM_RULE_DISABLED, SEMGREP_SCAN_SUPPLY_CHAIN_DISABLED, SEMGREP_SCAN_REMOTE_DISABLEDSet to true to remove that scan tool.
SEMGREP_FINDINGS_DISABLEDSet to true to remove the tool that reads findings from the AppSec Platform.
GET_ABSTRACT_SYNTAX_TREE_DISABLED, SEMGREP_RULE_SCHEMA_DISABLED, GET_SUPPORTED_LANGUAGES_DISABLEDSet to true to remove those tools.
Leave SEMGREP_APP_TOKEN unsetWithout a token the server can’t fetch platform findings.

The risks

  • Scan tools read local code the agent points them at, so an injected instruction could steer scans toward sensitive files and return snippets of them in findings.
  • A scan with the auto config needs metrics on; the server refuses it when SEMGREP_SEND_METRICS is off, so use a named config if you want metrics off.
  • With SEMGREP_APP_TOKEN set, semgrep_findings reads your organization’s vulnerability data from the platform with that token’s access, and the agent can paste it into other tools.
  • The older semgrep-mcp package and its Docker image come from the archived repo, which gets no further updates.

Limit it in Claude Code

Add it from the documented launch settings, at local or user scope so a token never lands in a shared .mcp.json:

claude mcp add --env SEMGREP_APP_TOKEN=... semgrep -- semgrep mcp

Claude Code names MCP tools mcp__semgrep__<tool>. Deny rules win over ask rules, and ask rules over allow rules. Put these in ~/.claude/settings.json or the project’s .claude/settings.json:

{
  "permissions": {
    "ask": [
      "mcp__semgrep__semgrep_findings"
    ]
  }
}

Limit it in Codex

Codex reads MCP servers from ~/.codex/config.toml. disabled_tools removes tools, and enabled_tools keeps only the ones you list:

[mcp_servers.semgrep]
command = "semgrep"
args = ["mcp"]
env_vars = ["SEMGREP_APP_TOKEN"]

Checklist

  • Install the Semgrep CLI and run semgrep mcp rather than the archived semgrep-mcp package.
  • Leave SEMGREP_APP_TOKEN unset unless you need platform findings.
  • Set the *_DISABLED variables for tools you don’t need.
  • Scan with a named config such as p/security-audit if you turn metrics off.

Checked against the vendor documentation on November 25, 2026. Semgrep MCP README (semgrep repo) · Semgrep MCP server code (tool registration and disable variables) · semgrep/mcp archived README

What Excellent covers

Excellent doesn’t inspect MCP servers themselves. Its free scan reads supported logs on the Mac (Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code) and reports findings for review, so you can see what an agent did after a session. Run the free scan · See a sample report · How to vet any MCP server

Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Pro is US-only for now. Agent coverage · Pricing