π¦
Tool
MCP server: Tool
0 installs
Trust: 39 β Low
Devtools
Installation
npx mcp-server-toolAsk AI about Tool
Powered by Claude Β· Grounded in docs
I know everything about Tool. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Loading tools...
Reviews
Documentation
MCP Server Tool
This is a simple MCP (Model Context Protocol) server built using Flask. It searches for a given keyword in a text file and returns all lines that contain that keyword.
How to Run
-
Install Flask
pip install flask -
Run the server
python server.py
cpp
Copy code
3. Test the endpoint (using Postman or curl):
POST http://127.0.0.1:5000/search
css
Body (JSON):
{
"keyword": "Satyam",
"file_path": "sample.txt"
}
Output Example:
json
Copy code
{
"keyword": "Satyam",
"matches": [
{
"line_number": 3,
"text": "This assignment belongs to Satyam Kumar."
}
]
}
---
### πͺ Steps to Create It in VS Code
1. **Open VS Code** β Click **File β Open Folder** β select a location (like Desktop).
2. **Create Folder:**
- Name it `MCP_Server`
3. **Inside it:**
- Right-click β **New File** β `server.py`
- Right-click β **New File** β `sample.txt`
- (optional) Right-click β **New File** β `README.md`
4. **Copy and paste** the above content into each file.
5. **Open Terminal in VS Code** β type:
pip install flask
6. Then run:
python server.py
Copy code
7. Youβll see:
Running on http://127.0.0.1:5000
