malaysia-payroll-mcp
It calculates Malaysian payroll statutory deductions for one employee and returns cited, source-backed results.
calculate_epf: works out employee and employer EPF contributions from the EPF Third Schedule using salary, age, citizenship, and pay period; supports pre-1 Aug 1998 non-Malaysian registration.calculate_socso_eis: works out SOCSO, SKBBK, and EIS contributions from PERKESO tables using salary, age, citizenship, SKBBK status, and the EIS 57–59 exception.The README also documents
calculate_mtdfor MTD/PCB income tax (resident formula or non-resident flat 30%) andcalculate_net_payfor net pay, employer contributions, and total cost.Results include the pay period, citations, explanations, and a disclaimer; rate tables are exposed as read-only resources.
Fixed monthly salaries only: overtime, commission, bonuses, arrears, and zakat are not supported.
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., "@malaysia-payroll-mcp Calculate EPF, SOCSO, EIS and PCB for a resident employee on RM5,000 a month"
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.
malaysia-payroll-mcp
An MCP server that works out Malaysian statutory payroll deductions (EPF, SOCSO, SKBBK, EIS and MTD/PCB) for one employee's monthly salary, and cites the official rate table or rule behind every number.
Status: pre-release. EPF, SOCSO, SKBBK, EIS, MTD, net pay and the 35-case two-layer agent eval are in. Tagged releases are on GitHub, with changes listed in the changelog; nothing is published to npm yet.
Tools
Tool | What it works out |
| EPF employee and employer contributions, from the Third Schedule in effect |
| SOCSO, SKBBK (Lindung 24 Jam) and EIS contributions, from the PERKESO tables in effect |
| MTD (PCB) income tax deduction: LHDN's formula with the working shown for a tax resident, or the flat 30% for a non-resident ( |
| One month's payslip: every deduction above, net pay, and the employer's contributions and total cost. Runs the three calculators in one call and feeds the employee EPF into MTD |
Every result echoes the pay period it used (the current month in Malaysia if you don't pass one), and carries citations, an explanation rendered from them, and a disclaimer.
Related MCP server: cukaimax-tax-authority
Resources
Every rate table the tools read is also a read-only resource, as JSON with amounts in sen: payroll://tables/{kind}/{effectiveFrom}, where kind is epf, socso, skbbk, eis or mtd (LHDN's tax schedule). For example, payroll://tables/epf/2025-10-01 is the EPF Third Schedule from 1 Oct 2025. resources/list shows them all, and the template completes both parts.
Not tax advice, and not verified by KWSP, PERKESO or LHDN. Fixed monthly salaries only: overtime, commission, bonuses and arrears aren't supported, and neither is zakat.
Install
Nothing is on npm yet, so build from source. You need Node 24 or later and pnpm.
git clone https://github.com/davidyapcc/malaysia-payroll-mcp.git
cd malaysia-payroll-mcp
pnpm install
pnpm buildUsage
The server runs over stdio. Replace /absolute/path/to with where you cloned it.
Claude Code:
claude mcp add malaysia-payroll -- node /absolute/path/to/malaysia-payroll-mcp/dist/entry/stdio.jsClaude Desktop, in claude_desktop_config.json:
{
"mcpServers": {
"malaysia-payroll": {
"command": "node",
"args": ["/absolute/path/to/malaysia-payroll-mcp/dist/entry/stdio.js"]
}
}
}Example
Calling calculate_epf with these arguments:
{ "monthlySalary": 5000, "age": 34, "citizenship": "malaysian", "payPeriod": "2026-10" }returns the following (amounts in RM, output from a real run):
{
"payPeriod": "2026-10",
"monthlySalary": 5000,
"part": "A",
"employee": 550,
"employer": 650,
"total": 1200,
"citations": [
{
"item": "EPF",
"employee": 550,
"employer": 650,
"rule": "Part A applies to Malaysians, permanent residents and non-Malaysians registered before 1 Aug 1998, under 60. Up to RM20,000 the schedule's band amounts apply.",
"tableRow": "Part A, RM4,980.01 to RM5,000.00",
"source": {
"title": "EPF Act 1991, Third Schedule (from 1 October 2025)",
"url": "https://www.kwsp.gov.my/documents/d/guest/third_schedule_from_-1-october-2025",
"retrieved": "2026-10-23"
},
"effectiveFrom": "2025-10-01"
}
],
"explanation": "EPF: employee RM550.00, employer RM650.00. Part A applies to Malaysians, permanent residents and non-Malaysians registered before 1 Aug 1998, under 60. Up to RM20,000 the schedule's band amounts apply. Table row: Part A, RM4,980.01 to RM5,000.00. Source: EPF Act 1991, Third Schedule (from 1 October 2025), in effect from 2025-10-01.",
"disclaimer": "Not tax or legal advice, and not verified by KWSP, PERKESO or LHDN. Fixed monthly salaries only: overtime, commission, bonuses and arrears are not supported. Check results against the cited source."
}Docs
Architecture: structure, stack and key decisions
Glossary: the domain terms used in code and docs
Official sources, with effective and retrieval dates
Golden test cases, worked by hand from those sources
Rate tables as CSV, the source of truth for every lookup
Development
Needs Node 24 or later and pnpm (the version is pinned in package.json).
pnpm install
pnpm check # generated tables, Biome lint and format check, tsc, Vitest
pnpm gen:tables # regenerate src/tables/generated/ after editing docs/data/
pnpm test:coverage # tests with v8 coverage
pnpm eval # run 35-case two-layer agent eval (requires ANTHROPIC_API_KEY or OPENAI_API_KEY)
pnpm build # compile to dist/To change a rate, edit or add a CSV in docs/data/ (with its entry in docs/data/sources.json), run pnpm gen:tables and commit both. Never edit src/tables/generated/ by hand: CI rejects it (ADR 0003).
pnpm eval loads .env automatically if present and writes evals/results/scorecard.json and evals/results/scorecard.md:
Set
ANTHROPIC_API_KEYto run with Claude (claude-haiku-4-5by default).Or set
OPENAI_API_KEYto run with OpenAI (gpt-4o-miniby default; override provider withEVAL_PROVIDER=openai|anthropicand models withEVAL_AGENT_MODEL/EVAL_JUDGE_MODEL).
Licence
Available Tools
4 toolscalculate_epfCalculate EPF (KWSP) contributionsARead-only
Works out the monthly EPF (KWSP) employee and employer contributions for one employee in Malaysia, from the EPF Third Schedule in effect for the pay period, and cites the band used. Fixed monthly salaries only. Include the result's disclaimer in the answer to the user.
Inputs: age (required), citizenship (required), monthlySalary (required), payPeriod, +1 more. Returns: part, total, employee, employer, +5 more
calculate_mtdCalculate MTD (PCB) income tax deductionARead-only
Works out the monthly tax deduction (MTD, also called PCB) for one employee in Malaysia. For a tax resident it uses LHDN's computerised formula, from the schedule in effect for the pay period, and shows the working; for a non-resident it applies the flat 30%. Fixed monthly salaries and standard reliefs only (individual, spouse, children, EPF, plus a TP1 total); no bonuses or zakat. Include the result's disclaimer in the answer to the user.
Inputs: epfEmployee (required), monthlySalary (required), children, payPeriod, +4 more. Returns: mtd, working, children, citations, +7 more
calculate_net_payCalculate net pay (payslip)ARead-only
Works out one month's payslip for one employee in Malaysia: EPF, SOCSO, SKBBK, EIS and MTD (PCB) deductions, net pay, and the employer's contributions and total cost. Runs the same calculations as calculate_epf, calculate_socso_eis and calculate_mtd, feeding the employee EPF into MTD, and cites the source of every line. For a non_malaysian employee, say whether they are tax resident (taxResident). Fixed monthly salaries and standard reliefs only; no bonuses or zakat. Include the result's disclaimer in the answer to the user.
Inputs: age (required), citizenship (required), monthlySalary (required), children, +8 more. Returns: basis, netPay, citations, payPeriod, +6 more
calculate_socso_eisCalculate SOCSO, SKBBK and EIS contributionsARead-only
Works out the monthly SOCSO (PERKESO, Act 4), SKBBK (Lindung 24 Jam) and EIS (Act 800) contributions for one employee in Malaysia, from the PERKESO tables in effect for the pay period, and cites the row used for each. Fixed monthly salaries only. Include the result's disclaimer in the answer to the user.
Inputs: age (required), citizenship (required), monthlySalary (required), payPeriod, +2 more. Returns: eis, skbbk, socso, totals, +6 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
The three component calculators (MTD, EPF, SOCSO/EIS) are clearly distinct, while calculate_net_pay is an aggregate that intentionally overlaps with all of them. The descriptions explain this hierarchy, but an agent could still hesitate between using the full payslip tool and a specific component tool.
All tools follow the same calculate_<subject> snake_case pattern. Acronyms and compound subjects like socso_eis are used consistently and remain readable.
Four tools is well scoped for a focused Malaysian payroll calculator. Each tool covers a distinct statutory calculation or the aggregate payslip, so no tool feels redundant.
The surface covers the core monthly payroll calculations: EPF, SOCSO, SKBBK, EIS, MTD, and net pay with employer contributions. Minor gaps remain because bonuses, zakat, and non-fixed salary scenarios are explicitly excluded, but these are reasonable scope limits for the stated tool set.
Maintenance
Related MCP Connectors
Malaysian take-home pay estimates: EPF, SOCSO, EIS, LINDUNG 24 Jam and PCB, with dated rules.
Source-linked Malaysian individual and sole-proprietor tax guidance for AI agents.
Gross-to-net pay and employer cost for US, PH, NG, ID, IN, BR, KE, VN with official sources.
31Verified, cited US and Canadian employment and payroll rules, each value with its official source.
Related MCP Servers
- AlicenseAqualityCmaintenanceTaiwan statutory payroll calculation — labor & health insurance, labor pension, 2nd-gen NHI supplementary premium, income-tax withholding, and old-age benefits. Sourced from official gazettes, verified against official sample data.92MIT
- AlicenseAqualityCmaintenanceCukaiMax Tax Authority is an MCP server that gives AI agents source-linked Malaysian individual tax information and deterministic draft preparation checks for YA2025 Form BE/B and YA2026 planning, via a public read-only Streamable HTTP endpoint.5MIT
- AlicenseNot gradedqualityBmaintenanceComputes Japanese payroll, social insurance, and labour law obligations—such as premiums, withholding tax, and minimum wage—citing the statute each answer relies on, enabling auditable calculations through an AI assistant.3MIT
- AlicenseNot gradedqualityBmaintenanceEnables local-first HR payroll computation with statutory social insurance, housing fund, and cumulative IIT calculations, adaptable to arbitrary spreadsheet headers via import adapters and company profiles. Supports safe performance formula evaluation and keeps PII on-device.MIT