
Product
Socket Now Protects the Firefox Extension Ecosystem
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.
@codesherlock/codesherlock-mcp-server
Advanced tools
CodeSherlock MCP Server — AI-powered code analysis via Model Context Protocol
AI-powered code analysis inside your AI assistant.
CodeSherlock MCP Server connects to Claude Code, Cursor, Windsurf, VS Code, Cline, and other MCP-compatible tools — letting your AI assistant scan commits and working-tree changes for security, quality, and compliance issues without leaving your IDE.
npx with no permanent footprintcs_mcp_) — get one hereThe server runs via npx , no global installation needed. All you need is your API key and one configuration block added to your AI assistant's MCP settings file.
Generate a token from https://codesherlock.ai/auth-tokens and select the MCP channel. MCP tokens are prefixed cs_mcp_. Provide it to the server through the MCP_API_KEY environment variable in your MCP configuration (see below).
MCP and CLI tokens are not interchangeable. The MCP server accepts only MCP-channel tokens (
cs_mcp_). Use a CLI token (cs_cli_) only with the CodeSherlock CLI.
Device binding and expiry
MCP_API_KEY, and restart your AI assistant.Add the block below to your AI assistant's MCP configuration file. Replace your-api-key-here with your actual key.
Open Settings -> Tools & MCP -> New MCP Server and Add the configuration below to mcp.json
{
"mcpServers": {
"codesherlock": {
"name": "CodeSherlock MCP Server",
"description": "CodeSherlock is an AI- based code analysis tool that validates unstaged changes and commits directly inside IDEs and AI Agents. It helps developers catch security, quality, and design issues early by combining deep analysis with compliance-aware checks OWASP, CWE, SOC-2 at the moment code is written. CodeSherlock also performs other security vulnerability reviews along with Maintainability, Reliability and Scalability checks. Use CodeSherlock to review and validate code especially generated via AI.",
"command": "npx",
"args": [
"-y",
"@codesherlock/codesherlock-mcp-server"
],
"env": {
"MCP_API_KEY": "your-api-key-here"
}
}
}
}
Save the mcp.json -> Restart Cursor. The server should appear under Tools & MCP with 1 tool enabled.
In the Antigravity agent chat window, click the three dots (...) menu. → Manage MCP Servers → View raw config** and paste:
{
"mcpServers": {
"codesherlock": {
"name": "CodeSherlock MCP Server",
"description": "CodeSherlock is an AI- based code analysis tool that validates unstaged changes and commits directly inside IDEs and AI Agents. It helps developers catch security, quality, and design issues early by combining deep analysis with compliance-aware checks OWASP, CWE, SOC-2 at the moment code is written. CodeSherlock also performs other security vulnerability reviews along with Maintainability, Reliability and Scalability checks. Use CodeSherlock to review and validate code especially generated via AI.",
"command": "npx",
"args": [
"-y",
"@codesherlock/codesherlock-mcp-server"
],
"env": {
"MCP_API_KEY": "your-api-key-here"
}
}
}
}
save the mcp.json -> Click Refresh on the Manage MCP Servers page. -> restart Antigravity if needed.
Open Settings → MCP Servers → Open MCP Marketplace → Settings gear and add to mcp_config.json:
{
"mcpServers": {
"codesherlock": {
"name": "CodeSherlock MCP Server",
"description": "CodeSherlock is an AI- based code analysis tool that validates unstaged changes and commits directly inside IDEs and AI Agents. It helps developers catch security, quality, and design issues early by combining deep analysis with compliance-aware checks OWASP, CWE, SOC-2 at the moment code is written. CodeSherlock also performs other security vulnerability reviews along with Maintainability, Reliability and Scalability checks. Use CodeSherlock to review and validate code especially generated via AI.",
"command": "npx",
"args": [
"-y",
"@codesherlock/codesherlock-mcp-server"
],
"env": {
"MCP_API_KEY": "your-api-key-here"
}
}
}
}
save the mcp_config.json -> Restart Windsurf
Run once in your terminal:
claude mcp add --transport stdio codesherlock --env MCP_API_KEY=your-api-key-here -- cmd /c npx -y @codesherlock/codesherlock-mcp-server
Verify with:
claude mcp list
To remove:
claude mcp remove codesherlock
Or add manually to your Claude config file:
{
"mcpServers": {
"codesherlock": {
"name": "CodeSherlock MCP Server",
"description": "CodeSherlock is an AI- based code analysis tool that validates unstaged changes and commits directly inside IDEs and AI Agents. It helps developers catch security, quality, and design issues early by combining deep analysis with compliance-aware checks OWASP, CWE, SOC-2 at the moment code is written. CodeSherlock also performs other security vulnerability reviews along with Maintainability, Reliability and Scalability checks. Use CodeSherlock to review and validate code especially generated via AI.",
"command": "npx",
"args": [
"-y",
"@codesherlock/codesherlock-mcp-server"
],
"env": {
"MCP_API_KEY": "your-api-key-here"
}
}
}
}
Press Ctrl+Shift+P → MCP: Open User Configuration and add the below configuration to json file:
{
"servers": {
"codesherlock": {
"name": "CodeSherlock MCP Server",
"description": "CodeSherlock is an AI- based code analysis tool that validates unstaged changes and commits directly inside IDEs and AI Agents. It helps developers catch security, quality, and design issues early by combining deep analysis with compliance-aware checks OWASP, CWE, SOC-2 at the moment code is written. CodeSherlock also performs other security vulnerability reviews along with Maintainability, Reliability and Scalability checks. Use CodeSherlock to review and validate code especially generated via AI.",
"command": "npx",
"args": [
"-y",
"@codesherlock/codesherlock-mcp-server"
],
"env": {
"MCP_API_KEY": "your-api-key-here"
}
}
}
}
save the json file -> Restart VS Code. The tool will appear when you type @ in the Copilot Chat panel.
Open the Cline panel → Manage MCP Servers → Settings gear → Configure MCP Servers and add to cline_mcp_settings.json:
{
"mcpServers": {
"codesherlock": {
"name": "CodeSherlock MCP Server",
"description": "CodeSherlock is an AI- based code analysis tool that validates unstaged changes and commits directly inside IDEs and AI Agents. It helps developers catch security, quality, and design issues early by combining deep analysis with compliance-aware checks OWASP, CWE, SOC-2 at the moment code is written. CodeSherlock also performs other security vulnerability reviews along with Maintainability, Reliability and Scalability checks. Use CodeSherlock to review and validate code especially generated via AI.",
"command": "npx",
"args": [
"-y",
"@codesherlock/codesherlock-mcp-server"
],
"env": {
"MCP_API_KEY": "your-api-key-here"
}
}
}
}
save -> restart VS Code -> In the MCP server section you can see the codesherlock mcp server.
Once configured, prompt your AI assistant — it will call the codesherlock_analyze tool automatically.
Review my uncommitted changes using CodeSherlock
Use CodeSherlock to check my uncommitted code for CWE MITRE vulnerabilities
Analyze my latest commit for OWASP vulnerabilities using CodeSherlock
Check the last commit in my current repo for CWE KEV issues with CodeSherlock
| Factor | What it checks |
|---|---|
power_analysis | Security, quality, and compliance combined (default) |
owasp | OWASP Top 10 vulnerabilities |
cwe_mitre | CWE/MITRE weakness catalog |
cwe_kev | CISA Known Exploited Vulnerabilities |
Your AI assistant presents results grouped by file. Each issue includes:
CRITICAL, HIGH, MEDIUM, or LOW| Label | Meaning |
|---|---|
CRITICAL | Must fix immediately — actively exploitable |
HIGH | Fix before merging — serious risk |
MEDIUM | Fix soon — moderate risk |
LOW | Best-practice improvement |
Server not found or fails to start
npx -y @codesherlock/codesherlock-mcp-server in your system terminal. If it fails there, the issue is with your Node.js/npm setup or network access — not the IDE. If it succeeds in the terminal but not the IDE, recheck your config JSON for syntax errors and restart the IDE.Authentication failed or Invalid API key
cs_mcp_), not a CLI token (cs_cli_)Device mismatch / token is bound to a different device
MCP_API_KEY, and restart.API key expired
MCP_API_KEY, and restart your AI assistant.Not a Git repository
.git folder. Run git init if needed.No changes to analyze
git log.Analysis times out or takes too long
Stale NPX cache causing issues
Clear the cache and restart your IDE:
# macOS/Linux
rm -rf ~/.npm/_npx
# Windows (PowerShell)
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\npm-cache\_npx"
Demo video : https://youtu.be/c55BcFvonl4?si=6Df8oNaL9wQeVn5w
Full setup guide: https://docs.codesherlock.ai/codesherlock-mcp-server/mcp/setup/guide
MIT
FAQs
CodeSherlock MCP Server — AI-powered code analysis via Model Context Protocol
We found that @codesherlock/codesherlock-mcp-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.

Research
/Security News
Three compromised Rust crates pulled in a malicious dependency that downloaded and executed cross-platform malware during Cargo builds.

Research
/Security News
Socket uncovered 77 linked Firefox extensions, including 40 that steal wallet secrets or credentials and 37 deceptive sports-score shells.