mcp-test

ikisusi/mcp-test

3.1

If you are the rightful owner of mcp-test and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Word Counter is a versatile Python CLI application designed to count lines, words, and characters in text files, with support for both direct file analysis and MCP server modes.

Word Counter

A Python CLI application that counts lines, words, and characters in text files. Supports both direct file analysis and MCP server modes with stdin or HTTP transport.

Setup

  1. Create and activate the virtual environment:
python3 -m venv venv
source venv/bin/activate  # On Unix/macOS
# or
.\venv\Scripts\activate  # On Windows
  1. Install dependencies:
pip install -r requirements.txt

Usage

Direct File Analysis

python word_counter.py path/to/file.txt

MCP Server with Stdin Transport

python word_counter.py --mcp-server-stdin

MCP Server with HTTP Transport

python word_counter.py --mcp-server-http --api-key your-secret-key

To make requests to the HTTP server:

curl -X POST \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-secret-key" \
  -d '{"file_path": "path/to/file.txt"}' \
  http://localhost:5000/count

Response Format

The application returns JSON responses in the following format:

Success:

{
  "result": {
    "lines": 10,
    "words": 46,
    "characters": 247
  }
}

Error:

{
  "error": "error message here"
}