Skip to content

Navateja-gupta/MCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🧩 MCP Server – Keyword Search Tool

This project is an MCP (Model Context Protocol) server that provides a simple REST API tool to search for a keyword inside a text file.


πŸš€ Features

  • Search for any keyword in a specified file.
  • Returns matching lines as JSON.
  • Built using Node.js and Express.

πŸ“ Project Structure

mcp-server/
β”œβ”€β”€ index.js        # Main MCP server file
β”œβ”€β”€ package.json    # Node dependencies
β”œβ”€β”€ sample.txt      # Example file for testing
└── README.md       # Project documentation

βš™οΈ Installation

  1. Clone this repository:

git clone https://github.com/Navateja-gupta/MCP.git cd mcp-server


2. Install dependencies:
```bash
npm install
  1. Start the MCP server:
    node index.js
    ``

πŸ”Ή Endpoint:

POST /search_in_file

πŸ”Ή Example Request (PowerShell):

Invoke-WebRequest -Uri "http://localhost:3000/search_in_file" `
  -Method POST `
  -ContentType "application/json" `
  -Body '{"file_path": "C:/path/to/sample.txt", "keyword": "error"}'

πŸ”Ή Example Response:

{"message":"βœ… Found 2 matches",
"matches":["An error occurred in the system.",
"Critical error found in logs."
]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors