J

mcp-wordcounter

...
Created 12/15/2024byqpd-v

Language:

JavaScript

Stars:

8

Forks:

2

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.

Last updated: 2/10/2025

Publisher info

qpd-v's avatar

qpdv

qpdv

12
followers
2
following
16
repos

More MCP servers built with JavaScript

mcp-server-semgrep

MCP Server Semgrep is a [Model Context Protocol](https://modelcontextprotocol.io) compliant server that integrates the powerful Semgrep static analysis tool with AI assistants like Anthropic Claude. It enables advanced code analysis, security vulnerability detection, and code quality improvements directly through a conversational interface.

By Szowesgad9
protonmail-mcp

This MCP server provides email sending functionality using Protonmail's SMTP service. It allows both Claude Desktop and Cline VSCode extension to send emails on your behalf using your Protonmail credentials.

By amotivv6
agentql-mcp

Model Context Protocol server that integrates AgentQL's data extraction capabilities.

By tinyfish-io45