Skip to main content
Glama
malaysia-payroll-mcp

malaysia-payroll-mcp

by davidyapcc

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

calculate_epf

EPF employee and employer contributions, from the Third Schedule in effect

calculate_socso_eis

SOCSO, SKBBK (Lindung 24 Jam) and EIS contributions, from the PERKESO tables in effect

calculate_mtd

MTD (PCB) income tax deduction: LHDN's formula with the working shown for a tax resident, or the flat 30% for a non-resident (taxResident: false). Standard reliefs only (individual, spouse, children, EPF, plus a TP1 total)

calculate_net_pay

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 build

Usage

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.js

Claude 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

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_KEY to run with Claude (claude-haiku-4-5 by default).

  • Or set OPENAI_API_KEY to run with OpenAI (gpt-4o-mini by default; override provider with EVAL_PROVIDER=openai|anthropic and models with EVAL_AGENT_MODEL / EVAL_JUDGE_MODEL).

Licence

MIT

Available Tools

4 tools
calculate_epfCalculate EPF (KWSP) contributionsA
Read-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 deductionA
Read-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)A
Read-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 contributionsA
Read-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

    A4.1/5.0

    Scored across 4 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    All tools follow the same calculate_<subject> snake_case pattern. Acronyms and compound subjects like socso_eis are used consistently and remain readable.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Taiwan 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.
      9
      2
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      CukaiMax 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.
      5
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Computes 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.
      3
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables 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