
Code Sentinel
io.github.salrad22Published by GitHub account salrad22v0.2.6Updated Oct 24, 2026
Code quality analysis MCP server - detects security issues, deceptive patterns, and placeholders
Overview
Analyzes source code for security flaws, deceptive error-hiding patterns, placeholders, and code smells, returning structured JSON or HTML reports.
- What you can do
- CodeSentinel runs pattern-based static analysis over code you pass in, covering 93 patterns across security, deceptive patterns, placeholders, errors, and strengths. Tools include analyze_code for full JSON results, generate_report for a visual HTML report, check_security, check_deceptive_patterns, check_placeholders, analyze_patterns, and analyze_design_patterns. It detects things like hardcoded secrets, empty catch blocks, error-masking fallbacks, TODO placeholders, and linter suppressions, and also flags good practices. Language is inferred from the filename, with support for TypeScript, JavaScript, Python, Go, Rust, Java, and others.
- When to use it
- Use it when reviewing AI-generated or hand-written code and you want a quality gate for hidden failures, incomplete implementations, or hardcoded credentials before code reaches production. It complements linters and type checkers rather than replacing them, since it targets semantic intent instead of syntax or style.
- Requirements
- Runs locally over stdio as the npm package code-sentinel-mcp, typically via npx or a global install, so Node.js is needed. No environment variables, headers, or authentication are declared. The README also documents an optional remote Cloudflare Workers endpoint and self-hosting, which would require a Cloudflare account and Wrangler CLI.
Installation
In SourceWeft
- Open Code Sentinel in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
CodeSentinel MCP Server
A comprehensive code quality analysis server for the Model Context Protocol (MCP). CodeSentinel integrates with Claude Code and other MCP-compatible clients to detect security vulnerabilities, deceptive patterns, incomplete code, and highlight good practices.
Why CodeSentinel?
AI coding assistants can inadvertently introduce subtle issues: hardcoded secrets, empty catch blocks, TODO placeholders left behind, or patterns that hide errors. CodeSentinel acts as a quality gate, analyzing code for 93 distinct patterns across 5 categories before issues reach production.
Key differentiators:
- Verification-aware detection: Many patterns include verification steps to reduce false positives
- LLM-optimized output: Structured JSON output designed for AI consumption and action
- Balanced analysis: Detects both issues AND strengths for fair code assessment
- Multi-language support: Works with TypeScript, JavaScript, Python, Go, Rust, Java, and more
Why Not Tree-sitter or AST-Based Tools?
CodeSentinel intentionally uses a pattern-based approach rather than AST parsing. Here's why:
The Problem We Solve Is Different
Traditional linters (ESLint, tree-sitter) detect syntax errors and style violations. CodeSentinel detects semantically deceptive patterns - code that is:
- Syntactically valid (passes all linters)
- Structurally correct (valid AST)
- But hides serious issues that AI agents commonly produce
Examples AST Tools Miss
What Each Approach Detects
The Real Issue: Agent Behavior
AI coding agents produce code that looks correct but contains subtle deceptions:
- "Making the error go away" - Empty catches, silent returns, swallowed exceptions
- Placeholder implementations -
return true,return [], TODO comments - False confidence patterns -
|| []fallbacks that mask fetch failures - Suppression abuse -
@ts-ignore,eslint-disableto hide type errors
These patterns pass every linter and compile successfully. AST tools see valid structure. Only pattern-based detection catches the semantic intent behind the code.
When to Use What
CodeSentinel complements these tools - it catches what they structurally cannot.
Features
- Security Analysis (16 patterns): Hardcoded secrets, SQL injection, XSS, command injection, insecure crypto, disabled SSL, and more
- Deceptive Pattern Detection (17 patterns): Empty catch blocks, silent failures, error-hiding fallbacks, linter suppression
- Placeholder Detection (19 patterns): TODO/FIXME/HACK comments, lorem ipsum, test data, incomplete implementations
- Error & Code Smell Detection (18 patterns): Type coercion issues, null references, async anti-patterns, floating point comparison
- Strength Recognition (23 patterns): Highlights good practices like proper typing, error handling, testing patterns, documentation
- HTML Reports: Visual reports with quality scores and actionable suggestions
Installation
From npm
From source
Usage with Claude Code
Quick setup
Or if installed globally
Manual configuration
Add to your Claude Code MCP configuration file (~/.claude/claude_desktop_config.json):
Remote Server (Cloudflare Workers)
CodeSentinel is also available as a remote MCP server on Cloudflare Workers. No local installation required!
Quick connect (Claude Code)
Or use the Streamable HTTP endpoint (recommended for newer clients):
Endpoints
Self-hosting on Cloudflare
Deploy your own instance:
Requirements:
- Cloudflare account (free tier works)
- Wrangler CLI (
npm install -g wrangler) wrangler loginto authenticate
The server uses Durable Objects for persistent MCP connections. No database required.
Available Tools
analyze_code
Full analysis returning structured JSON with all issues and strengths. Best for programmatic processing.
Parameters:
code(string, required): The source code to analyzefilename(string, required): Filename for language detection (e.g., "app.ts")
Returns: JSON object with issues, strengths, and summary statistics.
generate_report
Full analysis with a visual HTML report. Best for human review.
Parameters:
code(string, required): The source code to analyzefilename(string, required): Filename for language detection
Returns: Markdown summary plus complete HTML report.
check_security
Security-focused analysis only. Use when you specifically want to audit for vulnerabilities.
Parameters:
code(string, required): The source code to checkfilename(string, required): Filename
Returns: List of security issues or confirmation of none found.
check_deceptive_patterns
Check for code patterns that hide errors or create false confidence.
Parameters:
code(string, required): The source code to checkfilename(string, required): Filename
Returns: List of deceptive patterns found.
check_placeholders
Find TODOs, dummy data, and incomplete implementations.
Parameters:
code(string, required): The source code to checkfilename(string, required): Filename
Returns: List of placeholder code found.
analyze_patterns
Analyze code for architectural, design, and implementation patterns. Detects pattern usage, inconsistencies, and provides actionable suggestions.
Parameters:
code(string, required): The source code to analyzefilename(string, required): Filename for language detectionlevel(string, optional): Pattern level to analyze:architectural: System structure patterns (layering, modules)design: Gang of Four patterns (Singleton, Factory, Observer)code: Implementation idioms (error handling, async patterns)all: All levels (default)
query(string, optional): Natural language query to focus analysis (e.g., "how is error handling done?")
Returns: LLM-optimized JSON with detected patterns, inconsistencies, suggestions, and ready-to-execute action items.
analyze_design_patterns
Focused analysis of Gang of Four (GoF) design patterns. Best for understanding OOP structure.
Parameters:
code(string, required): The source code to analyzefilename(string, required): Filename for language detection
Returns: Detected design patterns with confidence levels, locations, and implementation details.
Example Usage
Ask Claude to analyze code:
CodeSentinel will detect:
- Critical (CS-SEC003): OpenAI API key hardcoded in source
- High (CS-DEC001): Empty catch block silently swallowing errors
- Low (CS-PH001): TODO comment indicating incomplete implementation
Detection Categories
Security Issues (CS-SEC)
Deceptive Patterns (CS-DEC)
Placeholders (CS-PH)
Errors & Code Smells (CS-ERR)
Strengths (CS-STR)
Scoring Algorithm
Quality score (0-100) calculated as:
Supported Languages
CodeSentinel detects language from file extensions:
Extending CodeSentinel
CodeSentinel uses a data-driven pattern system that separates pattern definitions from regex generation. This makes adding new patterns easier and more maintainable.
Project Structure
Adding a New Pattern
Instead of writing regex manually, you define what to detect and the system generates the regex:
Available Match Types
Step-by-Step: Adding a Pattern
- Choose the category - security, deceptive, placeholder, or error
- Open the definition file -
src/patterns/definitions/<category>.ts - Add a new pattern definition using the appropriate match type
- Build -
npm run build - Test - Use the MCP inspector to verify detection
Pattern Definition Structure
Development
Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Add patterns following the existing format
- Submit a pull request
License
MIT
Links
Source: README.md at commit 6fac834
Tools
0Version history
1- v0.2.6LatestSep 16, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.