Skip to main content
Glama

MCP Character Count

mcp-charcount

Simple MCP server that provides a single tool to count characters or bytes in text.

Quick start

  • Run with stdio (no PATH to python needed):
    • uv run src/mcp_charcount/server.py
  • Develop with MCP Inspector:
    • uv run mcp dev src/mcp_charcount/server.py

Tool: count_chars

  • Args: text: str, mode: "chars"|"bytes" = "chars", include_whitespace: bool = true
  • Returns: { "count": int, "mode": str, "include_whitespace": bool }

Tests

  • pytest -q (src layout is configured; install not required)
  • With uv: uv run pytest -q

Manifest

  • mcp.json is configured for this repo layout:
    • command: uv
    • args: ["run", "src/mcp_charcount/server.py"] This matches the current server which runs mcp.run(transport='stdio') when executed as a script.

Settings Example

codex

~/.codex/config.toml

[mcp_servers.mcp-charcount] command = "uv" args = ["--directory", "/ABSOLUTE/PATH/TO/PARENT/FOLDER/mcp-charcount", "run", "src/mcp_charcount/server.py"]

Amazon Q Developer

~/.aws/amazonq/mcp.json

{ "mcpServers": { "local.mcp-charcount": { "command": "/opt/homebrew/bin/uv", "args": [ "--directory", "/ABSOLUTE/PATH/TO/PARENT/FOLDER/mcp-charcount", "run", "src/mcp_charcount/server.py" ] } } }

License: MIT

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

Enables counting characters or bytes in text with options to include or exclude whitespace. Provides a simple tool for text analysis and length measurement.

  1. Quick start
    1. Tool: count_chars
      1. Tests
        1. Manifest
          1. Settings Example
            1. codex
            2. Amazon Q Developer

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that provides tools for analyzing text documents, including counting words and characters. This server helps LLMs perform text analysis tasks by exposing simple document statistics functionality.
            Last updated -
            1
            300
            10
            Apache 2.0
          • A
            security
            A
            license
            A
            quality
            Enables text extraction from web pages and PDFs, and execution of predefined commands, enhancing content processing and automation capabilities.
            Last updated -
            MIT License
          • A
            security
            A
            license
            A
            quality
            Provides comprehensive document processing, including reading, converting, and manipulating various document formats with advanced text and HTML processing capabilities.
            Last updated -
            16
            27
            15
            MIT License
          • A
            security
            A
            license
            A
            quality
            Counts characters and words in both Japanese and English text files, with special handling for Japanese morphological analysis and proper character counting excluding spaces and line breaks.
            Last updated -
            6
            2
            MIT License

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/TORIFUKUKaiou/mcp-charcount'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server