Ressl_MCP
MCP (Model Context Protocol) server implementation with a file search tool.
Features
search_in_file: Searches for a specified keyword within a file and returns matching lines with line numbers
Supports case-sensitive and case-insensitive searches
Returns line numbers for easy reference
Handles file path resolution (relative and absolute paths)
MCP Configuration
To use this server with an MCP client, add the following configuration:
MCP Inspector
When using MCP Inspector, configure the server with:
Command:
pythonArgs:
["/absolute/path/to/Ressl_MCP/src/server.py"]
Tool: search_in_file
Parameters
filePath(required): The path to the file to search in (relative or absolute)keyword(required): The keyword or phrase to search forcaseSensitive(optional): Whether the search should be case-sensitive (default: false)
Example Usage
Input:
Output:
Setup
Sample files are provided in the sample/ directory:
sample/test.txt- Simple text file with multiple occurrences of "sample"
Set Up Environment
Test with MCP Inspector
Install Node.js and npm (if not already installed)
Install MCP Inspector:
npm install -g @modelcontextprotocol/inspectorCreate a test configuration file (e.g.,
test-config.json):{ "mcpServers": { "file-search-server": { "command": "python", "args": ["/absolute/path/to/Ressl_MCP/src/server.py"] } } }Replace
/absolute/path/to/Ressl_MCPwith your actual project path.Run MCP Inspector:
mcp-inspector --config test-config.jsonIn MCP Inspector:
Select the
search_in_filetoolUse the following test input:
{ "filePath": "sample/test.txt", "keyword": "sample", "caseSensitive": false }Click "Call Tool" and verify the output shows matching lines with line numbers
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables searching for keywords within files with case-sensitive/insensitive options, returning matching lines with line numbers for easy reference.