Skip to main content
Glama
Text Processor MCP

Text Processor MCP

by maki198906

Text Processor MCP

A text processing toolkit with 9 tools for text analysis, available as:

  • MCP server (server.py) β€” for any MCP client (Claude, VS Code, etc.)

  • Gradio web UI (app.py) β€” browser interface with tabs for each tool

  • Pi plugin (text-processor-plugin/) β€” skills + extension for Pi coding agent

πŸš€ Quick Start

# Install dependencies
uv sync

# Run the MCP server (stdio)
uv run python server.py

# Run the Gradio web UI
uv run python app.py

Related MCP server: text-stats-ai-mcp

πŸ›  Tools

#

Tool

Description

Method

1

Analyze Text

Word/sentence/character statistics

Pure Python

2

Extract Keywords

Most frequent words (with stopword filtering)

Counter

3

Check Reading Level

Flesch-Kincaid grade level estimate

Pure Python

4

Reverse Text

Reverse a string

Pure Python

5

Analyze Sentiment

Polarity (-1 to +1) and subjectivity

TextBlob

6

Detect Language

Identify language of text

langid

7

Summarize Text

Extractive summarization (word frequency scoring)

Pure Python

8

Check Spelling

Find misspelled words + suggest corrections

TextBlob

9

Readability Tips

Suggestions for clearer writing (sentence length, passive voice, repetition)

Pure Python

πŸ§ͺ Examples

All examples use the same input text about English articles.

Input text:

The articles in English are the definite article the and the indefinite article a (which takes the alternate form an when followed by a vowel sound). They are the two most common determiners. The definite article is the default determiner when the speaker believes that the listener knows the identity of a common noun's referent (because it is obvious, because it is common knowledge, or because it was mentioned in the same sentence or an earlier sentence). The indefinite article is the default determiner for other singular, countable, common nouns, while no determiner is the default for other common nouns. Other determiners are used to add semantic information such as amount (many, a few), proximity (this, those), or possession (my, the government's).


1. Analyze Text

Input: analyze_text(text)

Output:

{
  "total_characters": 760,
  "characters_without_spaces": 639,
  "total_words": 122,
  "total_sentences": 5,
  "average_word_length": 5.24,
  "average_sentence_length": 24.4,
  "unique_words": 74
}

2. Extract Keywords

Input: extract_keywords(text, count=8)

Output:

{
  "keywords": [
    {"word": "common", "frequency": 5},
    {"word": "article", "frequency": 4},
    {"word": "default", "frequency": 3},
    {"word": "determiner", "frequency": 3},
    {"word": "other", "frequency": 3},
    {"word": "definite", "frequency": 2},
    {"word": "indefinite", "frequency": 2}
  ]
}

3. Check Reading Level

Input: check_reading_level(text)

Output:

{
  "grade_level": 17.6,
  "reading_level": "College/Academic"
}

4. Reverse Text

Input: reverse_text("Hello World")

Output:

dlroW olleH

5. Analyze Sentiment

Input: analyze_sentiment(text)

Output:

{
  "polarity": -0.034,
  "subjectivity": 0.388,
  "sentiment_label": "Neutral",
  "subjectivity_label": "Objective"
}

Polarity: -1 (negative) to +1 (positive). Subjectivity: 0 (objective) to 1 (subjective).


6. Detect Language

Input: detect_language(text)

Output:

{
  "language_code": "en",
  "language_name": "English",
  "confidence": -1851.642
}

More examples:

Input

Result

"Артикли Π² английском языкС..."

ru (Russian)

"Les articles en anglais..."

fr (French)

"Die Artikel im Englischen..."

de (German)


7. Summarize Text

Input: summarize_text(text, max_sentences=3)

Output:

{
  "summary": "They are the two most common determiners. The indefinite article is the default determiner for other singular, countable, common nouns, while no determiner is the default for other common nouns.",
  "original_sentences": 5,
  "summary_sentences": 2,
  "compression_ratio": "40%"
}

8. Check Spelling

Input: check_spelling("The definte article is the most common determiner in english.")

Output:

{
  "misspelled_count": 2,
  "misspelled_words": [
    {
      "original": "definte",
      "suggestions": ["definite", "define"],
      "best_correction": "definite",
      "confidence": 0.857
    },
    {
      "original": "determiner",
      "suggestions": ["determined", "determine"],
      "best_correction": "determined",
      "confidence": 0.577
    }
  ],
  "corrected_text": "The definite article is the most common determined in english."
}

9. Readability Tips

Input: readability_tips(text)

Output:

{
  "overall_assessment": "Found 3 area(s) for improvement (severity: moderate).",
  "statistics": {
    "sentence_count": 5,
    "word_count": 122,
    "avg_sentence_length": 24.4,
    "avg_word_length": 5.0
  },
  "tips": [
    {
      "issue": "Sentences are slightly long",
      "detail": "Average sentence length is 24.4 words.",
      "suggestion": "Consider shortening some sentences to improve clarity."
    },
    {
      "issue": "Too many long words",
      "detail": "Found 4 words longer than 10 characters.",
      "suggestion": "Use simpler, shorter alternatives for complex terms."
    },
    {
      "issue": "Word repetition",
      "detail": "Some words are overused: \"common\" (5x), \"article\" (4x).",
      "suggestion": "Use synonyms or pronouns to vary your vocabulary."
    }
  ]
}

πŸ“¦ Dependencies

  • mcp[cli] β€” Model Context Protocol framework

  • gradio β€” Web UI framework

  • textblob β€” NLP (sentiment, spelling)

  • langid β€” Language detection (97 languages)

πŸ— Project Structure

text-processor-mcp/
β”œβ”€β”€ .mcp.json                 # MCP client config (stdio)
β”œβ”€β”€ .gitignore                # Git ignore rules
β”œβ”€β”€ server.py                 # MCP server with all 9 tools
β”œβ”€β”€ app.py                    # Gradio web UI (8 tabs)
β”œβ”€β”€ pyproject.toml            # Project config & dependencies
β”œβ”€β”€ uv.lock                   # Locked dependency versions
β”œβ”€β”€ text-processor-plugin/    # Pi package (skills + extension)
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ README.md
β”‚   β”œβ”€β”€ extensions/
β”‚   β”‚   └── text-processor.ts
β”‚   └── skills/
β”‚       β”œβ”€β”€ analyze-text/SKILL.md
β”‚       β”œβ”€β”€ extract-keywords/SKILL.md
β”‚       β”œβ”€β”€ check-reading-level/SKILL.md
β”‚       β”œβ”€β”€ reverse-text/SKILL.md
β”‚       β”œβ”€β”€ analyze-sentiment/SKILL.md
β”‚       β”œβ”€β”€ detect-language/SKILL.md
β”‚       β”œβ”€β”€ summarize-text/SKILL.md
β”‚       β”œβ”€β”€ check-spelling/SKILL.md
β”‚       └── readability-tips/SKILL.md
└── README.md

πŸ”Œ MCP Integration

Two ways to connect: stdio (standalone MCP server) or SSE (via Gradio, which also serves the web UI).

Choose the approach that fits your client.


⚑ Pi (the coding agent)

Pi doesn't support MCP natively. Two options:

Option 1 β€” Use the Pi plugin (recommended):

Install the plugin with skills + extension:

pi install ./text-processor-plugin

Then install the MCP adapter for direct tool access:

pi install npm:pi-mcp-adapter

The project already ships with .mcp.json pre-configured for stdio.

Option 2 β€” Global config via ~/.config/pi/config.json:

{
  "mcpServers": {
    "text-processor": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/text-processor-mcp", "python", "server.py"]
    }
  }
}

πŸ–₯ Claude Desktop

In claude_desktop_config.json:

{
  "mcpServers": {
    "text-processor": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/text-processor-mcp", "python", "server.py"]
    }
  }
}

πŸ’» VS Code (Cline / Continue / etc.)

These clients read .mcp.json from the project root automatically:

{
  "servers": {
    "text-processor": {
      "type": "stdio",
      "command": "uv",
      "args": ["run", "--directory", "/path/to/text-processor-mcp", "python", "server.py"]
    }
  }
}

Note: Replace /path/to/text-processor-mcp with the absolute path to the project.


πŸ“ Project-level .mcp.json (already included)

The project ships with .mcp.json pre-configured for stdio (standalone MCP server). Edit it to switch to SSE or adjust paths as needed.

πŸ–₯ Web UI

Run uv run python app.py to open the Gradio interface with tabs for each tool. The Gradio app also exposes MCP tools via SSE at http://127.0.0.1:7860/gradio_api/mcp/.

Available Tools

9 tools
analyze_sentimentB

Analyze the sentiment (polarity and subjectivity) of text.

Args: text: The input text to analyze

Returns: JSON string with sentiment analysis results

Inputs: text (required). Returns: result

analyze_textC

Analyze text and return statistics.

Args: text: The input text to analyze

Returns: JSON string with analysis results

Inputs: text (required). Returns: result

check_reading_levelC

Estimate reading difficulty level.

Args: text: The input text

Returns: JSON string with reading level estimate

Inputs: text (required). Returns: result

check_spellingB

Identify misspelled words and suggest corrections.

Args: text: The text to check for spelling errors

Returns: JSON string with misspelled words, corrections, and corrected text

Inputs: text (required). Returns: result

detect_languageA

Detect the language of the input text.

Args: text: The text to identify language for

Returns: JSON string with detected language code and name

Inputs: text (required). Returns: result

extract_keywordsA

Extract keywords (most common words) from text.

Args: text: The input text count: Number of keywords to return (default 5)

Returns: JSON string with keywords and frequencies

Inputs: text (required), count. Returns: result

readability_tipsC

Analyze text and suggest improvements for clarity.

Args: text: The text to analyze

Returns: JSON string with readability issues and suggestions

Inputs: text (required). Returns: result

reverse_textB

Reverse a string.

Args: text: The input text

Returns: The reversed text

Inputs: text (required). Returns: result

summarize_textA

Create a short extractive summary of the text.

Args: text: The text to summarize max_sentences: Maximum number of sentences in the summary (default 3)

Returns: JSON string with summary and metadata

Inputs: text (required), max_sentences. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 9 tools

    Disambiguation4/5

    Most tools have distinct purposes, but analyze_text is generic and could potentially overlap with other tools like check_reading_level or readability_tips. However, descriptions clarify outputs, so confusion is minimal.

    Naming Consistency4/5

    The naming pattern is mostly verb_noun (e.g., extract_keywords, check_spelling), but readability_tips deviates by using a noun phrase instead of a verb. This is a minor inconsistency.

    Tool Count5/5

    With 9 tools, the count is well within the typical 3-15 range and each tool serves a clear text processing function without being excessive.

    Completeness4/5

    The set covers a broad range of text processing tasks including analysis, keywords, sentiment, language detection, summarization, and readability. It lacks some possible features like translation or text generation, but for the stated purpose it is quite comprehensive.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers