resselai-mcp-server

ThanishaDewangan/resselai-mcp-server

3.2

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.

Tools
1
Resources
0
Prompts
0

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

  1. Clone this repository:
git clone <your-repo-url>
cd resselai
  1. Install dependencies:
npm install
  1. 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

  1. Run MCP Inspector:

    npx @modelcontextprotocol/inspector
    

    This will start the MCP Inspector and open it in your default web browser automatically.

  2. 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)
  3. Connect:

    • Click the "▷ Connect" button
    • Wait for connection to establish
    • You should see the search_file tool appear in the interface
  4. Test the tool:

    • Select the search_file tool
    • Enter test parameters:
      • filepath: test-sample.txt
      • keyword: search
    • Click "Call Tool" or submit
    • View the results with line numbers and context

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 for
  • contextLines (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

  1. Build the project (if not already done):

    npm run build
    
  2. Run MCP Inspector:

    npx @modelcontextprotocol/inspector
    

    This will automatically open the Inspector in your browser.

  3. Configure connection:

    • Transport Type: STDIO
    • Command: node
    • Arguments: dist/index.js
    • Click "▷ Connect"
  4. Test the search_file tool:

    • Select search_file tool
    • Enter:
      • filepath: test-sample.txt
      • keyword: search
    • View results with line numbers and context

Troubleshooting

Connection Error:

  • Verify dist/index.js exists (run npm run build)
  • Check Command is exactly node (not mcp-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