ā 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.)
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 case-insensitive keyword search within files, returning matching lines with their line numbers through a FastAPI-powered interface.