MCP Servers/Word Counter & Text Analysis

Word Counter & Text Analysis

utilities

active

Comprehensive text analysis with word counting, reading time estimation, and linguistic metrics through MCP protocol

utilitiesmcputilitiesai-tools

API Access Requires Subscription

While you can view all details here, using this MCP server's API requires a Enterprise subscription. API calls with FREE plan keys will return an access error.

View Pricing Plans

Available Tools

analyze_text_complexity

tool

Analyze text complexity, readability, and linguistic metrics

count_words

tool

Count words, characters, sentences, and paragraphs in text

estimate_reading_time

tool

Estimate reading time for text with customizable reading speeds

get_text_statistics

tool

Get comprehensive text statistics and insights

Documentation

Word Counter & Text Analysis Documentation

Word Counter & Text Analysis MCP Server

Overview

The Word Counter & Text Analysis MCP server provides comprehensive text analysis functionality through the Model Context Protocol (MCP). This server provides comprehensive functionality.

๐Ÿ”ง Exposed Tools

This MCP server exposes 4 tools for AI agents:

1. count_words

Purpose: Count words, characters, sentences, and paragraphs in text

  • Input: text (string), formatting options, detail level
  • Output: Comprehensive word count and character statistics
  • Example: "Hello world!" โ†’ 2 words, 12 characters, 1 sentence

2. estimate_reading_time

Purpose: Estimate reading time for text with customizable reading speeds

  • Input: text (string), readingSpeed (slow|average|fast|speed), custom WPM
  • Output: Reading time estimates for different speeds with detailed breakdown
  • Example: 500 words โ†’ ~2.5 minutes at average speed (200 WPM)

3. analyze_text_complexity

Purpose: Analyze text complexity, readability, and linguistic metrics

  • Input: text (string), readability analysis options
  • Output: Complexity scores, readability grades, linguistic analysis
  • Example: Grade level analysis, sentence complexity, vocabulary assessment

4. get_text_statistics

Purpose: Get comprehensive text statistics and insights

  • Input: text (string), frequency analysis options, top words count
  • Output: Detailed statistics including word frequency, distribution patterns
  • Example: Most common words, character distribution, text patterns

๐Ÿ”— Server Details

  • Category: Utilities / Text Analysis
  • Transport: Server-Sent Events (SSE)
  • Endpoint: /api/mcp/utilities/word-counter/sse
  • Authentication: Required (PRO/ENTERPRISE plans)
  • Wrapped API: /api/utilities/word-counter/v1

๐Ÿ“‹ Prerequisites

  • Subscription: PRO or ENTERPRISE plan
  • API Key: Valid API key with Word Counter access
  • MCP Client: Any MCP-compatible client or AI agent

๐Ÿš€ Quick Start

Connection Setup

Endpoint: https://apistack.online/api/mcp/utilities/word-counter/sse
Method: POST
Headers:
  Content-Type: application/json
  Authorization: Bearer YOUR_API_KEY

Basic MCP Requests

List Available Tools

{
  "jsonrpc": "2.0",
  "id": "list-tools",
  "method": "tools/list"
}

Count Words in Text

{
  "jsonrpc": "2.0",
  "id": "count-1",
  "method": "tools/call",
  "params": {
    "name": "count_words",
    "arguments": {
      "text": "This is a sample text for word counting. It contains multiple sentences and various punctuation marks!",
      "includeSpaces": true,
      "detailed": true
    }
  }
}

Estimate Reading Time

{
  "jsonrpc": "2.0",
  "id": "time-1",
  "method": "tools/call",
  "params": {
    "name": "estimate_reading_time",
    "arguments": {
      "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit...",
      "readingSpeed": "average",
      "customWpm": 250
    }
  }
}

Analyze Text Complexity

{
  "jsonrpc": "2.0",
  "id": "complex-1",
  "method": "tools/call",
  "params": {
    "name": "analyze_text_complexity",
    "arguments": {
      "text": "The quick brown fox jumps over the lazy dog. This sentence contains every letter of the alphabet.",
      "includeReadability": true
    }
  }
}

Get Text Statistics

{
  "jsonrpc": "2.0",
  "id": "stats-1",
  "method": "tools/call",
  "params": {
    "name": "get_text_statistics",
    "arguments": {
      "text": "This is a comprehensive text analysis. The analysis will show word frequency and distribution patterns.",
      "includeFrequency": true,
      "topWords": 15
    }
  }
}

๐Ÿ’ป Implementation Examples

Python Example

import requests
import json
import re

class WordCounterMCPClient:
    def __init__(self, base_url, api_key):
        self.base_url = base_url
        self.headers = {
            "Content-Type": "application/json",
            "Authorization": f"Bearer {api_key}"
        }
        self.endpoint = f"{base_url}/api/mcp/utilities/word-counter/sse"
    
    def count_words(self, text, include_spaces=True, detailed=False):
        request = {
            "jsonrpc": "2.0",
            "id": "count",
            "method": "tools/call",
            "params": {
                "name": "count_words",
                "arguments": {
                    "text": text,
                    "includeSpaces": include_spaces,
                    "detailed": detailed
                }
            }
        }
        
        response = requests.post(self.endpoint, headers=self.headers, json=request)
        result = response.json()
        return result["result"]["content"][0]["text"]
    
    def estimate_reading_time(self, text, reading_speed="average", custom_wpm=None):
        arguments = {
            "text": text,
            "readingSpeed": reading_speed
        }
        
        if custom_wpm:
            arguments["customWpm"] = custom_wpm
        
        request = {
            "jsonrpc": "2.0",
            "id": "reading-time",
            "method": "tools/call",
            "params": {
                "name": "estimate_reading_time",
                "arguments": arguments
            }
        }
        
        response = requests.post(self.endpoint, headers=self.headers, json=request)
        result = response.json()
        return result["result"]["content"][0]["text"]
    
    def analyze_text_complexity(self, text, include_readability=True):
        request = {
            "jsonrpc": "2.0",
            "id": "complexity",
            "method": "tools/call",
            "params": {
                "name": "analyze_text_complexity",
                "arguments": {
                    "text": text,
                    "includeReadability": include_readability
                }
            }
        }
        
        response = requests.post(self.endpoint, headers=self.headers, json=request)
        result = response.json()
        return result["result"]["content"][0]["text"]
    
    def get_text_statistics(self, text, include_frequency=False, top_words=10):
        request = {
            "jsonrpc": "2.0",
            "id": "statistics",
            "method": "tools/call",
            "params": {
                "name": "get_text_statistics",
                "arguments": {
                    "text": text,
                    "includeFrequency": include_frequency,
                    "topWords": top_words
                }
            }
        }
        
        response = requests.post(self.endpoint, headers=self.headers, json=request)
        result = response.json()
        return result["result"]["content"][0]["text"]
    
    def analyze_document(self, text, comprehensive=True):
        """
        Perform comprehensive document analysis using all tools
        """
        results = {}
        
        # Basic word count
        results["word_count"] = self.count_words(text, detailed=True)
        
        # Reading time estimation
        results["reading_time"] = self.estimate_reading_time(text, "average")
        
        if comprehensive:
            # Complexity analysis
            results["complexity"] = self.analyze_text_complexity(text, True)
            
            # Detailed statistics
            results["statistics"] = self.get_text_statistics(text, True, 15)
        
        return results
    
    def compare_reading_speeds(self, text):
        """
        Compare reading times across different speeds
        """
        speeds = ["slow", "average", "fast", "speed"]
        results = {}
        
        for speed in speeds:
            results[speed] = self.estimate_reading_time(text, speed)
        
        return results

# Usage Examples
client = WordCounterMCPClient("https://apistack.online", "YOUR_API_KEY")

# Sample text for analysis
sample_text = """
Natural language processing (NLP) is a subfield of linguistics, computer science, 
and artificial intelligence concerned with the interactions between computers and 
human language, in particular how to program computers to process and analyze 
large amounts of natural language data. The goal is a computer capable of 
understanding the contents of documents, including the contextual nuances of 
the language within them.
"""

# Basic word counting
word_count = client.count_words(sample_text, detailed=True)
print("Word Count Analysis:")
print(word_count)

# Reading time estimation
reading_time = client.estimate_reading_time(sample_text, "average")
print("\nReading Time Estimation:")
print(reading_time)

# Text complexity analysis
complexity = client.analyze_text_complexity(sample_text, include_readability=True)
print("\nComplexity Analysis:")
print(complexity)

# Comprehensive statistics
statistics = client.get_text_statistics(sample_text, include_frequency=True, top_words=10)
print("\nText Statistics:")
print(statistics)

# Compare different reading speeds
speed_comparison = client.compare_reading_speeds(sample_text)
print("\nReading Speed Comparison:")
for speed, result in speed_comparison.items():
    print(f"{speed.title()}:")
    print(result)
    print()

# Comprehensive document analysis
document_analysis = client.analyze_document(sample_text, comprehensive=True)
print("\nComprehensive Document Analysis:")
for analysis_type, result in document_analysis.items():
    print(f"{analysis_type.replace('_', ' ').title()}:")
    print(result)
    print("-" * 50)

# Analyze multiple texts for comparison
texts = [
    "Simple text for basic analysis.",
    "This is a more complex sentence with multiple clauses, advanced vocabulary, and sophisticated grammatical structures that demonstrate higher linguistic complexity.",
    "Short."
]

print("\nMultiple Text Comparison:")
for i, text in enumerate(texts, 1):
    print(f"Text {i}: {text}")
    analysis = client.analyze_document(text, comprehensive=False)
    print("Analysis:", analysis["word_count"])
    print()

JavaScript/Node.js Example

const axios = require('axios');

class WordCounterMCPClient {
    constructor(baseUrl, apiKey) {
        this.baseUrl = baseUrl;
        this.endpoint = `${baseUrl}/api/mcp/utilities/word-counter/sse`;
        this.headers = {
            'Content-Type': 'application/json',
            'Authorization': `Bearer ${apiKey}`
        };
    }

    async countWords(text, options = {}) {
        const request = {
            jsonrpc: "2.0",
            id: "count",
            method: "tools/call",
            params: {
                name: "count_words",
                arguments: {
                    text,
                    includeSpaces: options.includeSpaces !== false,
                    detailed: options.detailed || false
                }
            }
        };

        const response = await axios.post(this.endpoint, request, { headers: this.headers });
        return response.data.result.content[0].text;
    }

    async estimateReadingTime(text, readingSpeed = "average", customWpm = null) {
        const arguments = {
            text,
            readingSpeed
        };

        if (customWpm) {
            arguments.customWpm = customWpm;
        }

        const request = {
            jsonrpc: "2.0",
            id: "reading-time",
            method: "tools/call",
            params: {
                name: "estimate_reading_time",
                arguments
            }
        };

        const response = await axios.post(this.endpoint, request, { headers: this.headers });
        return response.data.result.content[0].text;
    }

    async analyzeTextComplexity(text, includeReadability = true) {
        const request = {
            jsonrpc: "2.0",
            id: "complexity",
            method: "tools/call",
            params: {
                name: "analyze_text_complexity",
                arguments: {
                    text,
                    includeReadability
                }
            }
        };

        const response = await axios.post(this.endpoint, request, { headers: this.headers });
        return response.data.result.content[0].text;
    }

    async getTextStatistics(text, includeFrequency = false, topWords = 10) {
        const request = {
            jsonrpc: "2.0",
            id: "statistics",
            method: "tools/call",
            params: {
                name: "get_text_statistics",
                arguments: {
                    text,
                    includeFrequency,
                    topWords
                }
            }
        };

        const response = await axios.post(this.endpoint, request, { headers: this.headers });
        return response.data.result.content[0].text;
    }

    async analyzeDocument(text, comprehensive = true) {
        const results = {};

        // Basic word count
        results.wordCount = await this.countWords(text, { detailed: true });

        // Reading time estimation
        results.readingTime = await this.estimateReadingTime(text, "average");

        if (comprehensive) {
            // Complexity analysis
            results.complexity = await this.analyzeTextComplexity(text, true);

            // Detailed statistics
            results.statistics = await this.getTextStatistics(text, true, 15);
        }

        return results;
    }

    async compareReadingSpeeds(text) {
        const speeds = ["slow", "average", "fast", "speed"];
        const results = {};

        for (const speed of speeds) {
            results[speed] = await this.estimateReadingTime(text, speed);
        }

        return results;
    }

    async batchAnalysis(texts, options = {}) {
        const results = [];

        for (let i = 0; i < texts.length; i++) {
            const text = texts[i];
            console.log(`Analyzing text ${i + 1}/${texts.length}...`);

            const analysis = {
                index: i,
                text: text.substring(0, 100) + (text.length > 100 ? "..." : ""),
                wordCount: await this.countWords(text, { detailed: true }),
                readingTime: await this.estimateReadingTime(text, options.readingSpeed || "average")
            };

            if (options.includeComplexity) {
                analysis.complexity = await this.analyzeTextComplexity(text);
            }

            if (options.includeStatistics) {
                analysis.statistics = await this.getTextStatistics(text, true, 10);
            }

            results.push(analysis);
        }

        return results;
    }
}

// Usage Examples
(async () => {
    const client = new WordCounterMCPClient("https://apistack.online", "YOUR_API_KEY");
    
    const sampleText = `
        Artificial intelligence (AI) is intelligence demonstrated by machines, 
        in contrast to the natural intelligence displayed by humans and animals. 
        Leading AI textbooks define the field as the study of "intelligent agents": 
        any device that perceives its environment and takes actions that maximize 
        its chance of successfully achieving its goals.
    `;

    try {
        // Basic word counting
        console.log("=== Word Count Analysis ===");
        const wordCount = await client.countWords(sampleText, { detailed: true });
        console.log(wordCount);

        // Reading time estimation with different speeds
        console.log("\n=== Reading Time Comparison ===");
        const speedComparison = await client.compareReadingSpeeds(sampleText);
        Object.entries(speedComparison).forEach(([speed, result]) => {
            console.log(`${speed.toUpperCase()}:`);
            console.log(result);
            console.log();
        });

        // Text complexity analysis
        console.log("=== Complexity Analysis ===");
        const complexity = await client.analyzeTextComplexity(sampleText, true);
        console.log(complexity);

        // Comprehensive statistics
        console.log("\n=== Text Statistics ===");
        const statistics = await client.getTextStatistics(sampleText, true, 15);
        console.log(statistics);

        // Comprehensive document analysis
        console.log("\n=== Comprehensive Document Analysis ===");
        const documentAnalysis = await client.analyzeDocument(sampleText, true);
        Object.entries(documentAnalysis).forEach(([type, result]) => {
            console.log(`${type.replace(/([A-Z])/g, ' $1').trim().toUpperCase()}:`);
            console.log(result);
            console.log("-".repeat(50));
        });

        // Batch analysis of multiple texts
        const textsToAnalyze = [
            "Simple sentence for testing.",
            "This is a more comprehensive text that includes multiple sentences, complex vocabulary, and demonstrates various linguistic patterns that can be analyzed for readability and complexity metrics.",
            "AI is transforming industries through machine learning, natural language processing, computer vision, and robotics, enabling automation and intelligence in unprecedented ways."
        ];

        console.log("\n=== Batch Analysis ===");
        const batchResults = await client.batchAnalysis(textsToAnalyze, {
            includeComplexity: true,
            includeStatistics: false,
            readingSpeed: "average"
        });

        batchResults.forEach((result, index) => {
            console.log(`\nText ${index + 1}: ${result.text}`);
            console.log("Word Count:", result.wordCount);
            console.log("Reading Time:", result.readingTime);
            if (result.complexity) {
                console.log("Complexity:", result.complexity);
            }
        });

    } catch (error) {
        console.error("Error:", error.response?.data || error.message);
    }
})();

.NET Core Example

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;

public class WordCounterMCPClient
{
    private readonly HttpClient _httpClient;
    private readonly string _endpoint;

    public WordCounterMCPClient(string baseUrl, string apiKey)
    {
        _httpClient = new HttpClient();
        _endpoint = $"{baseUrl}/api/mcp/utilities/word-counter/sse";
        _httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {apiKey}");
    }

    public async Task<string> CountWordsAsync(string text, bool includeSpaces = true, bool detailed = false)
    {
        var request = new
        {
            jsonrpc = "2.0",
            id = "count",
            method = "tools/call",
            @params = new
            {
                name = "count_words",
                arguments = new
                {
                    text,
                    includeSpaces,
                    detailed
                }
            }
        };

        return await SendRequestAsync(request);
    }

    public async Task<string> EstimateReadingTimeAsync(string text, string readingSpeed = "average", int? customWpm = null)
    {
        var arguments = new Dictionary<string, object>
        {
            ["text"] = text,
            ["readingSpeed"] = readingSpeed
        };

        if (customWpm.HasValue)
        {
            arguments["customWpm"] = customWpm.Value;
        }

        var request = new
        {
            jsonrpc = "2.0",
            id = "reading-time",
            method = "tools/call",
            @params = new
            {
                name = "estimate_reading_time",
                arguments
            }
        };

        return await SendRequestAsync(request);
    }

    public async Task<string> AnalyzeTextComplexityAsync(string text, bool includeReadability = true)
    {
        var request = new
        {
            jsonrpc = "2.0",
            id = "complexity",
            method = "tools/call",
            @params = new
            {
                name = "analyze_text_complexity",
                arguments = new
                {
                    text,
                    includeReadability
                }
            }
        };

        return await SendRequestAsync(request);
    }

    public async Task<string> GetTextStatisticsAsync(string text, bool includeFrequency = false, int topWords = 10)
    {
        var request = new
        {
            jsonrpc = "2.0",
            id = "statistics",
            method = "tools/call",
            @params = new
            {
                name = "get_text_statistics",
                arguments = new
                {
                    text,
                    includeFrequency,
                    topWords
                }
            }
        };

        return await SendRequestAsync(request);
    }

    public async Task<Dictionary<string, string>> AnalyzeDocumentAsync(string text, bool comprehensive = true)
    {
        var results = new Dictionary<string, string>();

        // Basic word count
        results["WordCount"] = await CountWordsAsync(text, detailed: true);

        // Reading time estimation
        results["ReadingTime"] = await EstimateReadingTimeAsync(text, "average");

        if (comprehensive)
        {
            // Complexity analysis
            results["Complexity"] = await AnalyzeTextComplexityAsync(text, true);

            // Detailed statistics
            results["Statistics"] = await GetTextStatisticsAsync(text, true, 15);
        }

        return results;
    }

    public async Task<Dictionary<string, string>> CompareReadingSpeedsAsync(string text)
    {
        var speeds = new[] { "slow", "average", "fast", "speed" };
        var results = new Dictionary<string, string>();

        foreach (var speed in speeds)
        {
            results[speed] = await EstimateReadingTimeAsync(text, speed);
        }

        return results;
    }

    public async Task<List<Dictionary<string, object>>> BatchAnalysisAsync(
        string[] texts, 
        bool includeComplexity = false, 
        bool includeStatistics = false, 
        string readingSpeed = "average")
    {
        var results = new List<Dictionary<string, object>>();

        for (int i = 0; i < texts.Length; i++)
        {
            var text = texts[i];
            Console.WriteLine($"Analyzing text {i + 1}/{texts.Length}...");

            var analysis = new Dictionary<string, object>
            {
                ["Index"] = i,
                ["Text"] = text.Length > 100 ? text.Substring(0, 100) + "..." : text,
                ["WordCount"] = await CountWordsAsync(text, detailed: true),
                ["ReadingTime"] = await EstimateReadingTimeAsync(text, readingSpeed)
            };

            if (includeComplexity)
            {
                analysis["Complexity"] = await AnalyzeTextComplexityAsync(text);
            }

            if (includeStatistics)
            {
                analysis["Statistics"] = await GetTextStatisticsAsync(text, true, 10);
            }

            results.Add(analysis);
        }

        return results;
    }

    private async Task<string> SendRequestAsync(object request)
    {
        var json = JsonSerializer.Serialize(request);
        var content = new StringContent(json, Encoding.UTF8, "application/json");
        
        var response = await _httpClient.PostAsync(_endpoint, content);
        var responseJson = await response.Content.ReadAsStringAsync();
        
        using var doc = JsonDocument.Parse(responseJson);
        return doc.RootElement.GetProperty("result")
                  .GetProperty("content")[0]
                  .GetProperty("text").GetString();
    }

    public void Dispose()
    {
        _httpClient?.Dispose();
    }
}

// Usage Examples
class Program
{
    static async Task Main(string[] args)
    {
        var client = new WordCounterMCPClient("https://apistack.online", "YOUR_API_KEY");
        
        var sampleText = @"
            Machine learning is a method of data analysis that automates analytical 
            model building. It is a branch of artificial intelligence based on the 
            idea that systems can learn from data, identify patterns and make 
            decisions with minimal human intervention. Machine learning algorithms 
            build mathematical models based on training data in order to make 
            predictions or decisions without being explicitly programmed to do so.
        ";

        try
        {
            // Basic word counting
            Console.WriteLine("=== Word Count Analysis ===");
            var wordCount = await client.CountWordsAsync(sampleText, detailed: true);
            Console.WriteLine(wordCount);

            // Reading time estimation
            Console.WriteLine("\n=== Reading Time Estimation ===");
            var readingTime = await client.EstimateReadingTimeAsync(sampleText, "average");
            Console.WriteLine(readingTime);

            // Compare different reading speeds
            Console.WriteLine("\n=== Reading Speed Comparison ===");
            var speedComparison = await client.CompareReadingSpeedsAsync(sampleText);
            foreach (var kvp in speedComparison)
            {
                Console.WriteLine($"{kvp.Key.ToUpper()}:");
                Console.WriteLine(kvp.Value);
                Console.WriteLine();
            }

            // Text complexity analysis
            Console.WriteLine("=== Complexity Analysis ===");
            var complexity = await client.AnalyzeTextComplexityAsync(sampleText, true);
            Console.WriteLine(complexity);

            // Comprehensive statistics
            Console.WriteLine("\n=== Text Statistics ===");
            var statistics = await client.GetTextStatisticsAsync(sampleText, true, 15);
            Console.WriteLine(statistics);

            // Comprehensive document analysis
            Console.WriteLine("\n=== Comprehensive Document Analysis ===");
            var documentAnalysis = await client.AnalyzeDocumentAsync(sampleText, true);
            foreach (var kvp in documentAnalysis)
            {
                Console.WriteLine($"{kvp.Key.ToUpper()}:");
                Console.WriteLine(kvp.Value);
                Console.WriteLine(new string('-', 50));
            }

            // Batch analysis
            var textsToAnalyze = new[]
            {
                "Simple sentence for testing.",
                "This comprehensive text demonstrates multiple linguistic patterns, complex vocabulary, and sophisticated grammatical structures that provide excellent material for detailed text analysis and readability assessment.",
                "Data science combines statistics, programming, and domain expertise to extract insights from data through machine learning, visualization, and predictive modeling techniques."
            };

            Console.WriteLine("\n=== Batch Analysis ===");
            var batchResults = await client.BatchAnalysisAsync(
                textsToAnalyze, 
                includeComplexity: true, 
                includeStatistics: false, 
                readingSpeed: "average"
            );

            for (int i = 0; i < batchResults.Count; i++)
            {
                var result = batchResults[i];
                Console.WriteLine($"\nText {i + 1}: {result["Text"]}");
                Console.WriteLine($"Word Count: {result["WordCount"]}");
                Console.WriteLine($"Reading Time: {result["ReadingTime"]}");
                if (result.ContainsKey("Complexity"))
                {
                    Console.WriteLine($"Complexity: {result["Complexity"]}");
                }
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Error: {ex.Message}");
        }
        finally
        {
            client.Dispose();
        }
    }
}

๐Ÿ”’ Security & Authentication

  • Authentication Required: All requests must include a valid Bearer token
  • Plan Restrictions: Only PRO and ENTERPRISE users can access this MCP server
  • Rate Limiting: 60 requests/minute, 1000 requests/hour, 10,000 requests/day
  • Input Validation: All inputs are validated for type and reasonable length limits
  • Privacy: Text content is never logged, stored, or cached
  • Processing Limits: Large texts are handled efficiently with streaming processing

๐Ÿ“Š Response Format

All tool responses follow the MCP protocol format:

Success Response

{
  "jsonrpc": "2.0",
  "id": "request-id",
  "result": {
    "content": [
      {
        "type": "text",
        "text": "โœ… **Word Count Analysis Complete**\n\n**Text Statistics:**\n- Words: 25\n- Characters: 150 (with spaces)\n- Characters: 125 (without spaces)\n- Sentences: 3\n- Paragraphs: 1\n\n**Reading Time:** ~7 seconds (average speed)\n**Average Word Length:** 5.0 characters\n**Average Sentence Length:** 8.3 words"
      }
    ]
  }
}

Error Response

{
  "jsonrpc": "2.0",
  "id": "request-id",
  "error": {
    "code": -32603,
    "message": "Text is required and cannot be empty",
    "data": "Please provide text content for analysis"
  }
}

๐Ÿงช Testing

Test the Word Counter MCP server:

# Test word counting
curl -X POST http://apistack.online/api/mcp/utilities/word-counter/sse \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "id": "test-count",
    "method": "tools/call",
    "params": {
      "name": "count_words",
      "arguments": {
        "text": "This is a test sentence for word counting analysis.",
        "detailed": true
      }
    }
  }'

# Test reading time estimation
curl -X POST http://apistack.online/api/mcp/utilities/word-counter/sse \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "id": "test-time",
    "method": "tools/call",
    "params": {
      "name": "estimate_reading_time",
      "arguments": {
        "text": "This is a longer text that will take some time to read and should provide meaningful reading time estimates.",
        "readingSpeed": "average"
      }
    }
  }'

๐Ÿ—๏ธ Architecture

AI Agent/Client
       โ†“
MCP Protocol (JSON-RPC 2.0)
       โ†“
Word Counter MCP Server (/api/mcp/utilities/word-counter/sse)
       โ†“
Authentication & Validation
       โ†“
Text Analysis Engine (/api/utilities/word-counter/v1)
       โ†“
Linguistic Processing & Statistics
       โ†“
Response via MCP Protocol

๐Ÿ“ Tool Schemas

count_words Schema

{
  "name": "count_words",
  "description": "Count words, characters, sentences, and paragraphs in text",
  "inputSchema": {
    "type": "object",
    "properties": {
      "text": {
        "type": "string",
        "description": "The text to analyze for word count"
      },
      "includeSpaces": {
        "type": "boolean",
        "description": "Include spaces in character count (default: true)",
        "default": true
      },
      "detailed": {
        "type": "boolean",
        "description": "Include detailed breakdown of text metrics (default: false)",
        "default": false
      }
    },
    "required": ["text"]
  }
}

estimate_reading_time Schema

{
  "name": "estimate_reading_time",
  "description": "Estimate reading time for text with customizable reading speeds",
  "inputSchema": {
    "type": "object",
    "properties": {
      "text": {
        "type": "string",
        "description": "The text to estimate reading time for"
      },
      "readingSpeed": {
        "type": "string",
        "enum": ["slow", "average", "fast", "speed"],
        "description": "Reading speed preset (slow: 150 wpm, average: 200 wpm, fast: 250 wpm, speed: 300 wpm)",
        "default": "average"
      },
      "customWpm": {
        "type": "number",
        "description": "Custom words per minute (overrides readingSpeed preset)",
        "minimum": 50,
        "maximum": 1000
      }
    },
    "required": ["text"]
  }
}

analyze_text_complexity Schema

{
  "name": "analyze_text_complexity",
  "description": "Analyze text complexity, readability, and linguistic metrics",
  "inputSchema": {
    "type": "object",
    "properties": {
      "text": {
        "type": "string",
        "description": "The text to analyze for complexity"
      },
      "includeReadability": {
        "type": "boolean",
        "description": "Include readability scores and grade level estimates (default: true)",
        "default": true
      }
    },
    "required": ["text"]
  }
}

get_text_statistics Schema

{
  "name": "get_text_statistics",
  "description": "Get comprehensive text statistics and insights",
  "inputSchema": {
    "type": "object",
    "properties": {
      "text": {
        "type": "string",
        "description": "The text to generate statistics for"
      },
      "includeFrequency": {
        "type": "boolean",
        "description": "Include word frequency analysis (default: false)",
        "default": false
      },
      "topWords": {
        "type": "number",
        "description": "Number of most frequent words to return (default: 10)",
        "default": 10,
        "minimum": 5,
        "maximum": 50
      }
    },
    "required": ["text"]
  }
}

๐ŸŽฏ Use Cases

Content Creation & Editing

  • Analyze blog posts and articles for readability
  • Estimate reading time for content planning
  • Optimize text complexity for target audiences
  • Track writing progress with word counts

Academic & Research

  • Analyze academic papers for complexity metrics
  • Compare readability across different texts
  • Generate text statistics for research papers
  • Evaluate writing quality and grade level

Marketing & Communications

  • Optimize marketing copy for readability
  • Ensure content matches audience reading level
  • Analyze competitor content for benchmarking
  • Create content briefs with reading time estimates

Technical Documentation

  • Ensure documentation is appropriately complex
  • Analyze user manuals for readability
  • Optimize help content for different skill levels
  • Track documentation metrics over time

Education & Training

  • Analyze educational materials for grade level
  • Create reading time estimates for lessons
  • Evaluate student writing complexity
  • Develop curriculum with appropriate text difficulty

๐Ÿค Support

For issues, feature requests, or integration help:

  • Check the API documentation
  • Review the examples above
  • Test with the provided curl commands
  • Contact support for PRO/ENTERPRISE users

Note: This MCP server requires a PRO or ENTERPRISE subscription and valid API authentication. The server provides comprehensive functionality workflows.

Quick Info

Endpoint
/api/mcp/utilities/word-counter/sse
Transport
Server-Sent Events (SSE)
Tools Available
4
Plan Required
PRO, ENTERPRISE

MCP Configuration

Add this configuration to your MCP client:

Note: Replace "YOUR_API_KEY" with a valid Enterprise API key. FREE plan keys will receive access errors.

{
  "mcpServers": {
    "word-counter-utilities": {
      "command": "curl",
      "args": [
        "-X",
        "POST",
        "https://apistack.online/api/mcp/utilities/word-counter/sse",
        "-H",
        "Content-Type: application/json",
        "-H",
        "Authorization: Bearer YOUR_API_KEY",
        "--data-raw",
        "@-"
      ],
      "transport": "sse"
    }
  }
}

Try It Out

Use the MCP configuration above in your AI client, or test the underlying APIs in our playground.

API playground requires a Enterprise subscription for access.

Open in Playground