Zaidkhalid44/mcp-search-server
If you are the rightful owner of mcp-search-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 document provides a structured overview of a simple MCP Keyword Search Server built using the fastmcp library.
MCP Keyword Search Server
This is a simple MCP (Model Context Protocol) server built in Python using the fastmcp library.
The server provides a single tool, search_file_for_keyword, which allows an AI agent to search for a keyword within a specified text file on the server.
Features
- MCP Server: A
fastmcpserver that listens for tool requests. - File Search Tool: A tool named
search_file_for_keywordthat takes akeywordandfilenameas input. - Output: Returns all lines from the file that contain the keyword, complete with line numbers.
How to Run
-
Clone the repository:
-
Create and activate a virtual environment:
python -m venv venv .\venv\Scripts\activate -
Install the requirements:
pip install -r requirements.txt -
Run the MCP Inspector to test: This command will start the Inspector and tell it how to run your Python server.
npx @modelcontextprotocol/inspector python server.py -
Test in the Inspector:
- In the browser tab that opens, connect to the
stdioserver. - Go to the Tools tab and select
search_file_for_keyword. - In the Input panel, use:
keyword:"server"filename:"sample_data.txt"
- Click Run.
- In the browser tab that opens, connect to the