Content
[](https://mseep.ai/app/mistizz-mcp-japanesetextanalyzer)
# Japanese Text Analyzer MCP Server
This is an MCP server that can perform morphological analysis of Japanese text. It measures and evaluates the characteristics of sentences from a linguistic perspective, and helps with feedback for sentence generation.
[](https://smithery.ai/server/@Mistizz/mcp-JapaneseTextAnalyzer)
<a href="https://glama.ai/mcp/servers/@Mistizz/mcp-JapaneseTextAnalyzer">
<img width="380" height="200" src="https://glama.ai/mcp/servers/@Mistizz/mcp-JapaneseTextAnalyzer/badge" alt="Japanese Text Analyzer MCP server" />
</a>
## 機能
- Counts the number of characters in Japanese text (the actual number of characters excluding spaces and line breaks)
- Counts the number of words in Japanese text
- Analyzes detailed linguistic features of Japanese text (average sentence length, part-of-speech ratio, vocabulary diversity, etc.)
- Supports both file path and direct text input
- Flexible file path resolution (absolute path, relative path, or file name only can be searched)
## Tool List
Currently, the following tools are implemented:
### count_chars
Measures the number of characters in a file. Specify the absolute path (either Windows format C:\Users\... or WSL/Linux format /c/Users/...). Counts the actual number of characters excluding spaces and line breaks.
**Input:**
- `filePath` (string): Path to the file to count characters (recommended to use absolute path in Windows or WSL/Linux format)
**Output:**
- Number of characters in the file (actual number of characters excluding spaces and line breaks)
### count_words
Measures the number of words in a file. Specify the absolute path (either Windows format C:\Users\... or WSL/Linux format /c/Users/...). Counts words separated by spaces in English, and uses morphological analysis in Japanese.
**Input:**
- `filePath` (string): Path to the file to count words (recommended to use absolute path in Windows or WSL/Linux format)
- `language` (string, optional, default: "en"): Language of the file (en: English, ja: Japanese)
**Output:**
- Number of words in the file
- In Japanese mode, detailed results of morphological analysis are also displayed
### count_clipboard_chars
Measures the number of characters in the text. Counts the actual number of characters excluding spaces and line breaks.
**Input:**
- `text` (string): Text to count characters
**Output:**
- Number of characters in the text (actual number of characters excluding spaces and line breaks)
### count_clipboard_words
Measures the number of words in the text. Counts words separated by spaces in English, and uses morphological analysis in Japanese.
**Input:**
- `text` (string): Text to count words
- `language` (string, optional, default: "en"): Language of the text (en: English, ja: Japanese)
**Output:**
- Number of words in the text
- In Japanese mode, detailed results of morphological analysis are also displayed
### analyze_text
Performs detailed morphological analysis and linguistic feature analysis of the text. Analyzes sentence complexity, part-of-speech ratio, vocabulary diversity, etc.
**Input:**
- `text` (string): Text to analyze
**Output:**
- Basic information of the text (total number of characters, number of sentences, total number of morphemes)
- Detailed analysis results (average sentence length, part-of-speech ratio, character type ratio, vocabulary diversity, etc.)
### analyze_file
Performs detailed morphological analysis and linguistic feature analysis of the file. Analyzes sentence complexity, part-of-speech ratio, vocabulary diversity, etc.
**Input:**
- `filePath` (string): Path to the file to analyze (recommended to use absolute path in Windows or WSL/Linux format)
**Output:**
- Basic information of the file (total number of characters, number of sentences, total number of morphemes)
- Detailed analysis results (average sentence length, part-of-speech ratio, character type ratio, vocabulary diversity, etc.)
## Usage
### Installing via Smithery
To install Japanese Text Analyzer for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@Mistizz/mcp-JapaneseTextAnalyzer):
```bash
npx -y @smithery/cli install @Mistizz/mcp-JapaneseTextAnalyzer --client claude
```
### Running with npx
This package can be executed directly from the GitHub repository with npx:
```bash
npx -y github:Mistizz/mcp-JapaneseTextAnalyzer
```
### Usage with Claude for Desktop
Add the following to the configuration file of Claude for Desktop:
**Windows:**
`%AppData%\Claude\claude_desktop_config.json`
**macOS:**
`~/Library/Application Support/Claude/claude_desktop_config.json`
```json
{
"mcpServers": {
"JapaneseTextAnalyzer": {
"command": "npx",
"args": [
"-y",
"github:Mistizz/mcp-JapaneseTextAnalyzer"
]
}
}
}
```
### Usage with Cursor
Add the same settings to the `mcp.json` file in the `.cursor` folder in Cursor.
**Windows:**
`%USERPROFILE%\.cursor\mcp.json`
**macOS/Linux:**
`~/.cursor/mcp.json`
General settings (works in most environments):
```json
{
"mcpServers": {
"JapaneseTextAnalyzer": {
"command": "npx",
"args": [
"-y",
"github:Mistizz/mcp-JapaneseTextAnalyzer"
]
}
}
}
```
If the above does not work in the Windows environment, try the following:
```json
{
"mcpServers": {
"JapaneseTextAnalyzer": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"github:Mistizz/mcp-JapaneseTextAnalyzer"
]
}
}
}
```
## Examples
### Count the number of characters in direct text
```
Count the number of characters in this text.
```
### Count the number of words in a file in Japanese mode
```
Count the number of words in C:\path\to\your\file.txt in Japanese mode.
```
### Count the number of words with a WSL/Linux format path
```
Count the number of words in /c/Users/username/Documents/file.txt in Japanese mode.
```
### Count the number of words with just the file name
```
Count the number of words in README.md in English mode.
```
### Paste text and count the number of Japanese words
```
Count the number of Japanese words in the following text:
吾輩は猫である。名前はまだ無い。どこで生れたかとんと見当がつかぬ。何でも薄暗いじめじめした所でニャーニャー泣いていた事だけは記憶している。
```
### Analyze detailed linguistic features of text
```
Analyze the following text in detail:
私は昨日、新しい本を買いました。とても面白そうな小説で、友人からの評判も良かったです。今週末にゆっくり読む予定です。
```
### Analyze detailed linguistic features of a file
```
Analyze C:\path\to\your\file.txt in detail.
```
## File Path Resolution Function
This tool flexibly explores files when a file path is specified:
1. If an absolute path is specified, it is used as is
- Automatically detects and converts both Windows-style absolute paths (e.g., `C:\Users\username\Documents\file.txt`)
- WSL/Linux-style absolute paths (e.g., `/c/Users/username/Documents/file.txt`)
2. Resolves relative paths based on the current directory (working directory)
3. Searches based on the home directory (`%USERPROFILE%` or `$HOME`)
4. Searches based on the desktop directory
5. Searches based on the documents directory
This allows you to simply specify a file name like "README.md" and it will automatically search in several common directories, and if the file is found, it will use it. Also, paths obtained from WSL environments or Git Bash ( `/c/Users/...` format) can be used as is in the Windows environment.
## About Internal Operation
This tool uses the morphological analysis library "kuromoji.js" to count the number of Japanese words. Morphological analysis is a basic process in natural language processing that divides sentences into the smallest units of meaning (morphemes).
Morphological analysis processing may take some time to initialize. In particular, it may take some time to load the dictionary data during the first execution. By initializing the morphological analyzer when the server starts, delays during tool execution are minimized.
### About Linguistic Feature Analysis
The "analyze_text" and "analyze_file" tools calculate various linguistic features of the text based on the results of morphological analysis. These include the following indicators:
- **Average sentence length**: The average number of characters per sentence. The larger this value, the more difficult the sentence may be to read.
- **Number of morphemes per sentence**: The average number of morphemes per sentence. Represents the density and syntactic complexity of the sentence.
- **Part-of-speech ratio**: Indicates the proportion of parts of speech such as nouns, verbs, and adjectives used in the text.
- **Particle ratio**: Indicates how often specific particles are used, and analyzes the structure and flow of the sentence.
- **Character type ratio**: Shows the composition ratio of hiragana, katakana, kanji, and alphanumeric characters.
- **Vocabulary diversity**: Shows the ratio of the number of different words to the total number of words (type/token ratio) and measures the richness of the vocabulary.
- **Katakana word ratio**: Indicates the frequency of use of katakana words, reflecting the number of loanwords and technical terms, and the casualness of the style.
- **Honorific frequency**: Indicates the frequency of use of honorific expressions and measures the politeness and formality of the text.
- **Average number of punctuation marks**: Indicates the average number of punctuation marks per sentence and provides an indicator of sentence breaks and readability.
By combining these indicators, it is possible to analyze the characteristics of the text from multiple perspectives and evaluate the style, readability, and expertise.
## License
This MCP server is provided under the MIT License. This means that you are free to use, modify, and distribute the software in accordance with the terms of the MIT License. See the LICENSE file in the project repository for details.
Connection Info
You Might Also Like
markitdown
Python tool for converting files and office documents to Markdown.
Fetch
Retrieve and process content from web pages by converting HTML into markdown format.
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)
continue
Continue is an open-source project for seamless server management.
semantic-kernel
Build and deploy intelligent AI agents with Semantic Kernel's orchestration...