ThanishaDewangan/resselai-mcp-server
If you are the rightful owner of resselai-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This project implements a Model Context Protocol (MCP) server with a file keyword search tool.
Ressl Assignment - MCP Server with File Search Tool
This project implements a Model Context Protocol (MCP) server with a file keyword search tool.
Features
- search_file Tool: Searches for a specified keyword within a file and returns:
- Line numbers where matches occur
- Context around each match
- Total match count
Prerequisites
- Node.js (v18 or higher)
- npm or yarn
- TypeScript (installed via npm)
Installation
- Clone this repository:
git clone <your-repo-url>
cd resselai
- Install dependencies:
npm install
- Build the project:
npm run build
Usage
Running the MCP Server
The server runs on stdio (standard input/output) and communicates via JSON-RPC:
npm start
Using with MCP Inspector
-
Run MCP Inspector:
npx @modelcontextprotocol/inspectorThis will start the MCP Inspector and open it in your default web browser automatically.
-
Configure the connection in MCP Inspector:
- Transport Type: Select
STDIO - Command: Enter
node - Arguments (space-separated): Enter
dist/index.js - Make sure you're in the project directory (
C:\Users\musud\resselai)
- Transport Type: Select
-
Connect:
- Click the "▷ Connect" button
- Wait for connection to establish
- You should see the
search_filetool appear in the interface
-
Test the tool:
- Select the
search_filetool - Enter test parameters:
- filepath:
test-sample.txt - keyword:
search
- filepath:
- Click "Call Tool" or submit
- View the results with line numbers and context
- Select the
Note: If using absolute paths, the Arguments would be: C:\Users\musud\resselai\dist\index.js
Tool: search_file
Parameters:
filepath(required): Path to the file to search (relative or absolute)keyword(required): The keyword or phrase to search forcontextLines(optional): Number of context lines around each match (default: 2)
Example Request:
{
"tool": "search_file",
"arguments": {
"filepath": "src/index.ts",
"keyword": "search_file",
"contextLines": 3
}
}
Example Response:
Search Results for keyword "search_file" in file: src/index.ts
Total matches found: 5
--- Match 1 (Line 42) ---
>>> 42: name: "search_file",
40: this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
41: tools: [
42: {
43: name: "search_file",
...
Development
Run the TypeScript compiler in watch mode:
npm run dev
Project Structure
resselai/
├── src/
│ └── index.ts # Main MCP server implementation
├── dist/ # Compiled JavaScript (generated)
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── README.md # This file
└── .gitignore # Git ignore rules
Testing
Quick Test with MCP Inspector
-
Build the project (if not already done):
npm run build -
Run MCP Inspector:
npx @modelcontextprotocol/inspectorThis will automatically open the Inspector in your browser.
-
Configure connection:
- Transport Type:
STDIO - Command:
node - Arguments:
dist/index.js - Click "▷ Connect"
- Transport Type:
-
Test the search_file tool:
- Select
search_filetool - Enter:
- filepath:
test-sample.txt - keyword:
search
- filepath:
- View results with line numbers and context
- Select
Troubleshooting
Connection Error:
- Verify
dist/index.jsexists (runnpm run build) - Check Command is exactly
node(notmcp-server-everything) - Try absolute path:
C:\Users\musud\resselai\dist\index.js
Project Structure
resselai/
├── src/
│ └── index.ts # Main MCP server implementation
├── dist/ # Compiled JavaScript (generated, gitignored)
├── node_modules/ # Dependencies (gitignored)
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── .gitignore # Git ignore rules
├── README.md # This file
├── test-sample.txt # Sample file for testing
└── mcp-config-example.json # Example config for Claude Desktop
License
MIT