
Mcp Jp Paid Leave
io.github.skypier-jp-works由 GitHub 账号 skypier-jp-works 发布v1.0.0更新于 Oct 24, 2026
MCP server for Japanese statutory annual paid leave (nenkyu) calculations.
概览
本地 MCP 服务器,让助手按日本劳动基准法计算法定带薪年假(有给休假),包括授予天数、出勤率、结转与五天强制使用规则。
- 可以做什么
- 计算授予日期与天数,并列出多年授予日程,支持统一基准日与兼职按比例授予。按 11 类天数明细核查 80% 出勤率要求,并给出法律依据。根据授予与使用记录计算结转、两年时效失效与剩余余额。判断是否适用五天强制使用义务及是否达标。在法定最低标准之上套用公司政策,不足时自动纠正并给出警告。
- 适用场景
- 适合涉及日本员工的 HR、薪资或劳务事务:需要法定最低带薪假天数、出勤率判定或五天规则结论,并希望每项结果附带法律依据与规则生效日期时使用。
- 运行要求
- 作为本地 Node.js 进程运行(建议 LTS),从 npm 包安装;README 说明需构建并在 Claude Desktop 配置中登记构建后的入口文件。运行时无网络访问,无需账号、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Mcp Jp Paid Leave,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
mcp-jp-paid-leave
An MCP (Model Context Protocol) server for calculating Japan's statutory annual paid leave ("nenkyu") under the Labor Standards Act: entitlement grants, attendance-rate checks, proportional grants for part-time workers, carryover/prescription, and the 5-day mandatory-use rule. It lets MCP-capable clients such as Claude Desktop invoke these calculations directly.
No network access is used at runtime. All statutory rules are embedded as constants in the code.
Core design principle
- Every number and judgment this server returns is the statutory minimum under the Labor Standards Act.
- Any company policy that grants more than the statutory minimum must be passed explicitly as an
argument to
apply_company_policy. - Every tool response includes a
basisfield:"legal_minimum": the statutory minimum value"company_policy_applied": the value after applying a company policy (only fromapply_company_policy)
- If a company policy value is below the statutory minimum,
apply_company_policyautomatically corrects it to the statutory minimum and returns awarning. - Resilience to legal amendments: rules that are known to have changed as of a specific effective date
(such as the standard grant-days table) are stored as "rule generations with an effective date," and the
generation valid at the calculation-target date is selected automatically. Calculating for a past period
still uses the rules that were in force at that time. Every tool response includes a
metafield with the effective date and source URL of each rule actually used, the date the data was last verified (dataVerifiedOn), and a staleness warning when applicable. See Versioning policy and Maintenance policy below.
Disclaimer
- This tool computes the statutory minimum under the Labor Standards Act. The accuracy of its output is not guaranteed.
- If your work rules (shugyo kisoku) provide more favorable terms to employees, those always take precedence over this tool's output.
- For any important labor/HR decision (including anything touching discipline, dismissal, or payroll), always confirm with a qualified professional (e.g., a licensed Shakai Hoken Roumushi / labor and social security attorney).
Tools (7 total)
1. calculate_entitlement
Give the hire date (hireDate) and which grant occurrence to compute (grantNumber: 1 = the first grant
at 6 months of service, 2 = the second grant at 1 year 6 months, etc.).
referenceDateMethod:"individual"(the statutory default — each employee's own basis date) or"uniform"(a company-wide unified basis date, i.e. "seiitsu-teki toriatsukai")uniformBasisMonthDays: required whenuniformis used — an array of"MM-DD"candidate basis dates (e.g.["04-01"]or["04-01","10-01"])weeklyScheduledDays/annualScheduledDays/weeklyScheduledHours: optional, for proportional grants (part-time workers)
For the uniform method, the server correctly computes the recurring chain: once the first front-loaded
basis date is found, every subsequent grant recurs on the same month/day each year. Any period shortened
by front-loading is returned as shortenedPeriod, with a note that this period must be treated as fully
attended for attendance-rate purposes (when calling check_attendance_rate, count it as ordinary worked
days in actualWorkedDays etc. rather than as absence — don't carve it out as unattended).
Returns an error if the statutory basis date (statutoryBasisDate, not the hire date) falls before
2001-04-01. The current grant-days table (introduced by Act No. 112 of 1998) took effect for most
purposes on 1999-04-01, but a transitional schedule with lower figures for certain tenure brackets applied
through 2001-03-31. This tool does not implement that transitional schedule, so 2001-04-01 (once the
transition was fully complete) is the verified floor (see Versioning policy and
CHANGELOG.md).
This floor applies to each grant's own basis date, not to the hire date. No matter how old the hire date is, a specific grant computes fine as long as that grant's basis date is on or after 2001-04-01. For example, for an employee hired in 1995, computing "the most recent grant as of 2026" (the 31st grant, basis date 2025-10-01) succeeds. Only grants whose own basis date is before 2001-04-01 (e.g. that same employee's 1st grant, basis date 1995-10-01) return an error.
2. check_attendance_rate
Checks the "80% of all working days" requirement for entitlement.
Design principle: deciding whether a given day belongs in the numerator or is excluded from the
denominator is exactly the value this tool should provide — and exactly where humans and AI callers are
most likely to get it wrong. So the caller does not classify anything. Instead, break the period down into
the following 11 day-count fields and pass them as-is (all required except asOfDate — if a category
doesn't apply, pass 0 explicitly; omitting a field is an error, not an assumed zero):
scheduledWorkingDays must equal the sum of the other 9 fields (everything except
workedOnScheduledDayOffDays). A mismatch is an error — the tool never guesses at a reconciling number.
Based on Labor Standards Act Article 39 paragraph 10 / Article 65, Directive Hakki No. 17 (Sept. 13, 1947), and Directive Kihatsu 0710 No. 3 (July 10, 2013), the tool classifies each field into one of four treatments internally:
- Added to the numerator:
actualWorkedDays,paidLeaveTakenDays,workInjuryOrIllnessLeaveDays,maternityLeaveDays,childcareOrFamilyCareLeaveDays - Ordinary absence (stays in the denominator, not added to the numerator):
otherAbsenceDays - Excluded from total working days (the denominator):
employerCausedSuspensionDays,lawfulLaborDisputeDays,forceMajeureSuspensionDays(Kihatsu 0710 No. 3, Section 1-3) - Not counted at all (never a scheduled working day to begin with):
workedOnScheduledDayOffDays(Kihatsu 0710 No. 3, Section 1-1)
The result's breakdown.classification always includes each field's day count, its resulting treatment,
and the specific legal basis (statute or directive) for that treatment.
3. list_grant_schedule
Same arguments as calculate_entitlement, plus numberOfYears (how many grant occurrences to list).
For long-tenured employees whose early grants have a basis date before the verified floor (2001-04-01),
the call as a whole no longer fails. Those specific grants are returned as supported: false placeholders
(no grant-days figure), while every other grant is computed normally with supported: true. Check the
supported field on each entry.
4. proportional_entitlement
Computes the proportional grant from weekly scheduled days (1–4) or annual scheduled days. Returns an error if weekly scheduled hours are 30 or more, or weekly scheduled days are 5 or more (such workers use the standard table instead).
5. calculate_carryover
grants: array of grant records (grantDate,grantedDays)usageRecords: array of usage records (date,days)asOfDate: the date to evaluate as of
Each grant expires 2 years after its grant date (Labor Standards Act Article 115). Usage is consumed against the oldest grant first (this is common practice, not an explicit statutory rule — follow your work rules if they specify otherwise).
6. check_mandatory_five_days
For employees granted 10 or more days of annual paid leave, determines compliance with the employer's obligation to have the employee use 5 days within 1 year of the grant date (Labor Standards Act Article 39, paragraphs 7–8). Days taken at the employee's own request, or via a planned-leave scheme, count against the 5-day requirement.
This obligation itself was introduced by an amendment that took effect on April 1, 2019. If the grant
date (grantDate) is earlier than that, the tool reports the employee as not subject to the rule
regardless of the number of days granted, since the obligation did not yet exist.
7. apply_company_policy
Pass legalMinimumDays (the statutory minimum computed by another tool) and companyPolicyDays
(optional — your company's policy value). If the company policy falls short of the statutory minimum, the
result is automatically corrected to the statutory minimum, with a warning.
The meta field on every response
Every tool response includes a meta block, separate from the statutory calculation itself:
dataVerifiedOn: the date this server's data was last checked against primary sources.rulesUsed: the rules actually used to compute this response, with their effective date (only when verified) and source URL.staleWarning: a bilingual (Japanese/English) warning message when either of the following applies (otherwisenull):- more than 6 months have passed since
dataVerifiedOn(compared against the actual current time), or - the calculation-target date is more than 2 years past the verification date (a legal amendment may have occurred by then).
- more than 6 months have passed since
Versioning policy
- Any update to statutory data (grant-days tables, proportional-grant table, eligibility requirements, etc.) bumps the minor version (e.g. 1.1.0 → 1.2.0). Patch versions are reserved for bug fixes and documentation.
- Any breaking change to a tool's arguments (adding/removing/changing the meaning of a parameter such that existing callers break) bumps the major version (e.g. 1.3.0 → 2.0.0).
- Statutory data and spec changes are recorded in CHANGELOG.md, noting when and which amendment or change was addressed.
- Past legal amendments accumulate as "rule generations with an effective date." Existing generations are never rewritten — a new generation is added instead, so past-period results remain unaffected.
Maintenance policy
- The maintainer intends to update
src/leaveRules.tswhenever the Labor Standards Act, its enforcement regulations, or related MHLW notices/directives are amended. Since this server never makes network calls at runtime, reflecting an amendment requires a manual update. - If you are aware of a legal amendment (its effective date and what changed), please report it via GitHub Issues: https://github.com/skypier-jp-works/mcp-jp-paid-leave/issues
- Before making an important labor/HR decision, check
meta.dataVerifiedOnandmeta.staleWarning, and consult the latest law or a qualified professional as needed.
Sources (primary references)
The statutory rules were implemented after actually retrieving and checking the following primary sources
— not from memory (last checked: 2026-07-28). If these figures change due to a legal amendment,
src/leaveRules.ts must be updated manually (this server never makes network calls at runtime).
- Labor Standards Act, current text (Article 39 paragraphs 1, 2, 3, 7, 8, 10; Article 13; Article 115; Article 120): e-Gov Japanese Law Search https://laws.e-gov.go.jp/law/322AC0000000049
- Introduction, effective date (1999-04-01), and transitional schedule (through 2001-03-31) of the standard grant-days table: Act to Partially Amend the Labor Standards Act (Act No. 112 of 1998), Supplementary Provisions Articles 1 and 135 https://www.shugiin.go.jp/internet/itdb_housei.nsf/html/housei/h143112.htm
- Proportional grant requirements and table (Appended Table 1): Ordinance for Enforcement of the Labor Standards Act, Article 24-3 https://laws.e-gov.go.jp/law/322M40000100023
- Deemed-attendance treatment of days of paid leave taken: Directive Hakki No. 17, September 13, 1947 https://www.mhlw.go.jp/web/t_doc?dataId=00tb1896&dataType=1&pageNo=1
- Days excluded from total working days: Directive Kihatsu 0710 No. 3, July 10, 2013 https://www.mhlw.go.jp/web/t_doc?dataId=00tb9536&dataType=1&pageNo=1
- Requirements for the uniform basis-date practice ("seiitsu-teki toriatsukai") / split grants: Directive Kihatsu No. 1, January 4, 1994 https://www.mhlw.go.jp/web/t_doc?dataId=00tb1911&dataType=1&pageNo=1
- Introduction and effective date (2019-04-01) of the mandatory 5-day rule: Act on Arrangement of Related Acts to Promote Work Style Reform (Act No. 71 of 2018), Supplementary Provisions Articles 1 and 4 https://www.shugiin.go.jp/internet/itdb_housei.nsf/html/housei/19620180706071.htm (MHLW's explanatory leaflet is also provided for reference) https://www.mhlw.go.jp/content/001140963.pdf
Unverified items (honest disclosure)
- When the proportional grant table took its current form has not been confirmed. Its values match
the current e-Gov text, but no effective date is asserted (see
PROPORTIONAL_GRANT_TABLEinsrc/leaveRules.ts). - Whether the 80% attendance threshold or the 2-year prescription period have ever changed since enactment has not been checked — only that they match the current statutory text.
- The 2-year prescription period (Labor Standards Act Article 115) does not name "annual paid leave" in its text. It is a general rule ("claims other than wage claims: 2 years"); that paid-leave claims fall under it rests on administrative interpretation and established practice, not an explicit statutory reference.
- The exact grant-days figures that applied before 2001-04-01 (including during the 1999–2001 transitional period) have not been verified. Calculations for that period return an error.
Setup
1. Requirements
- Node.js (LTS recommended)
2. Install dependencies
3. Build
This produces build/index.js.
Using it from Claude Desktop
Add the following to your Claude Desktop config file (claude_desktop_config.json):
Config file location:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Restart Claude Desktop afterward to make tools like calculate_entitlement available.
Running tests
38 automated tests cover all functionality:
All lines should show ✔ (pass).
Project structure
Related tools
Other MCP servers by the same author:
- mcp-jp-calendar — calculates Japanese business days, national holidays, gotobi settlement days, and fiscal quarters
- mcp-jp-corporate-id — validates and normalizes Japanese corporate numbers and qualified invoice registration numbers
License
来源:README.md,提交 6ecb2fb
工具
0版本历史
1- v1.0.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分