KF

kurogoma4d/file-search-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

22 stars 3 forks 质量 35 趋势 10

一个专门用于文件系统内全文搜索的模型上下文协议(MCP)服务器。

概览

一个专门用于文件系统内全文搜索的模型上下文协议(MCP)服务器,使用 Rust 构建。 文件搜索MCP是一款为指定目录中文本文件提供强大的全文搜索功能的工具。它使用Tantivy搜索引擎高效地索引和搜索文本内容。 该项目实现了模型上下文协议(MCP),使其兼容支持该协议的AI助手及其他系统。 - :在目录结构中搜索文本文件中的关键词 - :读取并显示特定文本文件的内容 - :自动识别文本文件并跳过二进制文件 - :支持模型上下文协议的系统支持 - :创建快速、临时的搜索索引用于搜索操作 - :返回带有相关性评分的搜索结果 - : 用于性能、安全性和并发 - : Rust 全文搜索引擎库 - : Rust 实现的模型上下文协议 - : 异步运行时...

概述(AI 翻译)

一个专门用于文件系统内全文搜索的模型上下文协议(MCP)服务器,使用 Rust 构建。

🔍 概述

文件搜索MCP是一款为指定目录中文本文件提供强大的全文搜索功能的工具。它使用Tantivy搜索引擎高效地索引和搜索文本内容。

该项目实现了模型上下文协议(MCP),使其兼容支持该协议的AI助手及其他系统。

✨ 特色

  • 全文搜索:在目录结构中搜索文本文件中的关键词
  • 文件内容阅读器:读取并显示特定文本文件的内容
  • 智能文件检测:自动识别文本文件并跳过二进制文件
  • MCP 集成:支持模型上下文协议的系统支持
  • 内存索引:创建快速、临时的搜索索引
  • 基于分数的结果:返回带有相关性评分的搜索结果

🛠️ 技术栈

  • Rust:用于性能、安全性和并发性
  • Tantivy:Rust 全文搜索引擎库
  • RMCP:模型上下文协议的Rust实现

本页由 AI 翻译,技术细节请以原文为准。

README

File Search MCP

A specialized Model Context Protocol (MCP) server for full-text search within a filesystem, built with Rust.

🔍 Overview

File Search MCP is a tool that provides powerful full-text search capabilities for text files in a specified directory. It uses the Tantivy search engine to index and search through text content efficiently.

This project implements the Model Context Protocol (MCP), making it compatible with AI assistants and other systems that support the protocol.

✨ Features

  • Full-text search: Search for keywords in text files across a directory structure
  • File content reader: Read and display the content of specific text files
  • Smart file detection: Automatically identifies text files and skips binary files
  • MCP integration: Works with systems that support the Model Context Protocol
  • In-memory indexing: Creates fast, temporary indexes for search operations
  • Score-based results: Returns search hits with relevance scores

🛠️ Technology Stack

  • Rust: For performance, safety, and concurrency
  • Tantivy: A full-text search engine library in Rust
  • RMCP: Rust implementation of the Model Context Protocol
  • Tokio: Asynchronous runtime for Rust

📋 Usage

First, install Rust sdk from here.

Clone this repository.

git clone [email protected]:Kurogoma4D/file-search-mcp.git

And add this to your MCP settings (in Cursor, Claude, …).

  • command: /target/release/file-search-mcp

Replace `` to your cloned repository path.

🔄 How It Works

  1. The server indexes text files in the specified directory, excluding binary files
  2. It processes the content of text files and adds them to an in-memory Tantivy index
  3. When a search is performed, it queries the index for matches and ranks them by relevance
  4. Results are returned with file paths and relevance scores
  5. The file content reader tool allows you to view the content of any text file by providing its path

🛠️ Available Tools

Search Tool

  • Description: Search for keywords in text files within a specified directory
  • Parameters:
    • directory: Path to the directory to search
    • keyword: Keyword to search for

File Content Reader Tool

  • Description: Read and display the content of a specific file
  • Parameters:
    • file_path: Path to the file to read

📄 License

MIT License

🙏 Acknowledgements

  • Tantivy for the full-text search engine
  • RMCP for the Model Context Protocol implementation
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →