What is Markdown Word Counter MCP?
Markdown Word Counter MCP is a Model Context Protocol server that provides word counting for Markdown files. It accurately counts both Chinese characters and English words, with optional processing to strip Markdown syntax, HTML tags, and link markup. It is intended for developers using MCP-compatible clients who need word count statistics from Markdown documents while controlling what content is included or excluded.
How to use Markdown Word Counter MCP?
Install dependencies with npm install, then build with npm run build. Configure your MCP client to point at the built build/index.js file using the node command. The server exposes two tools: count_words (returns total word count) and detailed_word_count (returns breakdown with processing info). Both accept a file_path (required) and optional boolean flags to control processing (e.g., remove_html_tags, process_markdown_links, remove_markdown_headers, remove_markdown_lists, normalize_whitespace). You can also run the server directly with npm start.
Key features of Markdown Word Counter MCP
- Accurately counts both Chinese characters and English words
- Minimal processing by default (only whitespace normalization)
- Configurable options for removing Markdown syntax, HTML, and link URLs
- Provides two tools: basic count and detailed statistics
- All processing flags default to off except whitespace normalization
Use cases of Markdown Word Counter MCP
- Get a clean word count from a Markdown file while preserving all syntax
- Obtain a word count that excludes Markdown headers, list markers, and link URLs
- Count words in bilingual Markdown documents mixing Chinese and English
- Integrate word count checks into a documentation workflow via MCP
评论