simple-mcp-server

sohv/simple-mcp-server

3.2

If you are the rightful owner of simple-mcp-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 project provides a Model Context Protocol (MCP) server for keyword searching in files, featuring both an Express HTTP server and an MCP server using stdio transport.

Tools
1
Resources
0
Prompts
0

Simple MCP Server

This project contains a proper MCP (Model Context Protocol) server for keyword searching in files.

Files

  • server.js - Express HTTP server (original implementation)
  • mcp-server.js - MCP server implementation using stdio transport
  • mcp-config.json - Configuration file for MCP clients

MCP Inspector Setup

MCP Inspector is a debugging tool that allows you to test and inspect your MCP server.

Installation

You can run the MCP Inspector using:

npm run inspector

This will start the MCP Inspector with your server, opening a web interface where you can:

  • Test the search_file tool
  • Inspect server capabilities
  • Debug requests and responses
  • Monitor server communication

Using the MCP Server

The MCP server provides a search_file tool that searches for keywords in files.

Tool Parameters:
  • keyword (string, required): The keyword to search for
  • file (string, required): The file path to search in
Example Usage in MCP Inspector:
  1. Run npm run inspector
  2. Open the web interface that appears
  3. Use the search_file tool with parameters like:
    {
      "keyword": "hello",
      "file": "sample.txt"
    }
    

Running the Servers

  • MCP Server: npm run mcp (runs on stdio)
  • MCP Inspector: npm run inspector (opens debugging interface)

Endpoints

  • GET /search — HTTP GET endpoint on the Express server. Query parameters: keyword (string) and file (path). Returns JSON with occurrences and matching lines.
  • POST /mcp — HTTP POST endpoint on the Express server (basic MCP connection/info endpoint used by the original Express implementation).
  • MCP (stdio) tool: search_file — The MCP stdio server (mcp-server.js) exposes a search_file tool which accepts { "keyword": "...", "file": "..." } and returns match details (line numbers and contents).