Skip to main content
Glama
cn-mcp-kit

cn-mcp-kit

by yuannuo233

cn-mcp-kit 中文工具箱 MCP

让 AI 助手(Claude / WorkBuddy / 任何支持 MCP 的客户端)直接调用中文场景实用工具的 MCP 服务器。 自带真实时钟,让 AI 不再把"刚刚"说成"昨天"。

license tests

🧰 提供的工具(11 个)

时间

工具

功能

current_time

当前真实时间、时区,以及今天 / 昨天 / 明天的日期

time_diff

某个时间点是"39 分钟前,属于今天"还是"昨天 / 前天 / n 天前"

大模型没有时钟,容易在时间上出错。这两个工具给它一个真的钟,并在描述里要求 AI 先查再说。

数字与文本

工具

功能

amount_to_chinese

数字金额 → 人民币大写,支持负数(1234.56 → 壹仟贰佰叁拾肆元伍角陆分)

number_to_chinese

阿拉伯数字 → 中文读法(35000 → 三万五千,可输出大写)

cn_number_parse

中文数字 → 阿拉伯数字,支持大写、繁体、年份读法(二〇二六 → 2026)

text_statistics

字数 / 字符数 / 汉字 / 字母 / 数字 / 标点 / 行数 / 段落数,字数口径与 Word 一致

fullwidth_convert

全角 ↔ 半角转换(Hello123 → Hello123)

日历与中文

工具

功能

lunar_date

公历 → 农历、生肖、干支、节气、节日、星座;不传日期默认今天

hanzi_pinyin

汉字转拼音,支持多音字

s2t_convert

简体 ↔ 繁体转换

idcard_validate

身份证号校验(校验位 + 出生日期真实性),返回年龄、性别、地区码

Related MCP server: mcp-chrono

🚀 快速开始

需要 Node.js 18 或更高版本。

npm install
npm test     # 117 个测试

在 MCP 客户端(如 WorkBuddy、Claude Desktop)的配置文件中加入:

{
  "mcpServers": {
    "cn-mcp-kit": {
      "command": "node",
      "args": ["<项目路径>/src/index.js"]
    }
  }
}

💡 设计原则

  1. 给 AI 真实的数据源,而不是让它猜。 时间、农历这类会变的事实,由工具现场计算。

  2. 看不懂就说看不懂。 所有工具遇到无法识别的输入都明确返回"无法解析 / 不存在",绝不返回一个看起来对、实际错的值。

  3. 一个工具一个文件。 src/tools/ 下每个文件只导出一个 register(server),互不依赖,哪个工具出问题就看哪个文件。

  4. 先测再交。 每个纯算法工具都有测试,npm test 一键回归。

📁 目录结构

cn-mcp-kit/
├── src/
│   ├── index.js      # 服务器入口:注册所有工具
│   └── tools/        # 每个工具一个文件
├── tests/            # 自动化测试(node:test)
├── docs/             # 项目规划、添加新工具教程
├── CONTRIBUTING.md   # 贡献指南
├── LICENSE           # MIT
└── README.md

🤝 添加新工具

在 src/tools/ 下新建一个 js 文件,导出 register(server) 函数, 再到 src/index.js 注册、到 tests/ 补测试。详见 docs/02-如何添加新工具.md。 欢迎提 PR,规范见 CONTRIBUTING.md。

📄 License

MIT

Available Tools

11 tools
amount_to_chineseA

把数字金额转换成人民币大写,支持负数(加"负"字)。如 1234.56 -> 壹仟贰佰叁拾肆元伍角陆分

Inputs: amount (required).

cn_number_parseA

把中文数字转换成阿拉伯数字,如 三万五千零六 -> 35006。支持大写(壹贰叁)、繁体(萬億)、年份读法(二〇二六 -> 2026)和负数。无法解析时返回"无法解析"。

Inputs: text (required).

current_timeA

获取当前真实时间(本机时区),含今天、昨天、明天的日期。凡是要回答"今天几号""现在几点",或要判断"刚才/昨天/上周/几天前"时,必须先调用本工具,不要凭记忆猜测日期。

Inputs: no named parameters.

fullwidth_convertA

全角与半角互相转换,如 Hello123 -> Hello123。可选同时转换中文特有标点(。、《》【》“” 等),默认只转换全角字母、数字和符号。

Inputs: to (required), text (required), punctuation.

hanzi_pinyinA

把中文转成拼音,能按词定多音字(重庆 -> chóng qìng,银行 -> yín háng)。用于给汉字标注读音、做注音练习或核对发音。

Inputs: text (required), tone.

idcard_validateA

校验中国大陆 18 位身份证号是否合法(校验位算法 + 出生日期是否真实存在),合法时返回出生日期、年龄、性别和地区码。仅做格式校验,不查询真实身份。

Inputs: id (required).

lunar_dateA

公历日期转农历,返回农历日期、生肖、干支、节气(上一个/下一个各差几天)、节日和星座。不传日期则按今天计算。

Inputs: day, year, month.

number_to_chineseA

把阿拉伯数字转成中文读法,如 35000 -> 三万五千,3.14 -> 三点一四,-5 -> 负五。可选输出大写(叁万伍仟)。用于把数字读出来或写成文章。

Inputs: number (required), uppercase.

s2t_convertA

简体和繁体中文互相转换,能区分常见异形字(头发 -> 頭髮,干 -> 幹)。用于把文本转成繁体或转回简体。

Inputs: to (required), text (required).

text_statisticsA

统计中文文本的字数、字符数、汉字数、字母数、数字数、标点数、行数和段落数。字数口径与 Word 一致(每个汉字算 1,连续字母或数字算 1 个)。

Inputs: text (required).

time_diffA

计算某个时间点距离现在(或距离另一个时间)多久,并给出"今天/昨天/前天/明天/后天/n 天前"的日历关系。用来准确描述"这件事是刚发生的还是昨天发生的"。时间按本机时区解析。

Inputs: target (required), base.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 11 tools

    Disambiguation4/5

    Most tools target clearly distinct tasks (pinyin, ID card, lunar date, fullwidth, text stats), so selection is generally easy. The only real overlap is among the three number tools: amount_to_chinese vs number_to_chinese both convert numbers to Chinese characters (currency uppercase vs. plain reading with optional uppercase), which could cause misselection for values like 1234.56; descriptions help but do not fully separate them.

    Naming Consistency3/5

    All names are snake_case and readable, but the convention is mixed: verb_noun (validate-style) appears as noun_verb in idcard_validate, hanzi_pinyin, text_statistics, fullwidth_convert, and as bare noun phrases in lunar_date, current_time, time_diff, plus an odd prefixed form cn_number_parse.

    Tool Count5/5

    11 tools for a Chinese-locale utility kit is well within the sweet spot, and each tool maps to a distinct, useful operation without filler. The three number-conversion tools are individually justified by different output formats (currency uppercase, reading, parsing).

    Completeness4/5

    Coverage is broad for a locale toolkit (numbers, dates, conversion, validation, stats), but some operations are one-way: lunar_date only converts Gregorian to lunar with no reverse, and there is no parser for RMB uppercase amounts back to numbers. These gaps are minor and agents can work around them with the existing parse/convert tools.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides Chinese holiday information, lunar calendar conversion, traditional festivals, 24 solar terms, and BaZi (Eight Characters) calculations for AI assistants to accurately handle Chinese calendar queries and date conversions.
      3
      Apache 2.0
    • A
      license
      A
      quality
      D
      maintenance
      A comprehensive time and calendar utility server that provides timezone conversions, date arithmetic, and business day calculations for AI agents. It features extensive support for the Chinese lunar calendar, including almanac data, festivals, and public holiday tracking across multiple regions.
      13
      17 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to query China's statutory public holidays and makeup-workday schedules, and convert solar dates to lunar dates with zodiac and ganzhi details.
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to call tools for adding numbers, evaluating math expressions, getting the current time, and counting words and characters.
      -