Back to MCP directory
publicPublicdnsLocal runtime

file-find-mcp

一个基于Rust和ripgrep的高性能文件搜索工具,支持MCP协议,提供快速文件内容搜索和读取功能。

article

README

🚀 文件查找 MCP

文件查找 MCP 是一款专为快速文件搜索打造的模型上下文协议(MCP)服务器。它基于 Rust 编写,依托 ripgrep 实现高速搜索,能在文件系统中高效查找所需文件。

🚀 快速开始

文件查找 MCP 可以对指定目录中的文件进行强大的搜索。它借助 ripgrep 实现高效内容搜索,速度极快。同时,该项目实现了模型上下文协议(MCP),可与 AI 助手及其他支持该协议的系统兼容。

✨ 主要特性

  • 高性能搜索:使用 ripgrep 实现超高速目录结构内容搜索
  • 文件内容读取器:可阅读并显示特定文本文件的内容
  • 智能文件识别:自动识别文本文件并跳过二进制文件
  • MCP 集成:与支持模型上下文协议的系统兼容
  • 回退机制:当 ripgrep 命令不可用时,采用纯 Rust 实现作为备用方案

📦 安装指南

先决条件

在使用此工具之前,请确保安装以下内容:

  1. Rust 已安装 - 安装 Rust
  2. ripgrep 已安装 - 在 macOS 上,可以通过 Homebrew 安装:
brew install ripgrep

构建项目

# 克隆仓库
git clone https://github.com/joisun/file-find-mcp
cd file-find-mcp

# 以发布模式构建
cargo build --release

编译后的二进制文件将位于 target/release/file-find-mcp

配置

在您的 MCP 设置中添加以下内容(例如在 Cursor、Claude 或其他支持 MCP 的工具中):

{
  "mcpServers": {
    "file-find-mcp": {
      "command": "/path/to/your/file-find-mcp/target/release/file-find-mcp"
    }
  }
}

/path/to/your/file-find-mcp 替换为您实际克隆仓库的路径。

🛠️ 详细文档

搜索工具

  • 描述:在指定目录中的文本文件中搜索关键字
  • 参数
    • directory:要搜索的目录路径
    • keyword:要搜索的关键字

文件内容读取器工具

  • 描述:读取并显示特定文件的内容
  • 参数
    • file_path:要读取的文件路径

📄 许可证

本项目采用 MIT 许可证。

🙏 致谢

  • ripgrep 感谢其提供的闪电般的搜索性能
  • RMCP 感谢模型上下文协议的实现
  • 该项目是从 file-search-mcp 分叉而来,并进行了修改以使用 ripgrep 以提高搜索效率
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