Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-wordcounter

MCP.Pizza Chef: qpd-v

The mcp-wordcounter is a Model Context Protocol server designed to provide efficient text analysis capabilities, specifically counting words and characters in documents. It supports counting total characters including spaces, characters excluding spaces, and total words. This server allows LLMs to perform document statistics tasks securely by processing files directly without exposing the full content to the model. It integrates easily as a CLI tool or within environments like Claude Desktop, making it a practical utility for developers needing quick text metrics in AI workflows. Installation is straightforward via npm, and it exposes a simple analyze_text tool that accepts a file path and returns detailed counts.

Use This MCP server To

Count words in text documents for content analysis Measure character counts including and excluding spaces Provide document statistics to LLMs without exposing full text Integrate text metrics into AI workflows and copilots Analyze file-based text data securely and efficiently

README

MCP Word Counter

A Model Context Protocol server that provides tools for analyzing text documents, including counting words and characters. This server helps LLMs perform text analysis tasks by exposing simple document statistics functionality.

Features

  • Count words in documents
  • Count total characters (including spaces)
  • Count characters excluding spaces
  • Process files directly without exposing content to LLMs

Installation

npm install mcp-wordcounter

Usage

As a CLI tool

npx mcp-wordcounter

In Claude Desktop

Add to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "mcp-wordcounter": {
      "command": "npx",
      "args": ["-y", "mcp-wordcounter"],
      "alwaysAllow": ["analyze_text"]
    }
  }
}

Available Tools

analyze_text

Counts words and characters in a text document.

Parameters:

  • filePath (string, required): Path to the text file to analyze

Returns:

  • Word count
  • Character count (including spaces)
  • Character count (excluding spaces)

Example response:

{
  "content": [{
    "type": "text",
    "text": "Analysis Results:\n• Word count: 150\n• Character count (including spaces): 842\n• Character count (excluding spaces): 702"
  }]
}

Development

# Install dependencies
npm install

# Build the project
npm run build

# Run in watch mode during development
npm run watch

# Test with MCP Inspector
npm run inspector

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

mcp-wordcounter FAQ

How do I install the mcp-wordcounter server?
You can install it easily using npm with the command `npm install mcp-wordcounter`.
Can mcp-wordcounter process files without exposing their content to the LLM?
Yes, it processes files directly and only returns word and character counts, keeping the full content private.
How do I use mcp-wordcounter as a CLI tool?
Run it with `npx mcp-wordcounter` to access its text analysis features from the command line.
How can I integrate mcp-wordcounter with Claude Desktop?
Add it to your `claude_desktop_config.json` under `mcpServers` with the appropriate command and args as shown in the documentation.
What text statistics does mcp-wordcounter provide?
It provides counts of words, total characters including spaces, and characters excluding spaces.
Is mcp-wordcounter limited to any specific text file formats?
It works with text files accessible via file paths; no specific format restrictions are mentioned.
Does mcp-wordcounter support real-time text analysis?
It is designed to analyze static text files rather than streaming or real-time text input.
Can mcp-wordcounter be used with multiple LLM providers?
Yes, it is compatible with any LLM environment supporting MCP, including OpenAI, Claude, and Gemini.