MCP server overview
what is the project?
Sri Lanka Salary Calculator is a source-backed reference implementation for estimating regular primary-employment payslips in Sri Lanka (2026/27 basis). It computes monthly APIT/PAYE, employee and employer EPF, employer ETF, stamp duty, net pay, and total employer cost, and provides machine-readable references, methodology, and tested examples.
how to use the project?
- Try the hosted developer UI: https://buddhima-jd3.github.io/sri-lanka-salary-calculator/ or the public calculator at https://mypayslip.lk/
- Call the read-only API: curl “https://mypayslip.lk/api/calc?salary=200000”
- Run locally: node examples/calculate.mjs 200000
- Install from the repository or npm (when released): npm install github:Buddhima-JD3/sri-lanka-salary-calculator
- Use as a library: import { calculateSalary } from “sri-lanka-salary-calculator”; const result = calculateSalary({ grossSalary: 200000, epfEtfEarningsBase: 200000 });
- Run the MCP server for AI assistant integration: npm run mcp or docker run ghcr.io/buddhima-jd3/sri-lanka-payslip-mcp:2026.27.2
key features
- Dependency-free reference calculator (calculator.mjs)
- Calculates APIT/PAYE, employee EPF (8%), employer EPF (12%), employer ETF (3%), stamp duty, net pay, and employer cost
- Hosted browser calculator and embeddable widget
- Public read-only API and OpenAPI 3.1 spec
- Machine-readable methodology, test cases, and archived source
- Model Context Protocol (MCP) server exposing tools for AI assistants (calculate_sri_lanka_payslip, get_sri_lanka_payroll_reference, get_sri_lanka_payslip_checklist)
- Privacy-minded: hosted calculator runs in-browser; public API does not store salary inputs
use cases
- Estimate net pay and employer cost for payroll budgeting
- Generate or validate payslips for employees
- Embed a salary calculator widget into websites
- Integrate payroll checks into HR or accounting tooling
- Provide an AI assistant with a verifiable payslip calculation tool via MCP
- Educational/reference use for tax and payroll training
FAQ from the project
- Is this authoritative payroll or legal advice?
No. Results are estimates based on published sources and methodology; consult professionals for legal or tax advice.
- Does the service store my salary inputs?
No. The hosted calculator runs in the browser and the public calculation API is read-only and does not retain inputs.
- How accurate are the calculations?
Calculations follow published Inland Revenue and other official sources for the Sri Lanka 2026/27 assessment and include test cases; unusual payroll scenarios may need different tables or professional review.
- Can I run this locally or integrate it into agents?
Yes. The code is available to run locally (node example) and as an MCP server for AI agent integration (container or npm start).
- Where are the sources and methodology?
The repository links to Inland Revenue tax tables, EPF/ETF guidance, an OpenAPI spec, and a published calculation methodology and test cases.