基于Python + Go的人工智能代码安全审计系统,支持MCP(模型上下文协议)集成。它提供索引构建、调用链分析、污点追踪、规则驱动扫描、带有PoC提示的AI解释以及OSV漏洞检索。
backend/核心分析和服务接口cmd/server``internal``proto)mcp/MCP服务器和工具入口python -m code_audit_mcp.server)frontend/React前端(生产构建复制到release/frontend)proto/protobuf定义和代码生成(Go/Python)rules/YAML规则库scripts/:check-clean-state.ps1``build-release.ps1release/外部发布目录server.exe``frontend/``rules/common/)Python 3.11+``Go 1.24+前端需要Node.js 18+)cd mcp
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e .
localhost:50051HTTP localhost:8080)cd backend
go mod download
go run ./cmd/server
# 或构建后运行:
# go build -o server.exe ./cmd/server
# .\server.exe -http-port 8080 -port 50051
cd frontend
npm install
npm start # 访问 http://localhost:3000
powershell -ExecutionPolicy Bypass -File scripts\build-release.ps1
release/server.exe``release/frontend/``release/rules/common/release/README-release.mdpowershell -ExecutionPolicy Bypass -File scripts\check-clean-state.ps1 -VerboseOutput
在mcpServers中添加以下段落:
{
"mcpServers": {
"code-audit-mcp": {
"command": "python",
"args": ["-m", "code_audit_mcp.server"]
}
}
}
backend/抽象语法树/索引/调用链/污点/扫描(gRPC+HTTP)mcp/MCP服务器和工具frontend/React前端(可选)proto/Proto定义和语言工件rules/常见漏洞规则release/外部发布目录localhost:50051-http-port启动并打开localhost:8080$Env:PORT=3001; npm startMIT许可证