A specialized Model Context Protocol (MCP) server for full-text search within a filesystem, built with Rust.
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.
- 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
- 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
First, install Rust sdk from here.
Clone this repository.
git clone git@github.com:Kurogoma4D/file-search-mcp.git
And add this to your MCP settings (in Cursor, Claude, ...).
- command:
<path-to-repo>/target/release/file-search-mcp
Replace <path-to-repo>
to your cloned repository path.
- The server indexes text files in the specified directory, excluding binary files
- It processes the content of text files and adds them to an in-memory Tantivy index
- When a search is performed, it queries the index for matches and ranks them by relevance
- Results are returned with file paths and relevance scores
- The file content reader tool allows you to view the content of any text file by providing its path
- Description: Search for keywords in text files within a specified directory
- Parameters:
directory
: Path to the directory to searchkeyword
: Keyword to search for
- Description: Read and display the content of a specific file
- Parameters:
file_path
: Path to the file to read
MIT License