DeepView MCP

Integrations

  • References repomix from GitHub for preparing codebases in AI-friendly formats (XML, JSON, or TXT)

  • Uses Gemini's large context window to analyze codebases, requiring a Gemini API key from Google AI Studio

  • Supports loading codebases formatted as XML files, particularly when created with tools like repomix

DeepView MCP

DeepView MCP 是一个模型上下文协议服务器,它使 Cursor 和 Windsurf 等 IDE 能够使用 Gemini 的广泛上下文窗口分析大型代码库。

特征

  • 从单个文本文件加载整个代码库(例如,使用 repomix 等工具创建)
  • 使用 Gemini 的大型上下文窗口查询代码库
  • 连接到支持 MCP 协议的 IDE,例如 Cursor 和 Windsurf
  • 可通过命令行参数配置 Gemini 模型选择

先决条件

安装

使用 pip

pip install deepview-mcp

用法

启动服务器

注意:您无需手动启动服务器。这些参数可以在 IDE 的 MCP 设置中配置(见下文)。

# Basic usage with default settings deepview-mcp [path/to/codebase.txt] # Specify a different Gemini model deepview-mcp [path/to/codebase.txt] --model gemini-2.0-pro # Change log level deepview-mcp [path/to/codebase.txt] --log-level DEBUG

代码库文件参数是可选的。如果未提供,则需要在查询时指定。

命令行选项

  • --model MODEL :指定要使用的 Gemini 模型(默认值:gemini-2.0-flash-lite)
  • --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL} :设置日志级别(默认值:INFO)

与 IDE (Cursor/Windsurf/...) 一起使用

  1. 打开 IDE 设置
  2. 导航至 MCP 配置
  3. 添加一个新的 MCP 服务器,配置如下:
    { "mcpServers": { "deepview": { "command": "/path/to/deepview-mcp", "args": ["/path/to/codebase.txt"], "env": { "GEMINI_API_KEY": "your_gemini_api_key" } } } }
  4. 重新加载 MCP 服务器配置

可用工具

服务器提供了一个工具:

  1. deepview :询问有关代码库的问题
    • 必需参数: question - 有关代码库的问题
    • 可选参数: codebase_file - 查询前要加载的代码库文件的路径

准备代码库

DeepView MCP 需要一个包含您整个代码库的文件。您可以使用repomix以 AI 友好的格式准备您的代码库。

使用 repomix

  1. 基本用法:在项目目录中运行 repomix 以创建默认输出文件:
# Make sure you're using Node.js 18.17.0 or higher npx repomix

这将生成一个包含您的代码库的repomix-output.xml文件。

  1. 自定义配置:创建配置文件来自定义打包的文件和输出格式:
npx repomix --init

这将创建一个repomix.config.json文件,您可以编辑该文件以:

  • 包含/排除特定文件或目录
  • 更改输出格式(XML、JSON、TXT)
  • 设置输出文件名
  • 配置其他打包选项

repomix 配置示例

以下是repomix.config.json文件的示例:

{ "include": [ "**/*.py", "**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx" ], "exclude": [ "node_modules/**", "venv/**", "**/__pycache__/**", "**/test/**" ], "output": { "format": "xml", "filename": "my-codebase.xml" } }

有关 repomix 的更多信息,请访问repomix GitHub 存储库

执照

麻省理工学院

作者

德米特里·杰格蒂亚列夫 ( ddegtyaev@gmail.com )

-
security - not tested
A
license - permissive license
-
quality - not tested

模型上下文协议服务器使 Cursor 和 Windsurf 等 IDE 能够使用 Gemini 的广泛上下文窗口分析大型代码库。

  1. Features
    1. Prerequisites
      1. Installation
        1. Using pip
      2. Usage
        1. Starting the Server
        2. Command-line Options
        3. Using with an IDE (Cursor/Windsurf/...)
        4. Available Tools
      3. Preparing Your Codebase
        1. Using repomix
        2. Example repomix Configuration
      4. License
        1. Author
          ID: doiqobc4w3