Argus 是一款强大的模型上下文协议(MCP)工具,它能够对代码仓库进行分析,执行安全性扫描,并评估多种编程语言的代码质量,为开发者提供全面的代码审查和安全保障。
Argus 是一个功能强大的工具,可用于分析代码仓库、执行安全性扫描以及评估多种编程语言的代码质量。下面为你介绍其快速上手的步骤。
brew install libmagic
sudo apt-get update
sudo apt-get install -y libmagic1
uvx argus
# 分析仓库结构
analyze_repository_structure(
repo_url="https://gitlab.com/user/repo",
gitlab_credentials={"api_key": "your-token"}, # 可选
branch="main" # 可选
)
# 执行代码质量分析
analyze_code_quality(
repo_url="https://gitlab.com/user/repo",
language="python" # 可选,未指定时自动检测
)
# 安全扫描
security_scan_repository(
repo_url="https://gitlab.com/user/repo",
scan_type="trivy"
)
# 比较更改
compare_git_changes(
repo_url="https://gitlab.com/user/repo",
source="feature-branch",
target="main"
)
# 安全扫描仓库
security_scan_repository(
repo_url="https://gitlab.com/user/repo",
scan_type="trivy"
)
{
"command": "uvx",
"args": [
"--from",
"git+https://github.com/athapong/argus",
"argus"
],
"alwaysAllow": [
"get_commit_history",
"enumerate_branches",
"compare_git_changes",
"analyze_code_quality",
"security_scan_repository"
],
"timeout": 300
}
语言 | 工具 | 安装方法 |
---|---|---|
Go | gocyclo, golangci-lint | go install github.com/fzipp/gocyclo/cmd/gocyclo@latest |
Java | PMD | macOS: brew install pmd ,Linux: 自动安装 |
Python | Pylint, Bandit | 通过依赖项自动安装 |
JavaScript | ESLint | npm install -g eslint |
SKIP_SYSTEM_CHECK
:设置为任意值以跳过系统依赖检查。PATH
:自动更新工具安装路径。该工具提供详细的错误消息和优雅的回退机制:
本项目采用 MIT License。