Code Guardian
Static-analysis MCP server that grades a repo A to F for safety, function and completeness
Code Guardian is an open-source MCP server for security. It runs locally on your machine and is started by your AI client.
- Pricing
- Open source
- Platforms
- CLI, Self-hosted, Linux
- Runs
- Locally
- What it can do
- Read-only
- Version
- 0.7.1
- Listing updated
Similar MCP servers
Install
Add with the CLI
Run in a terminal
claude mcp add code-guardian -- uvx code-guardian-mcpAdd --scope user to use it in every project, or --scope project to share it in .mcp.json.
Or share it with your project
Add to .mcp.json
{
"mcpServers": {
"code-guardian": {
"command": "uvx",
"args": [
"code-guardian-mcp"
]
}
}
}Add to claude_desktop_config.json
{
"mcpServers": {
"code-guardian": {
"command": "uvx",
"args": [
"code-guardian-mcp"
]
}
}
}Settings → Developer → Edit Config, then quit and reopen Claude Desktop.
Add to ~/.cursor/mcp.json
{
"mcpServers": {
"code-guardian": {
"command": "uvx",
"args": [
"code-guardian-mcp"
]
}
}
}Use .cursor/mcp.json in a project to share it with the project.
Add to ~/.copilot/mcp-config.json
{
"mcpServers": {
"code-guardian": {
"type": "stdio",
"command": "uvx",
"args": [
"code-guardian-mcp"
]
}
}
}Or put the same entry in .mcp.json at your workspace root to share it.
Add with the CLI
Run in a terminal
codex mcp add code-guardian -- uvx code-guardian-mcpOr add to config.toml
Add to ~/.codex/config.toml
[mcp_servers.code-guardian]
command = "uvx"
args = ["code-guardian-mcp"]Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"code-guardian": {
"command": "uvx",
"args": [
"code-guardian-mcp"
]
}
}
}Gemini CLI and Antigravity
Gemini CLI
Add to ~/.gemini/settings.json
{ "mcpServers": { "code-guardian": { "command": "uvx", "args": [ "code-guardian-mcp" ] } } }Or run: gemini mcp add -s user code-guardian uvx -- code-guardian-mcp
Antigravity
Add to ~/.gemini/config/mcp_config.json
{ "mcpServers": { "code-guardian": { "command": "uvx", "args": [ "code-guardian-mcp" ] } } }Use .agents/mcp_config.json to add it to one workspace only.
Devin Desktop (formerly Windsurf)
Add to ~/.config/devin/mcp_config.json
{ "mcpServers": { "code-guardian": { "command": "uvx", "args": [ "code-guardian-mcp" ] } } }On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.
Cline
Add to cline_mcp_settings.json
{ "mcpServers": { "code-guardian": { "command": "uvx", "args": [ "code-guardian-mcp" ] } } }Open it from the MCP Servers icon → Configure → Configure MCP Servers.
Zed
Add to Zed settings.json
{ "context_servers": { "code-guardian": { "command": "uvx", "args": [ "code-guardian-mcp" ] } } }Open it with zed: open settings file. Merge context_servers into the settings you already have.
JetBrains AI Assistant and Junie
AI Assistant
Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add
{ "mcpServers": { "code-guardian": { "command": "uvx", "args": [ "code-guardian-mcp" ] } } }Junie
Add to ~/.junie/mcp/mcp.json
{ "mcpServers": { "code-guardian": { "command": "uvx", "args": [ "code-guardian-mcp" ] } } }Use .junie/mcp/mcp.json to share it with a project.
Kiro
Add to ~/.kiro/settings/mcp.json
{ "mcpServers": { "code-guardian": { "command": "uvx", "args": [ "code-guardian-mcp" ] } } }Use .kiro/settings/mcp.json to add it to one workspace only.
Using several servers? Build one config file with the MCP config generator.
Configuration
CODE_GUARDIAN_LLM_URLOptional: local model for the explain tool (Ollama /api/chat or an OpenAI-compatible /v1/chat/completions URL)CODE_GUARDIAN_LLM_MODELOptional: model name for the explain tool
About Code Guardian
Before running a cloned repository or merging an assistant's rewrite, you get three scores out of 100: Safe, Works and Complete, combined into an Overall grade. Checks are deterministic with fixed weights, and nothing is executed, imported or installed. A scan makes no network calls. The README is clear that grade A means nothing the scanners recognise, not proven safe.
Python is analysed in full through its parse tree, JavaScript and TypeScript at token level, and other languages get only the secret scan and repo-hygiene checks. Every report prints a coverage line saying what was analysed and how. It also finds orphan code and offers a verify loop: run it before and after an AI-assisted change to see what the change fixed, what it broke and whether the scan can be trusted.
It ships as a CLI, GitHub Action, pre-commit hook and a hand-written stdio MCP server with no dependencies. An optional local model, set by environment variables, can write a plain-English explanation that never changes the score. Install the PyPI package code-guardian-mcp, not the unrelated code-guardian.
Tools this server provides (1)
Taken from the project documentation; the running server may differ.
From the tool list in its README, going by the names, all 1 tool only read data.
From the server's own tool labels and tool names; not verified by us.
- explainName suggests: reads
- Optionally explain findings in plain English using a local model.
What it does
- A-F repo grade
- Safe, Works and Complete scores combine into one grade.
- Never executes code
- Parses source only; no imports, installs or network calls.
- Fix planning
- The plan command lists the fixes worth the most Overall points.
- Verify loop
- Compare scans before and after an AI-assisted change.
- Orphan code detection
- Finds code unreachable from the project's entry points.
- Optional local explanation
- A local model can explain findings without rescoring them.
Good for
- Vet a cloned repository before running it
- Check whether an assistant's rewrite broke something
- Add a repo-grade gate to pre-commit or CI
- Find dead code in a Python project
Pricing
Open source
Free, MIT-licensed
Code Guardian FAQ
Does Code Guardian run the code it scans?
No. It parses source and never executes, imports or installs it.
Does a grade A mean the code is safe?
No. The README says it means nothing the scanners recognise, not proven safe.
Which languages are covered?
Python fully, JavaScript and TypeScript at token level, other languages secret scan and hygiene checks only.
What do I install?
pip install code-guardian-mcp; a different project called code-guardian exists on PyPI.
Is Code Guardian free?
Yes. Code Guardian is open source, so you can use and self-host it for free.
How do I add Code Guardian to Claude Code?
Run this command in your terminal: claude mcp add code-guardian -- uvx code-guardian-mcp
What are the best alternatives to Code Guardian?
The closest alternatives to Code Guardian are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.
Where this comes from
- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.


