Files-DB-MCP

by randomm
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Uses Docker volumes for persistent model caching and deployment of the vector search service

  • Monitors Git-managed projects for file changes and provides real-time search updates as code evolves

  • Supports installation and deployment from GitHub repositories, with direct integration for source code access

Files-DB-MCP:代码项目的向量搜索

本地向量数据库系统,通过消息控制协议(MCP)为LLM编码代理提供快速、高效的软件项目搜索功能。

特征

  • 零配置- 使用合理的默认值自动检测项目结构
  • 实时监控——持续监视文件变化
  • 向量搜索——用于查找相关代码的语义搜索
  • MCP 接口- 兼容 Claude Code 和其他 LLM 工具
  • 开源模型- 使用 Hugging Face 模型进行代码嵌入

安装

选项 1:克隆和设置(推荐)

# Using SSH (recommended if you have SSH keys set up with GitHub) git clone git@github.com:randomm/files-db-mcp.git ~/.files-db-mcp && bash ~/.files-db-mcp/install/setup.sh # Using HTTPS (if you don't have SSH keys set up) git clone https://github.com/randomm/files-db-mcp.git ~/.files-db-mcp && bash ~/.files-db-mcp/install/setup.sh

选项 2:自动安装脚本

curl -fsSL https://raw.githubusercontent.com/randomm/files-db-mcp/main/install/install.sh | bash

用法

安装后,在任意项目目录运行:

files-db-mcp

该服务将:

  1. 检测你的项目文件
  2. 在后台开始索引
  3. 立即开始响应 MCP 搜索查询

要求

  • Docker
  • Docker Compose

配置

Files-DB-MCP 无需配置即可运行,但您可以使用环境变量对其进行自定义:

  • EMBEDDING_MODEL - 更改嵌入模型(默认值:'jinaai/jina-embeddings-v2-base-code'或项目特定模型)
  • FAST_STARTUP - 设置为“true”以使用较小的模型实现更快的启动(默认值:“false”)
  • QUANTIZATION - 启用/禁用量化(默认值:'true')
  • BINARY_EMBEDDINGS - 启用/禁用二进制嵌入(默认值:'false')
  • IGNORE_PATTERNS - 要忽略的文件/目录的逗号分隔列表

首次启动

首次运行时,Files-DB-MCP 将下载嵌入模型,这可能需要几分钟,具体取决于:

  • 所选模型的大小(高质量模型为 300-500MB)
  • 您的互联网连接速度

由于模型缓存在持久 Docker 卷中,后续启动速度会更快。为了加快初始启动速度,您可以:

# Use a smaller, faster model (90MB) EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2 files-db-mcp # Or enable fast startup mode FAST_STARTUP=true files-db-mcp

模型缓存

Files-DB-MCP 会自动保存下载的嵌入模型,因此您只需下载一次:

  • 模型存储在名为model_cache的 Docker 卷中
  • 此卷在容器重启和跨不同项目时仍然存在
  • 您的计算机上的所有使用 Files-DB-MCP 的项目共享缓存
  • 您无需为每个项目再次下载模型

克劳德代码集成

添加到您的 Claude 代码配置:

{ "mcpServers": { "files-db-mcp": { "command": "python", "args": ["/path/to/src/claude_mcp_server.py", "--host", "localhost", "--port", "6333"] } } }

有关详细信息,请参阅Claude MCP 集成

文档

存储库结构

  • /src源代码
  • /tests单元和集成测试
  • /docs文档
  • /scripts实用脚本
  • /install安装脚本
  • /.docker配置
  • /config配置文件
  • /ai-assist - AI 辅助文件

执照

MIT 许可证

贡献

欢迎贡献!请随时提交拉取请求。

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

本地向量数据库系统,通过消息控制协议为LLM编码代理提供快速、高效的软件项目语义搜索功能。

  1. Features
    1. Installation
      1. Option 1: Clone and Setup (Recommended)
      2. Option 2: Automated Installation Script
    2. Usage
      1. Requirements
        1. Configuration
          1. First-Time Startup
          2. Model Caching
        2. Claude Code Integration
          1. Documentation
            1. Repository Structure
              1. License
                1. Contributing
                  ID: xedtkxqtfn