MCP Character Tools
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Character Tools count how many r's are in strawberry"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Character Tools
The last thing you need for your LLM to work with individual characters or count the number of r's in a word. This is an MCP server providing 14+ comprehensive (and pretty) character and text analysis tools to help LLMs work with individual characters - something they struggle with due to tokenization.
See the Difference
Without MCP (Wrong) | With MCP (Correct) |
Claims there are 2 r's in "garlic" | Correctly identifies 1 r in "garlic" |
Related MCP server: text-count-mcp-server
Why This Exists
First of all, why not? Second, 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-toolsVia npm (global install)
npm install -g mcp-character-tools
mcp-character-toolsFrom source
git clone https://github.com/Aaryan-Kapoor/mcp-character-tools
cd mcp-character-tools
npm install
npm run build
npm startUsage with Claude Desktop
Add to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"char-tools": {
"command": "npx",
"args": ["mcp-character-tools"]
}
}
}All Tools Reference
See sample_outputs.md for complete examples with inputs and outputs for all 14+ tools.
Tool | Description |
| Count a specific letter |
| Count multiple letters at once |
| Count substring occurrences |
| Get frequency distribution |
| Break into characters |
| Get character at index |
| Get nth character (1-based) |
| Get exact length |
| Reverse text, detect palindromes |
| Compare two texts |
| Word-by-word breakdown |
| Count across multiple words |
| List commonly miscounted words |
| 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 devTesting
The project includes comprehensive tests for all tools:
npm testTest files:
tests/counting.test.ts- Counting tools teststests/spelling.test.ts- Spelling tools teststests/analysis.test.ts- Analysis tools teststests/tricky-words.test.ts- Tricky words resource teststests/visualization.test.ts- Visualization utility tests
License
MIT
Available Tools
14 toolsanalyze_sentenceAnalyze SentenceARead-onlyIdempotent
Analyze a sentence word-by-word for a specific letter.
Shows exactly how many times a letter appears in each word.
Args:
text (string): The sentence to analyze
letter (string): The letter to count
case_sensitive (boolean): Match case exactly (default: false)
Returns: Per-word breakdown with counts and positions.
Example: analyze_sentence("The strawberry was very ripe", "r") → per-word counts
Inputs: text (required), letter (required), case_sensitive.
batch_countBatch CountARead-onlyIdempotent
Count a letter across multiple words at once.
Efficiently process a list of words.
Args:
words (string[]): Array of words to analyze
letter (string): The letter to count
case_sensitive (boolean): Match case exactly (default: false)
Returns: Results for each word, totals, sorted by count.
Example: batch_count(["strawberry", "raspberry", "blueberry"], "r") → individual and total counts
Inputs: words (required), letter (required), case_sensitive.
char_atCharacter At IndexARead-onlyIdempotent
Get the character at a specific index (0-based). Supports negative indices.
Args:
text (string): The text to index into
index (number): Position (0-based, negative counts from end)
Returns: The character at that position, or error if out of bounds.
Example: char_at("hello", 1) → 'e'; char_at("hello", -1) → 'o'
Inputs: text (required), index (required).
check_tricky_wordCheck Tricky WordARead-onlyIdempotent
Look up a specific word to see if it's a commonly miscounted word.
Args:
word (string): The word to check
Returns: Information about common mistakes if it's a tricky word, or empty if not.
Example: check_tricky_word("strawberry") → explains the 3 r's and common mistake of counting 2
Inputs: word (required).
compare_textsCompare TextsARead-onlyIdempotent
Compare letter frequencies between two texts.
Useful for analyzing similarity or differences.
Args:
text1 (string): First text
text2 (string): Second text
case_sensitive (boolean): Distinguish case (default: false)
Returns: Common characters, unique to each, frequency comparison, similarity score.
Example: compare_texts("hello", "world") → common: ['l', 'o'], unique_to_text1: ['h', 'e'], etc.
Inputs: text1 (required), text2 (required), case_sensitive.
count_letterCount LetterARead-onlyIdempotent
Count occurrences of a specific letter in text.
Returns the count, positions, a visual breakdown showing where each letter appears, and a density percentage.
Args:
text (string): The text to analyze
letter (string): The single letter to count
case_sensitive (boolean): Whether to match case exactly (default: false)
Returns: count, positions array, visual breakdown, and density summary.
Example: count_letter("strawberry", "r") → count: 3, positions: [2, 5, 8]
Inputs: text (required), letter (required), case_sensitive.
count_lettersCount Multiple LettersARead-onlyIdempotent
Count occurrences of multiple letters at once.
Efficiently counts several letters in a single call.
Args:
text (string): The text to analyze
letters (string[]): Array of letters to count
case_sensitive (boolean): Match case exactly (default: false)
Returns: Results for each letter with counts and positions.
Example: count_letters("strawberry", ["r", "s", "e"]) → r: 3, s: 1, e: 1
Inputs: text (required), letters (required), case_sensitive.
count_substringCount SubstringARead-onlyIdempotent
Count occurrences of a substring or pattern in text.
Can count overlapping or non-overlapping matches.
Args:
text (string): The text to search in
substring (string): The pattern to find
case_sensitive (boolean): Match case exactly (default: false)
overlapping (boolean): Count overlapping matches (default: false)
Returns: count and positions of each match.
Example: count_substring("banana", "ana", overlapping=true) → count: 2, positions: [1, 3]
Inputs: text (required), substring (required), overlapping, case_sensitive.
get_tricky_wordsGet Tricky WordsARead-onlyIdempotent
Get a list of words that are commonly miscounted by LLMs.
These are words with double letters, repeated patterns, or other features that cause counting errors.
Returns: List of tricky words with correct counts and explanations.
Example: Returns "strawberry" with explanation that it has 3 r's, not 2.
Inputs: no named parameters.
letter_frequencyLetter FrequencyARead-onlyIdempotent
Get frequency distribution of all characters in text.
Provides a complete breakdown of character frequencies.
Args:
text (string): The text to analyze
case_sensitive (boolean): Distinguish upper/lowercase (default: false)
include_spaces (boolean): Include spaces in count (default: false)
include_punctuation (boolean): Include punctuation (default: false)
letters_only (boolean): Only count a-z letters (default: true)
Returns: Frequency map, sorted list, most/least common characters.
Example: letter_frequency("hello") → h: 1, e: 1, l: 2, o: 1
Inputs: text (required), letters_only, case_sensitive, include_spaces, +1 more.
nth_characterNth CharacterARead-onlyIdempotent
Get the nth character (1-based, human-friendly numbering).
"What's the 3rd letter?" uses position=3.
Args:
text (string): The text to examine
position (number): Which character (1 = first, 2 = second, etc.)
from_end (boolean): Count from end instead (default: false)
Returns: The character and a human-readable description.
Example: nth_character("hello", 2) → 'e' (the 2nd character)
Inputs: text (required), position (required), from_end.
reverse_textReverse TextARead-onlyIdempotent
Reverse text character-by-character or word-by-word.
Also detects if the text is a palindrome.
Args:
text (string): The text to reverse
reverse_words_only (boolean): Reverse word order only, not characters (default: false)
Returns: Reversed text, palindrome detection.
Example: reverse_text("hello") → "olleh"; reverse_text("racecar") → "racecar" (palindrome!)
Inputs: text (required), reverse_words_only.
spell_wordSpell WordARead-onlyIdempotent
Break text into individual characters with optional indices.
Perfect for verifying character-by-character content.
Args:
text (string): The text to spell out
include_indices (boolean): Include position numbers (default: true)
Returns: Array of characters, indexed list, spelled out string.
Example: spell_word("cat") → ['c', 'a', 't'] with indices [0:'c', 1:'a', 2:'t']
Inputs: text (required), include_indices.
word_lengthWord LengthARead-onlyIdempotent
Get the exact length of text with detailed breakdown.
Args:
text (string): The text to measure
count_spaces (boolean): Include spaces in length (default: true)
Returns: Total length, length without spaces, space count, word count.
Example: word_length("hello world") → 11 total, 10 without spaces, 2 words
Inputs: text (required), count_spaces.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Most tools have distinct purposes, but char_at (0-based) and nth_character (1-based) could cause confusion, as could check_tricky_word vs get_tricky_words. Otherwise, tools like count_letter, count_letters, and count_substring are clearly differentiated.
Tool names follow a verb_noun pattern but vary in detail (e.g., 'char_at' is abbreviated, 'nth_character' is more descriptive, 'letter_frequency' is noun_noun). Inconsistent use of 'count_letter' vs 'count_letters' and 'get_tricky_words' vs 'check_tricky_word' adds to the mixed style.
14 tools is well-scoped for a character analysis server. Each tool serves a specific purpose (counting, indexing, frequency, tricky words, reversing, etc.) without being redundant or too many.
The set covers core character operations like counting, indexing, frequency, and substring analysis. Minor gaps exist (e.g., no case conversion or word-level tokenization beyond length), but the domain is well-served for typical letter-counting tasks.
Maintenance
Related MCP Connectors
Token counting, RAG chunking, truncation, HTML to Markdown and JSON repair
Exact text tools for AI agents: unified diff, patch apply, regex testing, grapheme counting.
Count occurrences of any character in your text instantly. Specify the character and get precise c…
33 tools: LLM chat, summaries, translation, embeddings, speech, images. From $0.002.
Related MCP Servers
- AlicenseAqualityFmaintenancePrecise character-level string indexing for LLMs. Provides tools for finding, extracting, and manipulating text by exact character position to solve position-based operations.123MIT
- AlicenseNot gradedqualityDmaintenanceProvides tools for AI models to count characters and words in text, supporting English and other space-delimited languages.1MIT
- FlicenseNot gradedqualityCmaintenanceAccurately counts characters, bytes, and manuscript paper based on Unicode grapheme clusters, and provides deterministic feedback to help AI meet exact length limits for self-introductions or school records.-
- AlicenseAqualityDmaintenanceProvides AI agents with local file-processing capabilities for token counting, RAG chunking, CSV/JSON conversion, QR generation, and more, while keeping documents private on the user's machine.71MIT