cn-dev-mcp
This server provides offline MCP tools for common Chinese developer tasks, covering holidays/workdays, format validation, pinyin, lunar calendar, administrative regions, and front-end documentation lookup.
Check whether a date is a statutory holiday, make-up workday, weekend, or normal workday; list a year’s holiday schedule; count workdays between dates; and calculate the Nth workday before or after a date.
Validate mainland China ID card numbers, unified social credit codes, and mobile phone numbers, including format/checksum checks and basic parsing; these are format checks only and do not verify real identities or business records.
Convert Chinese text to full pinyin or initials, with optional tone formats.
Convert between solar and lunar dates for 1900–2100, including leap months, zodiac, solar terms, and festivals.
Look up province, city, and county administrative divisions by code or name.
Search offline API summaries for uni-app, WeChat Mini Program, Element Plus, and Vant, and retrieve a specific documentation entry by ID.
Provides offline search and retrieval of WeChat Mini Program API documentation summaries, with official documentation links for quick reference.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cn-dev-mcp 2026年10月10号要上班吗?顺便算下10月有几个工作日"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cn-dev-mcp
面向中国开发者的离线 MCP 工具集
节假日调休 · 工作日计算 · 身份证 / 信用代码 / 手机号 / 银行卡校验 · 快递单号公司推测 · 拼音 · 农历 · 行政区划 · uni-app / 小程序 / Element Plus / Vant 文档速查
特点
完全离线:数据都打包在里面,不联网、不调用第三方接口,没有服务器费用
数据有出处:节假日数据来自国务院办公厅放假通知,行政区划来自国家统计局公开数据
只校验格式:身份证、信用代码只检查格式和校验位,不查询、也不核验任何人或企业的真实信息
一行命令启动:
npx -y github:MsNan/cn-dev-mcp,支持 Cursor、Claude Code、Claude Desktop、Trae、Cherry Studio 等所有支持 stdio 的 MCP 客户端
Related MCP server: mcp-chrono
安装配置
需要 Node.js 18 或更高版本,npm 10 或更高版本(npm -v 查看;npm 9 直接 npx GitHub 仓库可能会静默失败,用 npm i -g npm@10 升级即可)。第一次启动时 npx 会先下载,大约需要十几秒。
Cursor
在 ~/.cursor/mcp.json(全局)或项目里的 .cursor/mcp.json 中添加:
{
"mcpServers": {
"cn-dev": { "command": "npx", "args": ["-y", "github:MsNan/cn-dev-mcp"] }
}
}Claude Code
claude mcp add cn-dev -- npx -y github:MsNan/cn-dev-mcpClaude Desktop
编辑 claude_desktop_config.json(macOS 在 ~/Library/Application Support/Claude/,Windows 在 %APPDATA%\Claude\):
{
"mcpServers": {
"cn-dev": { "command": "npx", "args": ["-y", "github:MsNan/cn-dev-mcp"] }
}
}Trae
打开 AI 对话框右上角设置 → MCP → 添加 → 手动配置,粘贴:
{
"mcpServers": {
"cn-dev": { "command": "npx", "args": ["-y", "github:MsNan/cn-dev-mcp"] }
}
}Cherry Studio
设置 → MCP 服务器 → 添加服务器:类型选 stdio,命令填 npx,参数填两行:-y 和 github:MsNan/cn-dev-mcp,保存后启用。
💡 Windows 上如果启动失败,可以把命令改成
cmd,参数改成/c npx -y github:MsNan/cn-dev-mcp。
工具列表
工具 | 作用 | 你可以这样问 AI |
| 判断某天是法定节假日、放假调休、调休上班、周末还是工作日( | “2026 年 10 月 10 号要上班吗?” |
| 某年全部放假区间和调休日,附官方通知 | “列出 2026 年的放假安排” |
| 两个日期之间有几个工作日(已算节假日和调休) | “10 月有几个工作日?” |
| 第 N 个工作日是哪天 | “9 月 30 号下单,3 个工作日内发货,最晚哪天?” |
| 身份证号格式和校验位校验,解析生日、性别、地区 | “帮我写个表单校验,顺便测一下这个号码格式对不对” |
| 统一社会信用代码校验(GB 32100) | “这个信用代码校验位对吗?” |
| 手机号格式校验,按号段推测运营商 | “+86 138-0013-8000 格式对吗?” |
| 银行卡号位数 + Luhn 校验位,按前缀推测卡组织,返回脱敏卡号 | “这个卡号是不是少输了一位?” |
| 按运单号字母前缀推测快递公司(SF/YT/JD/JT 等);纯数字不猜测 | “SF1023… 是哪家快递?” |
| 汉字转拼音或首字母,能处理多音字 | “把城市列表按拼音首字母分组” |
| 公历转农历,含干支、生肖、节气、节日 | “2026-10-16 是农历几号?” |
| 农历转公历,支持闰月 | “农历 2027 年正月初一是哪天?” |
| 按代码或名称查省、市、县行政区划 | “330106 是哪里?”“生成浙江省各市的 code 列表” |
| 离线检索 uni-app、小程序、Element Plus、Vant 常用 API 要点 | “uni-app 分包怎么配置?” |
| 按 id 读取单条文档摘要 | 和上面的检索配合使用 |
返回示例
holiday_check { "date": "2026-10-10" }
{ "date": "2026-10-10", "weekday": "周六", "type": "调休上班", "isWorkday": true, "dataAvailable": true }workday_add { "date": "2026-09-30", "n": 3 }
{ "from": "2026-09-30", "n": 3, "result": "2026-10-10", "weekday": "周六", "notes": [] }lunar_to_solar { "year": 2026, "month": 8, "day": 15 }
{ "solar": "2026-09-25", "weekday": "周五", "lunar": { "text": "二〇二六年八月十五" }, "zodiac": "马", "festivals": ["中秋节"] }数据说明
数据 | 范围 | 来源 |
节假日 / 调休 | 2025、2026、2027 年 | 2025 年通知(国办发明电〔2024〕12号)、2026 年通知(国办发明电〔2025〕7号)、2027 年通知(国办发明电〔2026〕10号) |
2028 年 | 国务院尚未公布 | 暂时只按周末计算,返回结果会带上提示;官方公布后会尽快更新 |
行政区划 | 31 个省级行政区的省、市、县三级(不含港澳台) | modood/Administrative-divisions-of-China(整理自国家统计局) |
农历 | 1900 – 2100 年 | |
拼音 | — | |
文档速查 | 30 条常用 API | 本项目自己写的要点摘要,不是官方原文,每条都附官方文档链接 |
本地开发
git clone https://github.com/MsNan/cn-dev-mcp && cd cn-dev-mcp
npm install
npm test # 编译,然后跑单元测试 + MCP stdio 冒烟测试
npx @modelcontextprotocol/inspector node dist/index.js # 可视化调试欢迎提 PR 补充文档条目(src/data/docs.ts)和新工具。
相关项目
vue-uniapp-skills:Vue3 + uni-app 中文 AI 编程技能包,一行命令装进 Cursor、Claude Code、Trae、Codex。和本项目一起用效果更好。
作者博客:msnan.github.io · 公众号:程序员项目库
License
MIT © Theo(涛哥)
☕ 打赏支持
如果这个工具帮你省了时间,欢迎请我喝杯咖啡,也欢迎点个 ⭐ Star。
Available Tools
13 toolsdev_docs_get读取文档条目A
按 id 读取一条文档摘要(id 来自 dev_docs_search)
Inputs: id (required).
dev_docs_search前端文档速查B
离线检索 uni-app / 微信小程序 / Element Plus / Vant 常用 API 要点摘要,每条附官方文档链接
Inputs: query (required), lib, limit.
holiday_check节假日/调休查询A
查询某天是法定节假日、调休上班日、周末还是工作日(内置国务院办公厅 2025、2026 年放假通知;2027 年尚未公布)
Inputs: date (required).
holiday_year全年放假安排A
列出某年全部法定节假日放假区间与调休上班日,附官方通知来源
Inputs: year (required).
lunar_to_solar农历转公历A
农历转公历,如农历 2026 年八月十五 → 公历日期(1900–2100)
Inputs: day (required), year (required), month (required), isLeapMonth.
pinyin汉字转拼音A
把中文转换为拼音(带声调/数字声调/无声调)或首字母,自动处理常见多音字
Inputs: text (required), mode, tone.
region_lookup行政区划代码查询A
按代码(2/4/6 位,或 12 位取前 6 位)或名称查询省市县行政区划。覆盖:31 个省级行政区(不含港澳台)的省、市、县三级;来源:modood/Administrative-divisions-of-China(数据源自国家统计局 / 民政部公开数据)
Inputs: query (required), limit.
solar_to_lunar公历转农历A
公历转农历,返回农历日期、干支、生肖、节气、节日(1900–2100)
Inputs: date (required).
validate_id_card身份证号格式校验A
校验中国大陆居民身份证号格式、出生日期与校验位,解析出生日期、性别、地区。仅做格式校验,不查询、不核验真实身份
Inputs: id (required).
validate_mobile手机号格式校验A
校验中国大陆 11 位手机号格式(支持 +86、空格、横线),按号段推测运营商
Inputs: phone (required).
validate_uscc统一社会信用代码校验A
校验 18 位统一社会信用代码的字符集与校验位(GB 32100-2015),解析登记管理部门、机构类别与地区。不查询工商信息
Inputs: code (required).
workday_add第 N 个工作日A
计算某日期之后(n 为负数则之前)的第 n 个工作日,常用于"3 个工作日内发货"之类的截止日期
Inputs: n (required), date (required).
workday_count工作日天数统计A
统计两个日期之间(含首尾)的工作日与休息日天数,已考虑节假日与调休
Inputs: end (required), start (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Each tool has a clearly distinct purpose: text conversion, lunar/solar conversion, region lookup, dev docs retrieval, holiday/workday calculation, and ID/USCC/mobile validation are all separable. The only paired tools, dev_docs_search and dev_docs_get, have an explicit search-then-fetch relationship rather than overlapping behavior.
Naming is readable but follows mixed conventions: pinyin is a bare noun, lunar_to_solar/solar_to_lunar use source_to_target, region_lookup/holiday_check/holiday_year use noun_action, and validate_id_card/validate_uscc/validate_mobile use verb_noun. The inconsistency does not usually cause confusion, but there is no single predictable pattern.
With 13 tools, the set is well-scoped for a China-focused developer utility server. Each tool covers a distinct operation, and no obvious redundant tools inflate the count.
The surface covers paired operations where expected, such as lunar_to_solar/solar_to_lunar, dev_docs_search/dev_docs_get, and holiday_check/holiday_year/workday calculations. Minor limitations are explicit, such as holiday data only for 2025–2026 and region data excluding Hong Kong, Macau, and Taiwan.
Related MCP Connectors
China-focused validation tools: ID card, bank card, phone, plate, USCC, VIN, lunar calendar & more
63 deterministic Chinese tools: contract checks, calculators, agent utilities. Zero hallucination.
China facts a server outside China cannot get: real mainland reachability, 调休 holidays, ID/phone val
300+ offline developer utilities, plus 22 AI tools with a free API key. JSON, JWT, regex, cron, SQL.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides 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.3Apache 2.0
- AlicenseAqualityDmaintenanceA 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.1322 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables 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
- AlicenseBqualityAmaintenanceEnables AI agents to build and parse VietQR payments, convert old 63-province addresses to the 34-province structure, validate tax IDs and e-invoices, turn money amounts into Vietnamese words, and convert between solar and lunar calendar dates. All tools run offline with bundled data, returning structured ok/error results.40MIT