trackmcp
Back to directory

Assignment

0 stars PythonOthers Updated Nov 2, 2025

Documentation

โœ… MCP Server โ€“ Keyword Search Tool (Case-Insensitive)

This project is a simple MCP (Model Context Protocol) Server built using FastAPI.

It includes a tool that allows users to search for a keyword inside a file (case-insensitive).


๐Ÿ“„ Documentation

You can view the detailed documentation here:

**Assignment Documentation**


๐Ÿ“ Project Structure

code
mcp-server/
โ”œโ”€โ”€ server.py
โ”œโ”€โ”€ tools/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ search_tool.py
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ README.md

โš™๏ธ 1. Setup Instructions

โœ… Step 1: Clone or Create Project Folder

bash
cd mcp-server
bash
python -m venv venv
# Activate it:
# On Windows:
venv\Scripts\activate
# On Linux/Mac:
source venv/bin/activate

โœ… Step 3: Install Dependencies

bash
pip install -r requirements.txt

๐Ÿš€ 2. Run the MCP Server

bash
uvicorn server:app --reload --port 8000

If successful, you will see:

code
Uvicorn running on http://127.0.0.1:8000

Visit in browser:

code
http://127.0.0.1:8000

Or API docs (auto-generated):

code
http://127.0.0.1:8000/docs

๐Ÿ” 3. Search Keyword in a File (API Usage)

โœ… Request Format (POST `/search`)

json
{
  "file_path": "path/to/file.txt",
  "keyword": "example"
}

โœ… Example using `curl`:

bash
curl -X POST "http://127.0.0.1:8000/search" \
-H "Content-Type: application/json" \
-d '{"file_path": "sample.txt", "keyword": "hello"}'

โœ… Example Response:

json
{
  "results": [
    "Line 2: Hello World",
    "Line 5: hElLo again"
  ]
}

๐Ÿ›  4. Code Summary

`server.py`

Defines API endpoint `/search`.


โœ… 5. Features

โœ” FastAPI-powered MCP server

โœ” Case-insensitive keyword search

โœ” Shows line number + text where keyword exists

โœ” Error handling for missing files


๐Ÿ“Œ 6. Future Improvements (Optional)

  • ๐Ÿ”น Search across directories
  • ๐Ÿ”น Regex support
  • ๐Ÿ”น Return JSON with `{line_number, content}` format
  • ๐Ÿ”น File type filtering (.txt, .py, .md, etc.)

Frequently asked questions

What is Ressl_MCP?

Ressl_MCP is Assignment

How do I install Ressl_MCP?

Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

Is Ressl_MCP open source?

Yes โ€” it is hosted on GitHub at https://github.com/chetaniitbhilai/ressl_mcp.

Related MCP tools

Run your own MCP server? See who uses it and what to fix.

Measure it with TrackMCP