Back to MCP directory
publicPublicdnsLocal runtime

argus

Argus是一个多语言代码仓库分析与安全评估工具,支持代码质量检测、安全扫描和Git操作。

article

README

🚀 Argus - 代码仓库分析与安全评估工具

Argus 是一款强大的模型上下文协议(MCP)工具,它能够对代码仓库进行分析,执行安全性扫描,并评估多种编程语言的代码质量,为开发者提供全面的代码审查和安全保障。

🚀 快速开始

Argus 是一个功能强大的工具,可用于分析代码仓库、执行安全性扫描以及评估多种编程语言的代码质量。下面为你介绍其快速上手的步骤。

✨ 主要特性

多语言支持

  • Go:支持 gocyclo、golangci-lint 分析。
  • Java:可进行 PMD 静态分析。
  • Python:能使用 Pylint、Bandit 进行安全检查。
  • JavaScript/TypeScript:支持 ESLint 分析。
  • 具备自动语言检测功能。

安全性扫描

  • 集成 Trivy 漏洞扫描器,可进行全面的漏洞检测。
  • 生成全面的安全性报告,让安全问题一目了然。
  • 支持对多个分支进行扫描。

Git 操作

  • 可进行分支枚举与管理,清晰掌握仓库分支情况。
  • 能分析提交历史,了解代码的演变过程。
  • 支持差异比较,方便查看不同版本间的代码变化。
  • 可将仓库结构可视化,直观呈现仓库的组织架构。

📦 安装指南

依赖项

  • 需要 Python 3.8 及以上版本。
  • 需安装 Git。
  • 系统依赖 libmagic。

系统依赖

macOS

brew install libmagic

Linux (Ubuntu/Debian)

sudo apt-get update
sudo apt-get install -y libmagic1

通过 uv 安装

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"
)

MCP 配置

{
    "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。

🤝 贡献指南

  1. 叉仓库。
  2. 创建功能分支。
  3. 提交更改。
  4. 推送到分支。
  5. 创建新的拉取请求。
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client