β 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
βοΈ 1. Setup Instructions
β Step 1: Clone or Create Project Folder
β Step 2: Create and Activate Virtual Environment (Optional but Recommended)
β Step 3: Install Dependencies
π 2. Run the MCP Server
If successful, you will see:
Visit in browser:
Or API docs (auto-generated):
π 3. Search Keyword in a File (API Usage)
β
Request Format (POST /search)
β
Example using curl:
β Example Response:
π 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.)