Scans AI-generated code for invisible Unicode, Trojan Source, and supply-chain threats.
Scans AI-generated code for invisible Unicode, Trojan Source, and supply-chain threats. That is what the codesafer mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.
AI coding assistants generate code fast — but who's checking it for hidden threats?
Installation goes through your MCP client rather than a global install: point it at npm on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.
The server publishes 7 tools. What each one is for:
scan_file — Scan a single file for hidden malicious code patternsscan_directory — Recursively scan a directory across all source filesscan_rules_file — Scan an AI configuration/rules file for prompt injection and Rules File Backdoor attackscheck_dependencies — Check package.json for typosquatting, suspicious install scripts, and dependency risksai_analyze — Deep AI analysis using the trained CodeBERT model (classifies chunks as malicious/benign with confidence)explain_finding — Get detailed explanation of a specific threat category, with attack scenarios and remediationPrerequisites — The Prerequisites tool exposed by this serverPlenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Codesafer's toolset — scan_file, scan_directory, scan_rules_file and 4 more — is a fair guide to whether it matches your workflow. It is maintained by goldmembrane; worth a glance at recent repository activity before you build anything load-bearing on it.
SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.
| Tool | What it does |
|---|---|
| scan_file | Scan a single file for hidden malicious code patterns |
| scan_directory | Recursively scan a directory across all source files |
| scan_rules_file | Scan an AI configuration/rules file for prompt injection and Rules File Backdoor attacks |
| check_dependencies | Check package.json for typosquatting, suspicious install scripts, and dependency risks |
| ai_analyze | Deep AI analysis using the trained CodeBERT model (classifies chunks as malicious/benign with confidence) |
| explain_finding | Get detailed explanation of a specific threat category, with attack scenarios and remediation |
| Prerequisites | The Prerequisites tool exposed by this server. |
**Cursor** (`.cursor/mcp.json`):
```json
{
"mcpServers": {
"codesafer": {
"command": "node",
"args": ["/absolute/path/to/cleaner-code/dist/index.js"]
}
}
}Configuration as documented by the project. Restart the client after saving.
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.