npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ai-code-review-mcp

v1.1.3

Published

AI代码审查MCP服务 - 基于DeepSeek和Gitee的智能代码审查工具

Readme

AI 代码审查系统 (MCP 版本)

基于 MCP (Model Context Protocol) 的智能代码审查系统,集成 DeepSeek AI 和 Gitee 平台,为代码审查提供智能化支持。

功能特性

  • 🤖 智能代码审查: 基于 DeepSeek AI 的深度代码分析
  • 🔄 自动化流程: 与 Gitee 平台深度集成,支持 PR 自动审查
  • 🎯 多语言支持: 支持 Python、JavaScript、Java、Go 等主流编程语言
  • 📊 详细报告: 提供代码质量、安全性、性能等多维度分析
  • 🔧 MCP 协议: 基于标准 MCP 协议,易于集成和扩展
  • 📦 便捷部署: 支持 npm 全局安装,一键启动

系统架构

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   MCP Client    │    │   MCP Server    │    │  External APIs  │
│   (Claude等)    │◄──►│  (本系统)       │◄──►│  DeepSeek/Gitee │
└─────────────────┘    └─────────────────┘    └─────────────────┘

快速开始

环境要求

  • Python 3.8+
  • Node.js 16+ (用于 npm 安装)
  • Git

安装部署

方式 1: npm 全局安装 (推荐)

# 全局安装
npm install -g ai-code-review-mcp

# 初始化配置
ai-code-review-mcp --setup

# 启动服务
ai-code-review-mcp

方式 2: 本地开发安装

# 克隆项目
git clone <repository-url>
cd ai-code-review

# 安装依赖
npm install

# 初始化配置
npm run setup

# 启动服务
npm start

环境配置

必需环境变量

# DeepSeek API配置
export DEEPSEEK_API_KEY="your_deepseek_api_key"

# Gitee API配置
export GITEE_ACCESS_TOKEN="your_gitee_access_token"

可选环境变量

# DeepSeek API配置
export DEEPSEEK_BASE_URL="https://api.deepseek.com"  # 默认值
export DEEPSEEK_MODEL="deepseek-coder"               # 默认值

# 日志配置
export LOG_LEVEL="INFO"                              # 默认值
export LOG_FILE="logs/mcp_server.log"               # 默认值

# MCP服务配置
export MCP_SERVER_NAME="ai-code-review"             # 默认值
export MCP_SERVER_VERSION="1.0.0"                   # 默认值

配置文件方式

创建 .env 文件:

# 复制示例配置
cp .env.example .env

# 编辑配置文件
vim .env

或者在用户主目录创建全局配置:

# 创建全局配置文件
touch ~/.ai-code-review-mcp.env

# 添加配置
echo "DEEPSEEK_API_KEY=your_key_here" >> ~/.ai-code-review-mcp.env
echo "GITEE_ACCESS_TOKEN=your_token_here" >> ~/.ai-code-review-mcp.env

使用方式

MCP 客户端配置

在支持 MCP 的客户端(如 Claude Desktop)中配置:

{
  "mcpServers": {
    "ai-code-review": {
      "command": "ai-code-review-mcp",
      "args": []
    }
  }
}

命令行使用

# 显示帮助
ai-code-review-mcp --help

# 显示版本
ai-code-review-mcp --version

# 初始化配置
ai-code-review-mcp --setup

# 启动服务(默认)
ai-code-review-mcp

MCP 工具说明

系统提供以下 MCP 工具:

1. review_code

审查代码片段或文件

参数:

  • code: 要审查的代码内容
  • language: 编程语言 (可选)
  • context: 额外上下文信息 (可选)

2. review_pull_request

审查 Gitee Pull Request

参数:

  • repo_url: 仓库 URL
  • pr_number: PR 编号
  • review_scope: 审查范围 (可选: 'full', 'diff', 'files')

3. get_pr_info

获取 Pull Request 信息

参数:

  • repo_url: 仓库 URL
  • pr_number: PR 编号

4. create_review_comment

创建审查评论

参数:

  • repo_url: 仓库 URL
  • pr_number: PR 编号
  • comment: 评论内容
  • file_path: 文件路径 (可选)
  • line_number: 行号 (可选)

开发指南

项目结构

ai-code-review/
├── bin/                    # 可执行脚本
│   └── ai-code-review-mcp
├── mcp/                    # MCP服务核心
│   ├── __init__.py
│   ├── mcp_server.py      # MCP服务器
│   ├── mcp_adapter.py     # MCP适配器
│   ├── mcp_config.py      # 配置管理
│   └── services/          # 业务服务
│       ├── code_review_service.py
│       ├── deepseek_service.py
│       ├── gitee_service.py
│       └── pr_automation_service.py
├── start_mcp.py           # 启动脚本
├── requirements.txt       # Python依赖
├── package.json          # npm配置
└── README.md

本地开发

# 安装开发依赖
pip install -r requirements.txt

# 运行测试
pytest

# 代码格式化
black .

# 类型检查
mypy .

故障排除

常见问题

  1. 环境变量未设置

    错误: 缺少必要的环境变量: DEEPSEEK_API_KEY

    解决: 设置相应的环境变量或创建 .env 文件

  2. Python 版本不兼容

    错误: 未找到python3命令

    解决: 安装 Python 3.8+

  3. 依赖安装失败

    错误: 无法安装Python依赖

    解决: 检查网络连接,或使用国内镜像源

日志查看

# 查看服务日志
tail -f logs/mcp_server.log

# 查看错误日志
grep ERROR logs/mcp_server.log

贡献指南

  1. Fork 项目
  2. 创建特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交更改 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 打开 Pull Request

许可证

本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情。

支持

如有问题或建议,请:

  1. 查看 FAQ
  2. 提交 Issue
  3. 参与 讨论