code-audit-mcp
Code Audit MCP Server
대규모 언어 모델(LLM)과 모델 컨텍스트 프로토콜(MCP) 기반의 자동화된 코드 감사 도구입니다.
기능 특징
코드 의미론적 분석: AST 파싱, 타입 추론, 오염(taint) 마킹
호출 체인 추적: 파일/모듈 간 데이터 흐름 추적
취약점 검증: PoC 자동 생성 및 검증 실행
다국어 지원: PHP, Python, Java, JavaScript/TypeScript
Related MCP server: deep-code-security
빠른 시작
환경 요구사항
Node.js >= 18.0
TypeScript >= 5.0
Cursor / Windsurf(MCP를 지원하는 IDE)
설치
git clone https://github.com/kkk1259/code-audit-mcp.git
cd code-audit-mcp
npm install
npm run build구성
Cursor에서 MCP Server 구성:
// .cursor/mcp.json
{
"mcpServers": {
"code-audit": {
"command": "node",
"args": ["./dist/server.js"],
"env": {
"PROJECT_ROOT": "/path/to/your/project"
}
}
}
}사용 예시
SQL 인젝션 감사
用户: 请审计这个项目的SQL注入漏洞
AI: 我将使用MCP工具进行系统性审计。
首先,识别所有用户输入源和SQL执行点...역직렬화 취약점 탐지
用户: 检查是否存在反序列化漏洞
AI: 我将分析项目中的unserialize调用,并追踪POP链...도구 목록
도구명 | 기능 | 매개변수 |
| 소스 코드 AST 파싱 |
|
| 함수 호출자 찾기 |
|
| 데이터 흐름 추적 |
|
| 취약점 PoC 생성 |
|
프로젝트 구조
code-audit-mcp/
├── src/
│ ├── server.ts # MCP Server入口
│ ├── tools/
│ │ ├── parser.ts # AST解析
│ │ ├── callgraph.ts # 调用链追踪
│ │ ├── verifier.ts # 漏洞验证
│ │ └── poc.ts # PoC生成
│ ├── rules/
│ │ ├── php.json # PHP安全规则
│ │ ├── python.json # Python安全规则
│ │ └── java.json # Java安全规则
│ └── utils/
│ ├── taint.ts # 污点分析
│ └── sanitizer.ts # 过滤函数识别
├── prompts/
│ ├── audit-system.md # 系统Prompt
│ └── vuln-types/ # 各漏洞类型Prompt
├── tests/
├── package.json
└── README.md모범 사례
✅ 권장 사항
모듈별로 감사하고, 전체 프로젝트를 한 번에 넣지 마세요
먼저 정적 도구로 의심 지점을 찾고, AI로 심층 분석하세요
각 취약점 유형별로 전용 프롬프트를 준비하세요
감사 전에 AI가 프로젝트 구조(진입점, 라우팅, 데이터베이스)를 파악하게 하세요
AI 보고서를 수동으로 재검토하세요, 특히 "고위험" 발견 사항
감사 이력을 저장하여 프롬프트 반복 최적화에 활용하세요
❌ 금지 사항
AI 보고서를 맹목적으로 신뢰하지 마세요, 오탐은 피할 수 없습니다
프롬프트에 지나치게 복잡한 감사 로직을 기술하지 마세요
취약점 검증 단계를 건너뛰지 마세요
민감한 프로젝트에서 클라우드 API를 사용하지 마세요(로컬 모델 사용)
비즈니스 로직 취약점을 무시하지 마세요(AI는 이에 취약합니다)
기대 효과
취약점 유형 | 재현율 | 정확도 |
인젝션 유형 취약점 | 80%+ | 75%+ |
역직렬화 | POP 체인 발견 능력이 수동보다 우수 | - |
로직 취약점 | 여전히 수동 감사가 주를 이룸 | - |
전체 효율: 3~5배 향상(수동 재검토 시간 포함)
오픈소스 라이선스
MIT License
관련 문서
기여
Issue와 PR 제출을 환영합니다!
연락처
GitHub: kkk1259
This server cannot be deployed
Maintenance
Related MCP Connectors
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
MCP security scanner: tool-poisoning & prompt-injection audit (OWASP LLM01/08) + Base data
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Security scanner for AI-written code: SAST, secrets, dependencies, IaC, containers and DAST.
Related MCP Servers
- AlicenseBqualityCmaintenanceAn AI-native code security audit MCP server that supports multi-language AST analysis, call graph analysis, vulnerability detection, and AI deep audit.71MIT
- AlicenseNot gradedqualityDmaintenanceMulti-language SAST and AI-powered fuzzing MCP server for Claude Code integration, enabling static and dynamic security analysis of code.MIT
- FlicenseNot gradedqualityCmaintenanceA high-precision logical vulnerability auditing tool that uses MCP and CodeGraph for automated 0-day discovery and verification in multi-language codebases.-
- FlicenseNot gradedqualityBmaintenanceEnables static AST-based dataflow analysis to trace untrusted sources to sensitive sinks, supporting automated code review and security auditing through MCP.8-