Semgrep Code Security MCP
Semgrep's public MCP (mcp.semgrep.ai) gives agents static-analysis tools โ scan code for vulnerabilities, check security posture and inspect ASTs โ with no authentication.
- Provider
- Semgrep โ
- Source
- https://github.com/semgrep/mcp โ
- Categories
- ๐ ๏ธ Developer Tools & Git
ไธญๆ็ฎไป
Semgrep ๅ ่ดน่ฟ็จ MCP ๆๅกๅจ๏ผ้ขๅไปฃ็ ๅฎๅ จใๆ ้็ปๅฝๅณๅฏๆง่ก Semgrep ๆซๆใๅฎๅ จๆฃๆฅๅ AST ๅๆใ
Legacy SSE endpoint
Or add to ~/.cursor/mcp.json:
{
"mcpServers": {
"semgrep": {
"url": "https://mcp.semgrep.ai/mcp"
}
}
}claude mcp add --transport http semgrep https://mcp.semgrep.ai/mcp
Or add to .vscode/mcp.json:
{
"servers": {
"semgrep": {
"type": "http",
"url": "https://mcp.semgrep.ai/mcp"
}
}
}- Open Settings โ Connectors (Integrations) โ Add Custom Connector.
- Paste the endpoint URL:
https://mcp.semgrep.ai/mcp - No authentication needed โ tools are available immediately.
Bridge the remote endpoint into stdio with mcp-remote in claude_desktop_config.json:
{
"mcpServers": {
"semgrep": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.semgrep.ai/mcp"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"semgrep": {
"serverUrl": "https://mcp.semgrep.ai/mcp"
}
}
}๐งฐ Tools exposed by Semgrep MCP (3)
| Tool | Safety | Description | Parameters |
|---|---|---|---|
| semgrep_scan | ๐ข Read | Scan a code snippet with Semgrep rules and return findings. | code*: stringlanguage: string |
| security_check | ๐ข Read | Run a security-focused check over provided code files. | codeFiles*: arrayconfig: string |
| get_abstract_syntax_tree | ๐ข Read | Return the abstract syntax tree Semgrep builds for a code snippet. | code*: stringlanguage: string |
๐ OAuth 2.1 & Security
- Auth type
- None (public)
- Dynamic Client Registration
- โ
- PKCE S256
- โ
- Protected resource metadata
- https://mcp.semgrep.ai/.well-known/oauth-protected-resource (expected location)
๐งฉ Recommended Agent Skills
๐ Guide
Semgrep MCP โ Remote MCP Server
Semgrep's hosted MCP puts a SAST engine behind tool calls: paste code and get back findings, security checks or the abstract syntax tree Semgrep sees. It is public and unauthenticated โ code you send goes to Semgrep's service, so avoid scanning secrets or proprietary code you cannot share.
Endpoint & Transport
- Endpoint URL:
https://mcp.semgrep.ai/mcp - Legacy SSE endpoint:
https://mcp.semgrep.ai/sse - Transport: Streamable HTTP + legacy SSE
Authentication
Semgrep MCP is public and unauthenticated โ no OAuth, no API key, no headers. Any MCP client can connect and call its tools directly, which also makes it a great endpoint for smoke-testing your own MCP client or proxy.
Available Tools (3)
| Tool | Safety | Description |
|---|---|---|
semgrep_scan |
read | Scan a code snippet with Semgrep rules and return findings. |
security_check |
read | Run a security-focused check over provided code files. |
get_abstract_syntax_tree |
read | Return the abstract syntax tree Semgrep builds for a code snippet. |
Connect in 30 Seconds
Claude Code โ one command:
claude mcp add --transport http semgrep https://mcp.semgrep.ai/mcp
Cursor โ add to ~/.cursor/mcp.json:
{ "mcpServers": { "semgrep": { "url": "https://mcp.semgrep.ai/mcp" } } }
VS Code โ add to .vscode/mcp.json:
{ "servers": { "semgrep": { "type": "http", "url": "https://mcp.semgrep.ai/mcp" } } }
Claude Desktop & stdio clients โ bridge with mcp-remote:
{ "mcpServers": { "semgrep": { "command": "npx", "args": ["-y", "mcp-remote", "https://mcp.semgrep.ai/mcp"] } } }
Troubleshooting
- Which URL should I use? Prefer
https://mcp.semgrep.ai/mcp(Streamable HTTP). The SSE URL is only for older clients pinned to the pre-2025-03-26 spec. - "Session expired" / stale
Mcp-Session-Idโ just re-sendinitialize; stateless clients can ignore session headers entirely. - No authentication required โ don't send proprietary code you can't share with a third-party service.
- Both /mcp and /sse transports are available.
๐ How to Connect
- Copy the Semgrep MCP endpoint URLThe remote endpoint is https://mcp.semgrep.ai/mcp. A legacy SSE endpoint is also available at https://mcp.semgrep.ai/sse.
- Add it to your MCP clientClaude Code:
claude mcp add --transport http semgrep https://mcp.semgrep.ai/mcp. Cursor: add"semgrep": { "url": "https://mcp.semgrep.ai/mcp" }undermcpServersin ~/.cursor/mcp.json. Other clients work similarly. - Verify with the online inspectorPaste https://mcp.semgrep.ai/mcp into remotemcp.net/inspector, run initialize and tools/list, and confirm Semgrep MCP's 3 tools respond.
โ FAQ
What is the Semgrep MCP remote MCP endpoint?
The primary endpoint is https://mcp.semgrep.ai/mcp, with a legacy SSE endpoint at https://mcp.semgrep.ai/sse. It is an official first-party server operated by Semgrep, speaking the Streamable HTTP + legacy SSE transport.
Should I use Semgrep MCP's /mcp or /sse endpoint?
Use https://mcp.semgrep.ai/mcp โ Streamable HTTP is the current MCP transport and what every modern client defaults to. https://mcp.semgrep.ai/sse exists only for clients still on the legacy HTTP+SSE transport from the 2024 spec.
How do I authenticate with Semgrep MCP?
You don't โ Semgrep MCP is public and unauthenticated. Connect and start calling tools; no OAuth flow or API key is needed.
I'm getting a 401 Unauthorized from Semgrep MCP โ what's wrong?
Semgrep MCP is authless, so a 401 is unusual. Check that you're hitting https://mcp.semgrep.ai/mcp exactly (including the path) and not an API endpoint that requires a different credential.
Which MCP clients work with Semgrep MCP?
Any client that supports remote MCP servers: Cursor, Claude Code (`claude mcp add --transport http semgrep https://mcp.semgrep.ai/mcp`), VS Code Copilot, ChatGPT connectors, Windsurf, and Claude Desktop via the `mcp-remote` bridge.
What tools does Semgrep MCP expose?
3 tools are cataloged in this directory โ including `semgrep_scan`, `security_check`, `get_abstract_syntax_tree`. Use our online inspector to fetch the live tool list straight from the endpoint.
๐ Connect Guides
๐ Embed Status Badge in README
Related Servers
GitHub's official remote MCP server hosted at api.githubcopilot.com. Gives AI agents first-party access to repositories, issues, pull requests and code search.
Linear's official remote MCP server. Agents can search, create and update issues and query your team's workflow over Streamable HTTP or SSE.
Cognition Devin's free DeepWiki MCP. Ask questions and read AI-generated wiki documentation for any public GitHub repository โ no auth required.
Upstash Context7's free, no-auth MCP server. Fetches up-to-date, version-specific library documentation straight into your agent's context.