mcp-chinese-counter
MCP 服务:统计一段话里的中文字数。只数汉字,标点、空格、英文字母、数字都不计入。
工具
count_chinese_chars(text: str) -> int
参数 text 是要统计的原文,返回汉字个数。
示例:输入「今天天气真好,我们去散步!」→ 返回 11(逗号和感叹号不计)。
依赖
Python 3.11+,以及 mcp>=2.0。
本地运行
uvx mcp-chinese-counter
装到当前环境后也可以直接:
pip install mcp-chinese-counter
mcp-chinese-counter
想跑成远程服务(监听 8000 端口,按 URL 接入):
mcp-chinese-counter --http
客户端配置
{
"mcpServers": {
"chinese-counter": {
"command": "uvx",
"args": ["mcp-chinese-counter"]
}
}
}
托管部署配置
魔搭 MCP 广场创建服务时,托管类型选「可托管部署」,来源填 PyPI 包名 mcp-chinese-counter,config 填:
{
"mcpServers": {
"chinese-counter": {
"command": "uvx",
"args": ["mcp-chinese-counter"]
}
}
}
环境变量无需配置。
Metadata
Release files for mcp-chinese-counter 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcp_chinese_counter-0.1.0.tar.gz | 1.6 kB | Without provenance | Details for mcp_chinese_counter-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcp_chinese_counter-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mcp_chinese_counter-0.1.0-py3-none-any.whl |
Total release size: 4.3 kB
Release files / mcp_chinese_counter-0.1.0.tar.gz
| Download URL | mcp_chinese_counter-0.1.0.tar.gz |
|---|---|
| Size | 1.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1bde0e0729b00df89a112deb87fa7c2069792a2455fdfd9db22bd0c78806f1fd
|
|
BLAKE2b-256 checksum How to use checksums |
e438f9b2630571e7f378161359b7d48318d78f03a62658ff409b8007c1e606e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / mcp_chinese_counter-0.1.0-py3-none-any.whl
| Download URL | mcp_chinese_counter-0.1.0-py3-none-any.whl |
|---|---|
| Size | 2.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82f48d31d3dcddb01d318f2a6f500422fcd19acc8a7e6e4a139e47c338ff3f6f
|
|
BLAKE2b-256 checksum How to use checksums |
9ff83fe3c511d4aed1376c9915a5ff87adf9d4c9dd551c1a230d85959c71c185
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Security for mcp-chinese-counter 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.