Satyam0775/mcp-server-tool
3.1
If you are the rightful owner of mcp-server-tool 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 (Model Context Protocol) server built using Flask.
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