Listed from the MCP registry; nobody on Odel publishes it.

MCP server: One MCP server.

Malaysia Payroll

@davidyapccMCP server · External

Statutory deductions and employer contributions in Malaysia (EPF, SOCSO, SKBBK, EIS, MTD/PCB), cited

Payrollv0.3.0MITTypeScript
Freeno charge per call

Runs on your machine from its package; the steps are below.

What it does

  1. Reads
  2. Writes
  3. High impact

At most: only reads or looks up information.

What it costs

Free

Odel charges nothing per call. The publisher may charge for its own service.

Runs locally over stdio

This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).

npmmalaysia-payroll-mcpv0.3.0

Run

npx -y malaysia-payroll-mcp

MCP client config

{
  "mcpServers": {
    "malaysia-payroll": {
      "command": "npx",
      "args": [
        "-y",
        "malaysia-payroll-mcp"
      ]
    }
  }
}
README6 min read

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

ToolWhat it works out
calculate_epfEPF employee and employer contributions, from the Third Schedule in effect
calculate_socso_eisSOCSO, SKBBK (Lindung 24 Jam) and EIS contributions, from the PERKESO tables in effect
calculate_mtdMTD (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_payOne 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.

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.

sh
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:

sh
claude mcp add malaysia-payroll -- node /absolute/path/to/malaysia-payroll-mcp/dist/entry/stdio.js

Claude Desktop, in claude_desktop_config.json:

json
{
  "mcpServers": {
    "malaysia-payroll": {
      "command": "node",
      "args": ["/absolute/path/to/malaysia-payroll-mcp/dist/entry/stdio.js"]
    }
  }
}

Example

Calling calculate_epf with these arguments:

json
{ "monthlySalary": 5000, "age": 34, "citizenship": "malaysian", "payPeriod": "2026-10" }

returns the following (amounts in RM, output from a real run):

json
{
  "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).

sh
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 eval:local     # same eval on a local model through Ollama, free (needs Ollama running)
pnpm eval:compare   # model comparison: several models over repeated runs (see below)
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|ollama and models with EVAL_AGENT_MODEL / EVAL_JUDGE_MODEL).
  • Or set EVAL_PROVIDER=ollama to run on a local open-weight model with Ollama, with no key and no cost (qwen3:8b by default; OLLAMA_BASE_URL defaults to http://localhost:11434/v1). Pull the model first, for example ollama pull qwen3:8b.
  • With Ollama, <think>...</think> reasoning that some models write into their answer is removed before grading.
  • EVAL_JUDGE_PROVIDER runs the judge on a different provider from the agent, for example a local agent graded by gpt-4o (ADR 0005).

Agent implementations

EVAL_AGENT_IMPL picks the agent under test: loop (default) is the hand-rolled tool loop in evals/runner.ts; agents-sdk is the same agent built on the OpenAI Agents SDK, which discovers and calls this server's tools through its MCP support. It runs on openai or ollama, and is graded by the same checks and judge (ADR 0006).

sh
EVAL_PROVIDER=ollama EVAL_AGENT_IMPL=agents-sdk pnpm eval

Comparing models

pnpm eval:compare runs the whole suite EVAL_COMPARE_RUNS times (default 3) for each model in EVAL_COMPARE_MODELS, grades every model with the one judge named by EVAL_JUDGE_MODEL (required, so rows are comparable), and writes evals/results/comparison-<time>.md and .json: gate passes, Layer 1 pass rate (mean, min and max across runs), must-pass failures, rubric mean over the cases the judge scored, hallucinated citations, agent and judge errors, seeded controls caught, case latency, minutes per run, and the machine's hardware. It reports and never fails on the gate.

sh
# Local agents graded by gpt-4o
EVAL_PROVIDER=ollama EVAL_JUDGE_PROVIDER=openai EVAL_JUDGE_MODEL=gpt-4o \
  EVAL_COMPARE_MODELS="qwen3:8b,llama3.1:8b,qwen3:14b" pnpm eval:compare
# Everything local and free
EVAL_PROVIDER=ollama EVAL_JUDGE_MODEL=qwen3:14b EVAL_COMPARE_MODELS="qwen3:8b,llama3.1:8b" pnpm eval:compare
# The Agents SDK agent in place of the hand-rolled loop
EVAL_PROVIDER=ollama EVAL_AGENT_IMPL=agents-sdk EVAL_JUDGE_MODEL=qwen3:14b EVAL_COMPARE_MODELS="qwen3:8b" pnpm eval:compare

Releasing

Bump version in package.json, server.json (both places) and src/version.ts, update the changelog, merge, then push a tag with the bare version number (for example git tag 0.3.0 && git push origin 0.3.0). .github/workflows/publish.yml checks the versions match, runs pnpm check, publishes to npm through trusted publishing (with provenance, no stored token) and lists the version on the MCP Registry under io.github.davidyapcc/malaysia-payroll-mcp. Then create a GitHub release for the tag from its changelog entry; if any number changed, the release notes say "results changed" (see Versioning).

Licence

MIT

Similar modules

Browse Payroll