Code Guardian
Code Guardian is an MCP server that audits, analyzes, and generates production-ready code and CI/CD assets for AI coding agents.
Audit codebases for production readiness across 10 dimensions with A–F grading and remediation guidance
Check project health: git branch naming, test framework and execution, CI/CD configs, linting, security vulnerabilities, and architecture
Generate production-ready code templates for APIs, auth, database, error handling, logging, security, CI/CD, Docker, and testing
Generate security checklists tailored to your project and OWASP Top 10
Generate GitHub Actions CI/CD workflow YAML for stacks and deploy targets (docker, k8s, vercel, aws)
Create complete starter repos with production defaults for NestJS, Express, or Fastify
Get industry-standard patterns and checklists for API, auth, database, testing, security, CI/CD, Docker, and more
Detect the active AI coding agent (Claude Code, Cursor, Windsurf, Devin, Codex, Gemini, Antigravity) and get agent-specific guidance
Generates production-ready Dockerfiles with multi-stage builds, non-root users, healthchecks, and compose configurations.
Checks for ESLint configuration and runs ESLint to enforce code quality standards.
Generates production-ready Express templates for REST APIs, authentication, and related patterns.
Generates production-ready Fastify templates for REST APIs and related patterns.
Generates GitHub Actions CI/CD pipelines with lint, test, build, and deploy stages.
Generates Jest testing templates with coverage thresholds and mock strategies.
Generates production-ready NestJS templates for REST APIs, authentication, and related patterns.
Audits Node.js projects for production readiness across package.json, lock files, build scripts, and more.
Audits npm dependencies and runs npm audit to check for security vulnerabilities.
Enforces OWASP Top 10 security compliance, including helmet, CORS, rate limiting, and input sanitization.
Generates Pino structured JSON logging templates with correlation IDs and log levels.
Generates Prisma database templates with migrations, connection pooling, soft deletes, and indexing.
Includes Sentry integration in error handling patterns for centralized error tracking.
Generates Swagger/OpenAPI documentation for REST API templates.
Generates TypeORM database templates with migrations, connection pooling, soft deletes, and indexing.
Checks for TypeScript strict mode and generates type-safe code patterns.
Generates Vitest testing templates with coverage thresholds and mock strategies.
Generates Zod validation schemas for production-ready REST API templates.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Code Guardian audit this project for production readiness and give me my grade"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Code Guardian
Stop shipping code that isn't ready for production. Code Guardian audits your project against industry standards, generates production-ready patterns, and enforces quality gates — across every AI coding agent.
What is this?
You're building an app. You ask an AI agent to write code. It delivers something that works — but doesn't have tests, error handling, CI/CD, security headers, or proper logging. You ship it, and three days later production burns down.
Code Guardian exists to fix that.
It's an MCP plugin that gives every AI coding agent (Claude Code, Cursor, Windsurf, Devin, Codex, Gemini, Antigravity) built-in knowledge of what production-ready code actually looks like. Before any feature is implemented, it audits the project. After any change, it checks whether it meets industry standards. And when you need to start fresh, it generates complete project scaffolds with zero guesswork.
Think of it as a senior engineer who reviews every line of code the AI writes — but automated, instant, and consistent.
Related MCP server: repo-guardian
Supported Agents
Works with every major AI coding agent out of the box:
Agent | Integration | How it works |
Plugin / MCP Server | Auto-installed via plugin marketplace or manual stdio config | |
MCP Server | Add to | |
MCP Server | Add to | |
Context | Use output directly — paste audit results into Devin's context | |
CLI | Run standalone and pipe output into Codex sessions | |
Context | Set expectations in system prompt with audit findings | |
Context | Define requirements explicitly; run audit as pre-step |
Quick Start
Claude Code — Two ways to install
Option 1: npm link (Recommended)
# Clone the repo
git clone https://github.com/justin-coders/code-guardian.git
cd code-guardian
# Build (no dependencies, but validate the entry point)
node --check src/stdio-server.js
# Install as a global CLI so Claude Code can find it
npm link
# In Claude Code, enable the plugin:
# /plugin marketplace add justin-coders/code-guardian
# /plugin installOption 2: Manual MCP config
Add this to your ~/.claude/settings.json under mcpServers:
{
"code-guardian": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/code-guardian/src/stdio-server.js"]
}
}Then restart Claude Code.
After Installation
The plugin loads automatically. Just ask:
"Audit this project for production readiness"
"Generate a production REST API with NestJS and Zod validation"
"Show me the industry standard for JWT authentication"
"Create a GitHub Actions CI/CD pipeline for my Express app"Cursor — Quick add
Add one entry to your ~/.cursor/mcp.json:
{
"mcpServers": {
"code-guardian": {
"command": "node",
"args": ["/absolute/path/to/code-guardian/src/stdio-server.js"]
}
}
}Restart Cursor. The tools are now available in your prompts.
Windsurf — Same as Cursor
Add the same MCP config to ~/.windsurf/mcp.json.
Other agents (Devin, Codex, Gemini, Antigravity)
These agents don't support MCP plugins directly. Use Code Guardian as a standalone tool — clone the repo and run it, then paste the output into your agent's context, or follow the agent-specific guidance in INSTALLATION.md.
Updating an existing install
cd /path/to/code-guardian
git pull origin dev # or your branch
# If using npm link:
npm unlink && npm link
# If using manual MCP config: no action needed — path still points to repo
# Restart your agent
# Claude Code: close and reopen
# Cursor/Windsurf: restart the editorWhat It Does
1. Audit Everything
Run a full production-readiness audit on any project in seconds:
> "Audit this project"Covers 10 dimensions and gives you an A–F grade with specific remediation steps for every failure:
Dimension | What it checks |
| Scripts, engines, name, version |
Lock file | Dependency pinning for reproducible builds |
README | Documentation quality |
| Sensitive files excluded |
ESLint | Code quality enforcement |
TypeScript strict mode | Type safety settings |
Tests | Coverage and framework config |
CI/CD | Pipeline detection |
| Secret management |
Build script | Deployment readiness |
2. Generate Production-Ready Code
Stop copying Stack Overflow snippets. Get templates that follow industry conventions:
> "Generate a production REST API with NestJS"
> "Create a JWT auth module for Express"
> "Generate a Dockerfile for my NestJS app"Available templates:
Feature | Frameworks | What's included |
REST API | NestJS, Express, Fastify | Controllers, DTOs, validation, Swagger docs, pagination |
Authentication | NestJS, Express | JWT, refresh tokens, RBAC, MFA, brute-force protection |
Database | Prisma, TypeORM, Knex | Migrations, connection pooling, soft deletes, indexing |
Error Handling | All frameworks | Global handlers, custom error classes, structured logging |
Logging | Winston, Pino | JSON structured logs, correlation IDs, log levels |
Security | All frameworks | OWASP Top 10, helmet, CORS, rate limiting, input sanitization |
CI/CD | GitHub Actions | Lint → test → build → deploy pipeline with caching |
Docker | Docker | Multi-stage builds, non-root user, healthchecks, compose |
Testing | Jest, Vitest | 80% coverage thresholds, Arrange-Act-Assert, mock strategies |
Branch Strategy | Git | Feature/bugfix/hotfix/release patterns, PR requirements |
3. Enforce Standards
Every tool includes remediation guidance — not just "you failed X", but "here's exactly how to fix it":
❌ Missing ESLint
→ Add eslint.config.js with: strict mode, no-unused-vars, prefer-const, no-console in prod
❌ No TypeScript strict mode
→ Enable: strict: true, noUncheckedIndexedAccess: true, exactOptionalPropertyTypes: true
❌ No CI pipeline
→ Add .github/workflows/ci.yml with: lint → test → type-check on PR, deploy on main merge4. Know Your Agent
Auto-detects which AI agent you're using and surfaces the right best practices:
> "What's the best way to use Code Guardian with Cursor?"
> "Detect which agent I'm using"Each agent gets tailored guidance on plugin structure, configuration files, and workflows.
10 Industry Pattern Categories
Built-in knowledge of production standards across every major concern:
REST API — Correct HTTP status codes, schema validation, pagination, OpenAPI/Swagger docs
Authentication — JWT with short expiry, RBAC, MFA, token rotation, CSRF protection, brute-force mitigation
Database — Versioned migrations, connection pooling, N+1 query prevention, soft deletes, read replicas
Testing — 80%+ coverage targets, test pyramid (unit/integration/E2E), Arrange-Act-Assert, mock strategies
Error Handling — Centralized global handlers, custom error classes, consistent response shape, Sentry integration
Logging — Structured JSON logs, correlation/request IDs, log levels per environment, centralized aggregation
Security — OWASP Top 10 compliance, helmet.js, CORS whitelists, rate limiting, parameterized queries only
CI/CD — Parallel jobs, node_modules caching, blue-green deployment, rollback scripts, failure notifications
Docker — Multi-stage builds, Alpine/Distroless bases, non-root user, healthchecks, resource limits
Branch Strategy — Git Flow / trunk-based conventions, PR requirements, semantic versioning, squash vs merge rules
File Structure
code-guardian/
├── src/
│ ├── tools.js # 15 tools + 10 industry patterns + code templates
│ ├── stdio-server.js # stdio MCP server (Claude Code, Cursor, Windsurf)
│ └── http-server.js # HTTP/SSE server (port 8765)
├── tests/
│ ├── tools.test.js # 57 unit tests
│ └── integration.test.js # 26 integration tests
├── .claude-plugin/
│ └── plugin.json # Plugin manifest
├── .mcp.json # Dual transport config (stdio + HTTP)
├── package.json # Zero dependencies
├── LICENSE # MIT
├── README.md
├── INSTALLATION.md
├── CONTRIBUTING.md
├── UPCOMING_FEATURES.md
└── CHANGELOG.mdZero dependencies. Pure ESM Node.js. No npm install required.
Complete Tool Reference
Tool | Command | Description |
|
| Full 10-dimension audit with A-F grade and remediation |
|
| Verify git branch naming conventions |
|
| Discover test framework and run execution check |
|
| Detect CI/CD configs and package scripts |
|
| Find linters and run ESLint if present |
|
| Scan for secrets + run |
|
| Review directory structure and monorepo setup |
|
| A-F scorecard with per-item guidance |
|
| Production-ready code templates |
|
| Full checklist for any architectural concern |
|
| OWASP Top 10 tailored to your project |
|
| CI/CD YAML generation |
|
| Auto-detect your AI coding agent |
|
| Agent-specific best practices |
|
| Complete project scaffold with production defaults |
Production Readiness Grading
Grade | Score | What it means |
A | 90–100% | Production-ready. Ship it. |
B | 75–89% | Good. Address the warnings before deploying. |
C | 60–74% | Partial. Significant gaps need fixing. |
D | 40–59% | Below standard. Don't ship without major work. |
F | 0–39% | Not production-ready. Comprehensive remediation needed. |
Development
# Run all tests
node --test tests/**/*.test.js
# Run with coverage report
node --test --experimental-test-coverage tests/**/*.test.js
# Syntax check
node --check src/tools.js
node --check src/stdio-server.js
node --check src/http-server.js83 tests passing. 57 unit tests + 26 integration tests covering all 15 tools.
Adding a New Tool
Implement in
src/tools.jswith defensive args (args = {})Add to
TOOLSarray in bothsrc/stdio-server.jsandsrc/http-server.jsAdd switch case in
handleRequest()/dispatchTool()Write unit tests in
tests/tools.test.jsand integration tests intests/integration.test.jsDocument in README.md tools table
See CONTRIBUTING.md for the full guide.
License
MIT — use it freely in personal and commercial projects.
Built With
Model Context Protocol — open standard for AI tool integration
Node.js — runtime (ESM, zero dependencies)
GitHub Actions — CI reference templates
Made with care by justin-coders. Questions? Open an issue.
Copyright (c) 2026 justin-coders
Available Tools
15 toolsaudit_codebaseB
Full audit of a codebase against industry standards: linting, TypeScript, testing, CI/CD, docs, dependencies. Includes actionable guidance.
Inputs: cwd, depth.
check_architectureC
Review directory structure, monorepo indicators, and architectural conventions.
Inputs: cwd, depth.
check_branchB
Check that the current git branch follows conventional naming (feature/, bugfix/, hotfix/, release/, main, master, develop).
Inputs: cwd.
check_cicdB
Detect CI/CD configuration files (GitHub Actions, GitLab CI, Jenkins, CircleCI, Docker, pre-commit).
Inputs: cwd.
check_lintingA
Detect installed linters (ESLint, Prettier, Biome, oxlint, stylelint) and run ESLint if available.
Inputs: cwd.
check_securityB
Scan for security concerns: .env files at root, dependency vulnerabilities via npm audit.
Inputs: cwd.
check_testsA
Discover test files, detect test framework, and run a quick test execution check.
Inputs: cwd.
detect_agentB
Detect which AI coding agent is in use (Claude Code, Cursor, Windsurf, Devin, Codex, Gemini, Antigravity) by scanning for agent-specific config files (.cursorrules, .windsurfrules, CLAUDE.md, AGENTS.md). Returns detected agents and all supported agents with best practices.
Inputs: cwd.
generate_github_workflowB
Generate a production-ready GitHub Actions CI/CD workflow YAML. Supports custom name, stack, and deploy target (docker, k8s, vercel, aws).
Inputs: name, stack, deployTarget.
generate_production_codeB
Generate production-ready code templates with industry-standard patterns. Supports: api, auth, database, testing, error_handling, logging, security, ci_cd, docker, branch_strategy. Specify stack (nestjs, express, fastify) and feature type.
Inputs: stack, feature, language.
generate_security_checklistB
Generate a security checklist based on current project findings + OWASP Top 10 standards. Detects stack and tailors recommendations.
Inputs: cwd, stack.
generate_starter_repoB
Generate a complete starter project structure with production-ready defaults: directory layout, essential packages, eslint/prettier/tsconfig/jest configs. Supports nestjs, express, fastify frameworks.
Inputs: language, framework.
get_agent_guidanceC
Get agent-specific best practices and configuration guidance. Supported agents: claude-code, cursor, windsurf, devin, codex, gemini, antigravity.
Inputs: agent.
get_industry_patternsA
Get full industry-standard patterns and checklists for any architectural concern: api, auth, database, testing, error_handling, logging, security, ci_cd, docker, branch_strategy.
Inputs: category.
production_readinessA
Compute a production-readiness scorecard (A–F grade) across 10 dimensions: package.json, lock file, README, .gitignore, ESLint, TypeScript strict mode, tests, CI/CD, .env safety, build script. Includes remediation guidance per item.
Inputs: cwd.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
The check_* family (tests, linting, security, architecture, CI/CD, branch) is well-separated by suffix, but audit_codebase and production_readiness heavily overlap as both assess overall codebase health. generate_starter_repo and generate_production_code also blur boundaries (full scaffold vs. feature templates), though descriptions partially clarify the distinction.
Most tools follow a clear verb_noun snake_case convention (check_tests, generate_starter_repo, audit_codebase, detect_agent). The single outlier is production_readiness, which is a noun phrase rather than a verb action, and the mix of check_/generate_/get_ verbs is still predictable. Overall the pattern is consistent with one minor deviation.
At 15 tools, the server sits at the upper boundary of a well-scoped set and is reasonable for a code-quality/readiness domain. A few tools feel tangential (detect_agent, get_agent_guidance) and add bulk without directly serving code auditing, but the count is not excessive.
The surface covers detection (checks), broad assessment (audit, scorecard), generation (starter repo, code templates, workflows, checklists), and reference guidance (industry patterns, agent practices). Notable gaps include a remediation/fix tool and test coverage analysis, but core workflows such as audit, generate, and recommend are well represented.
Maintenance
Related MCP Connectors
Free MCP tools: the only MCP linter, health checks, cost estimation, and trust evaluation.
Read-only AI coding tools for change verification, release readiness, capacity, and guidance.
Statically audits MCP tool surfaces for token cost, schema quality, and design issues.
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables hybrid code audits using MCP tools across 12 domains, producing structured, scored, and actionable code quality reports.5 npm1MIT
- AlicenseAqualityCmaintenanceEnables agents to audit and safeguard repositories by detecting dependency pinning issues, license compliance problems, hardcoded secrets, and dead code through MCP tools.4MIT

Celmis MCP Serverofficial
AlicenseNot gradedqualityBmaintenanceEnables querying indexed code across multiple repositories with file-level citations, reviewing pull requests, auditing dependencies, and exporting SBOMs and evidence packs through MCP tools.3AGPL 3.0- AlicenseBqualityCmaintenanceEnables automated pull request review, security vulnerability analysis, and code quality improvement suggestions through any MCP client.315 npmMIT