Skip to main content
Glama

CodeSafer (cleaner-code)

MCP(Model Context Protocol) 서버 형태의 AI 코드 보안 스캐너. 기존 린터(linter)가 놓치는 AI 생성 코드 내의 숨겨진 위협을 탐지합니다.

npm license: ISC Node

웹사이트: codesafer.org  ·  MCP 클라이언트: Claude Code, Cursor, VS Code + Copilot, Cline


왜 CodeSafer인가요?

AI 코딩 어시스턴트는 코드를 빠르게 생성하지만, 그 안에 숨겨진 위협을 누가 확인하고 있을까요?

최근의 공급망 공격 사례를 보면, 악성 코드는 사람의 검토나 기존 린터가 일상적으로 놓치는 방식으로 숨어들 수 있습니다:

  • 식별자에 삽입된 보이지 않는 유니코드 문자 (30개 이상의 변형)

  • 코드의 표시 방식과 실행 방식을 다르게 만드는 BiDi / Trojan Source 공격 (CVE-2021-42574)

  • 라틴 문자로 위장한 키릴 문자 등의 동형 문자(Homoglyphs) (CVE-2021-42694)

  • 공백에 페이로드를 숨기는 Glassworm 스타일의 유니코드 스테가노그래피

  • .cursorrules, CLAUDE.md 및 기타 AI 설정 파일에 심어진 규칙 파일 백도어

  • package.json 내의 타이포스쿼팅(Typosquatted) 의존성

  • 난독화 패턴 — eval + base64, 리버스 셸, 패킹된 페이로드

CodeSafer는 코드가 머신에서 실행되기 전에 이 모든 위협을 스캔합니다.


Related MCP server: guardvibe

작동 원리

CodeSafer는 로컬 MCP 서버로 실행됩니다. AI 클라이언트(Claude Code, Cursor 등)가 코드를 검토하거나 생성할 때 도구를 호출하며, 결과는 인라인으로 반환됩니다.

하이브리드 탐지:

  1. 8가지 정적 분석 스캐너 — 알려진 공격 범주에 대한 결정론적 규칙 (빠르고, 해당 패턴에 대해 오탐지율 제로).

  2. CodeBERT 심층 분석 — 트랜스포머 모델이 코드 조각을 악성/정상으로 분류하고 신뢰도 점수를 제공합니다. 정적 규칙이 놓치는 난독화되거나 새로운 패턴을 포착합니다.

데이터는 머신 밖으로 나가지 않습니다. AI 분석은 토크나이저 서버를 통해 로컬에서 실행됩니다.


기능

기능

세부 정보

보이지 않는 문자 탐지

제

Available Tools

6 tools
ai_analyzeA

Deep AI analysis of code using the trained CodeBERT model. Classifies code chunks as malicious or benign with confidence scores. Detects obfuscated payloads, novel attack patterns, and threats that static rules may miss.

Inputs: file_path (required).

check_dependenciesB

Check package.json for typosquatting, suspicious install scripts, and dependency risks

Inputs: file_path (required).

explain_findingA

Get detailed explanation of a specific threat category including attack scenarios, real-world examples, and remediation steps

Inputs: category (required).

scan_directoryB

Recursively scan a directory for hidden malicious code patterns across all source files

Inputs: dir_path (required), extensions.

scan_fileB

Scan a single file for hidden malicious code patterns (invisible chars, BiDi, homoglyphs, steganography, obfuscation, etc.)

Inputs: file_path (required).

scan_rules_fileA

Scan an AI configuration/rules file for prompt injection and Rules File Backdoor attacks

Inputs: file_path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: scan_file vs scan_directory differ by scope, ai_analyze uses ML, check_dependencies focuses on dependencies, and scan_rules_file is for configuration files. No ambiguity.

    Naming Consistency4/5

    Tools mostly follow verb_noun snake_case pattern (e.g., scan_file, check_dependencies). The outlier is ai_analyze, which uses a prefix instead of a verb-noun structure, but it's still clear and consistent overall.

    Tool Count5/5

    With 6 tools covering scanning, AI analysis, dependency checks, and explanations, the count is well-scoped for a focused security analysis server. Not too many or too few.

    Completeness4/5

    The tools cover core scanning and analysis tasks well, including file/directory scanning, dependency risks, AI-based analysis, and explanations. A minor gap is the lack of a tool for aggregated reporting or finding management, but the surface is largely complete for detection and explanation.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Security MCP server with 300+ rules for AI-generated code. Scans Next.js, Supabase, Clerk, Stripe, Prisma, Hono, GraphQL and 20+ modules. Zero config, runs locally.
      39
      2,686 npm
      6
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      MCP security server for AI coding agents. 12 tools: pre-install guardian, vulnerability audit, supply-chain attack detection via static code analysis, and CycloneDX 1.6 SBOM generation. Zero runtime dependencies.
      15
      81 npm
      15
      Apache 2.0