npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcp-character-tools

v1.0.0

Published

MCP server providing comprehensive character and text analysis tools for LLMs

Readme

mcp-character-tools

A comprehensive MCP (Model Context Protocol) server providing character and text analysis tools to help LLMs work with individual characters—something they struggle with due to tokenization.

Yes, your agent will be able to tell how many r's are in Strawberry :)

Why This Exists

Large Language Models tokenize text into subwords, not individual characters. For example, "strawberry" might become tokens like ["straw", "berry"], so the model never truly "sees" individual letters. This MCP server gives LLMs "character-level vision" through a suite of tools.

Installation

Via npx (recommended)

npx mcp-character-tools

Via npm (global install)

npm install -g mcp-character-tools
mcp-character-tools

From source

git clone https://github.com/Aaryan-Kapoor/mcp-character-tools
cd mcp-character-tools
npm install
npm run build
npm start

Usage with Claude Desktop

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

{
  "mcpServers": {
    "char-tools": {
      "command": "npx",
      "args": ["mcp-character-tools"]
    }
  }
}

Available Tools

Counting Tools

count_letter

Count occurrences of a specific letter in text.

Input: { "text": "strawberry", "letter": "r" }
Output: { "count": 3, "positions": [2, 5, 8], "visual": "...", "density": "3 out of 10 (30.0%)" }

count_letters

Count multiple letters at once.

Input: { "text": "strawberry", "letters": ["r", "s", "e"] }
Output: { "results": [{ "letter": "r", "count": 3 }, { "letter": "s", "count": 1 }, { "letter": "e", "count": 1 }], "total_matches": 5 }

count_substring

Count occurrences of a substring/pattern.

Input: { "text": "banana", "substring": "ana", "overlapping": true }
Output: { "count": 2, "positions": [1, 3] }

letter_frequency

Get frequency distribution of all characters.

Input: { "text": "mississippi" }
Output: { "frequency": { "i": 4, "s": 4, "p": 2, "m": 1 }, "most_common": [...] }

Spelling Tools

spell_word

Break text into individual characters with optional indices.

Input: { "text": "cat", "include_indices": true }
Output: { "characters": ["c", "a", "t"], "spelled_out": "0:'c', 1:'a', 2:'t'" }

char_at

Get character at a specific index (supports negative indices).

Input: { "text": "hello", "index": -1 }
Output: { "character": "o" }

nth_character

Get the nth character (1-based, human-friendly).

Input: { "text": "hello", "position": 2 }
Output: { "character": "e", "description": "The 2nd character of 'hello' is 'e'." }

word_length

Get exact length with detailed breakdown.

Input: { "text": "hello world" }
Output: { "length": 11, "length_without_spaces": 10, "space_count": 1, "word_count": 2 }

reverse_text

Reverse text and detect palindromes.

Input: { "text": "racecar" }
Output: { "reversed": "racecar", "is_palindrome": true }

Analysis Tools

compare_texts

Compare letter frequencies between two texts.

Input: { "text1": "hello", "text2": "world" }
Output: { "common_characters": ["l", "o"], "unique_to_text1": ["h", "e"], "similarity_score": 25 }

analyze_sentence

Word-by-word breakdown for a specific letter.

Input: { "text": "The strawberry was very ripe", "letter": "r" }
Output: { "words": [{ "word": "The", "letter_count": 0 }, { "word": "strawberry", "letter_count": 3 }, ...], "total_count": 5 }

batch_count

Count a letter across multiple words at once.

Input: { "words": ["strawberry", "raspberry", "blueberry"], "letter": "r" }
Output: { "results": [{ "word": "strawberry", "count": 3 }, ...], "total_count": 6 }

Tricky Words Tools

get_tricky_words

Get list of commonly miscounted words.

Output: List of words like "strawberry", "mississippi", "occurrence" with correct counts and explanations of common mistakes.

check_tricky_word

Check if a word is commonly miscounted.

Input: { "word": "strawberry" }
Output: { "is_tricky": true, "entries": [{ "letter": "r", "count": 3, "common_mistake": 2, "explanation": "..." }] }

All Tools Reference

| Tool | Description | |------|-------------| | count_letter | Count a specific letter | | count_letters | Count multiple letters at once | | count_substring | Count substring occurrences | | letter_frequency | Get frequency distribution | | spell_word | Break into characters | | char_at | Get character at index | | nth_character | Get nth character (1-based) | | word_length | Get exact length | | reverse_text | Reverse text, detect palindromes | | compare_texts | Compare two texts | | analyze_sentence | Word-by-word breakdown | | batch_count | Count across multiple words | | get_tricky_words | List commonly miscounted words | | check_tricky_word | Check if word is tricky |

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Development mode with auto-rebuild
npm run dev

Testing

The project includes comprehensive tests for all tools:

npm test

Test files:

  • tests/counting.test.ts - Counting tools tests
  • tests/spelling.test.ts - Spelling tools tests
  • tests/analysis.test.ts - Analysis tools tests
  • tests/tricky-words.test.ts - Tricky words resource tests
  • tests/visualization.test.ts - Visualization utility tests

License

MIT