MCP server (stdio) that counts Chinese characters in a text, excluding punctuation, whitespace, Latin letters and digits.
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"chinese-char-counter-mcp","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# chinese-char-counter-mcp 一个用 Python 实现的 MCP 服务(Model Context Protocol Server,STDIO 传输), 用于统计**一段文本里的中文字数**——标点、空格、英文字母、数字、emoji 等一律不计入。 - 传输方式:STDIO(本地进程,无网络、无 API Key、无环境变量) - 运行时依赖:Python >= 3.10、`mcp>=1.0.0,<2` - 已通过 ModelScope MCP 广场托管部署所需的配置形态(`command` 为 `uvx`,包发布到 PyPI) ## 这个服务解决什么问题 大模型写中文文案时,"字数"常常对不上:把标点、空格、英文单词都算进去,或者把 emoji 也算成字。本服务给出一个确定的答案:只数中文字符,并把标点/字母/数字/空白 等分项一并返回,方便直接用于文案校验、作业字数检查、标题长度限制等场景。 ## 客户端配置 把下面这段配置加入任意支持 MCP 的客户端(Claude Desktop、Cursor、Cherry Studio、 通义灵码、ModelScope MCP 实验场等): ```json { "mcpServers": { "chinese-char-counter": { "command": "uvx", "args": ["chinese-char-counter-mcp@latest"] } } } ``` 说明: - `uvx`(来自 [uv](https://docs.astral.sh/uv/))会自动从 PyPI 下载并运行本包,无需手动安装。 - 未装 uv 时,可先 `pip install uv`,或改用已安装方式:`"command": "python", "args": ["-m", "chinese_char_counter_mcp"]`。 - 本服务不需要任何环境变量,因此配置里没有 `env` 字段。 ## 源码仓库 ```bash git clone https://github.com/YeTor53/chinese_char_counter_mcp_yetor.git ``` ## 安装 ```bash # 方式一:pip 安装后直接启动(控制台命令) pip install chinese-char-counter-mcp chinese-char-counter-mcp # 方式二:模块方式启动 python -m chinese_char_counter_mcp # 方式三:不安装,临时运行(需要 uv) uvx chinese-char-counter-mcp@latest ``` STDIO 服务启动后不打印任何内容、等待客户端的 JSON-RPC 请求,这是正常现象。 ## 工具 ### 1. `count_chinese_characters` 统计单条文本的中文字数。 | 参数 | 类型 | 必填 | 说明 | | --- | --- | --- | --- | | `text` | string | 是 | 待统计文本,长度上限 200000 个字符 | 返回字段: | 字段 | 类型 | 说明 | | --- | --- | --- | | `chinese_count` | integer | 中文字数(唯一需要关心的结果) | | `total_characters` | integer | 文本总字符数(含标点、空格等全部字符) | | `chinese_ratio` | number | 中文占全部字符的比例,保留 4 位小数 | | `breakdown` | object | 分项计数:`chinese` / `letters` / `digits` / `punctuation` / `spaces` / `other` | | `error` | string | 失败原因;成功时为空字符串 | 调用 `count_chinese_characters(text="你好,World 2026!")` 的返回: ```text { "chinese_count": 2, "total_characters": 14, "chinese_ratio": 0.1429, "breakdown": { "chinese": 2, "letters": 5, "digits": 4, "punctuation": 2, "spaces": 1, "other": 0 …
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.