code-audit-mcp
Code Audit MCP Server
基于大语言模型(LLM)与模型上下文协议(MCP)的自动化代码审计工具。
功能特性
代码语义解析:AST解析、类型推导、污点标记
调用链追踪:跨文件/跨模块的数据流追踪
漏洞验证:自动生成PoC并执行验证
多语言支持:PHP、Python、Java、JavaScript/TypeScript
Related MCP server: Code Audit MCP Server
快速开始
环境要求
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深入分析
为每个漏洞类型准备专用Prompt
审计前先让AI了解项目结构(入口、路由、数据库)
人工复核AI报告,特别是"高危"发现
保存审计历史,用于Prompt迭代优化
❌ 不要做
不要盲目信任AI报告,误报不可避免
不要在Prompt中描述过于复杂的审计逻辑
不要跳过漏洞验证环节
不要在敏感项目中使用云端API(用本地模型)
不要忽略业务逻辑漏洞(AI对此较弱)
效果预期
漏洞类型 | 召回率 | 准确率 |
注入类漏洞 | 80%+ | 75%+ |
反序列化 | POP链发现能力超过人工 | - |
逻辑漏洞 | 仍需人工审计为主 | - |
整体效率:提升3-5倍(含人工复核时间)
开源协议
MIT License
相关文章
贡献
欢迎提交Issue和PR!
联系方式
GitHub: kkk1259
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered Java source code vulnerability auditing through function-level taint analysis. Performs reverse tracking from dangerous functions to external entry points to automatically discover potential security vulnerability chains.115
- 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.
Related MCP Connectors
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
MCP server for static security analysis of Android source code
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kkk1259/code-audit-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server