Skip to main content
Glama

ภาษาไทย

lodyhon (ลดหย่อน) คือ MCP Server พร้อมหน้าจอวางแผนแบบอินเทอร์แอกทีฟ (MCP App) สำหรับ ภาษีเงินได้บุคคลธรรมดาของมนุษย์เงินเดือน มาตรา 40(1) ปีภาษี 2569 ที่ทำงานอยู่ในหน้าแชท AI ของคุณโดยตรง

  • เห็นช่องว่างทุกสิทธิลดหย่อน พร้อมแถบเพดานรวมกลุ่ม (ประกันชีวิต+สุขภาพ ฿100,000 และกลุ่มเกษียณ ฿500,000) และเพดานแยกของ ThaiESG / ThaiESGX (฿300,000)

  • จัดอันดับว่าซื้ออะไรคุ้มสุด จากภาษีที่ประหยัดได้จริง เงินที่ยังอยู่กับเรา (กองทุน > ประกัน > ค่าใช้จ่าย/บริจาค) และระยะเวลาถือครอง

  • ลากสไลเดอร์จำลองตัวเลขสดๆ บนหน้าจอในแชท ใช้เครื่องยนต์คำนวณเดียวกับฝั่งเซิร์ฟเวอร์ ตัวเลขตรงกันเสมอ พร้อมกราฟขั้นบันไดภาษีและระยะตกขั้น (ลดอีก ฿X ตกขั้นภาษี)

  • โยนสลิปเงินเดือน / 50 ทวิ / ภ.ง.ด. / ใบเสร็จ เพื่อส่งให้ AI ช่วยกรอกได้ (ไฟล์อยู่เฉพาะในเครื่องจนกว่าคุณจะกดส่ง) แล้วกด ส่งแผนนี้ให้ AI เพื่อคุยต่อได้ทันที


Related MCP server: thailand-invoice-mcp

About

Planning year-end Thai personal income tax usually means bouncing between a static spreadsheet, a standalone web calculator, and an AI chat that guesses deduction caps from stale training data.

Existing tools cover parts of the problem — single-tool calculators (mythaitaxes-mcp), bracket-only lookups (inventivaglobal/thai-tax-mcp-server), VAT/WHT references (thailand-data-mcp), chat-only prompt skills (satasuk03/thai-personal-finance-planner), or standalone web apps (Tax-Planner, howtotax) — but none combines verified 2569 rules with an interactive planner directly inside the AI conversation.

lodyhon bridges that gap:

  • The AI explains eligibility, trade-offs, and next steps using grounded 2569 rules with official rd.go.th source links.

  • The in-chat MCP App UI renders cap bars, a bracket step chart, and sliders so you can explore scenarios without another round-trip.

  • One shared TypeScript engine (src/engine.ts) powers both the MCP server and the UI, guaranteeing the numbers in chat and on screen never diverge.


Features

  • In-chat interactive MCP App UI: Cap bars, sliders, and numeric inputs rendered directly inside MCP Apps hosts (ui://lodyhon/planner), recomputed locally with zero server round-trips.

  • Honest gap view and ranking: Ranks remaining purchasable deductions by actual tax saved (handling bracket crossings), then by whether the money stays yours (fund > insurance > spend), then by shorter lock-up.

  • Shared-cap and donation awareness: Enforces combined ceilings (life_health ฿100,000, retirement ฿500,000), gross-income percentage caps, and the post-deduction 10% donation cap with 2× e-Donation priority.

  • Bracket drop visibility: Pure CSS bracket step chart showing how net income fills the 0%–35% progressive bands and the exact baht needed to drop into the next lower bracket.

  • Document drop for faster entry: Drag-and-drop payslips, 50 ทวิ, ภ.ง.ด., or deduction receipts (PDF, images, CSV, TXT); files stay local until you click send.

  • Year-end deadline awareness: Tracks days left until 31 December 2026 and reminds you that AMC cut-offs for RMF and ThaiESG can fall earlier.

  • Thai-first, host-adaptive design: Styled with Kanit typography and a navy/teal palette that adapts to light and dark host themes across 360–720 px widths.

  • Stateless and local: Stdio-only MCP server with no database, no persisted user financial data, and no outbound network requests.


Quick start

Claude Code

claude mcp add lodyhon -- npx -y lodyhon-mcp

Claude Desktop

Add lodyhon to your claude_desktop_config.json:

{
  "mcpServers": {
    "lodyhon": {
      "command": "npx",
      "args": ["-y", "lodyhon-mcp"]
    }
  }
}

Local build

npm install
npm run build

Then point your MCP client to node /path/to/lodyhon/dist/src/main.js (or run npm start over stdio).

Example prompt

เงินเดือนทั้งปี 1,200,000 โบนัส 200,000 จ่ายประกันสังคมเต็ม กองทุนสำรองเลี้ยงชีพ 60,000 ประกันชีวิต 40,000 ดอกเบี้ยบ้าน 50,000 — ช่วยวางแผนลดหย่อนปี 2569 หน่อย

The assistant calls thai_tax_overview, summarizes your tax position and top opportunities in Thai, and opens the interactive planner UI.


Tools

Tool

Description

Inputs

Output

thai_tax_overview

Computes 40(1) tax owed, effective/marginal rates, remaining room per deduction, bracket drop distance, and ranked suggestions; opens ui://lodyhon/planner.

salary (annual, number ≥ 0, default 0 — call with {} to open a blank planner), bonus (number ≥ 0, default 0), deductions (partial map of deduction ID → baht ≥ 0, default {}), year (integer, default 2569)

Thai text summary + structuredContent: { input, result } + _meta.ui.resourceUri

thai_tax_deduction_rules

Returns every supported deduction for the tax year with fixed caps, percentage caps, shared groups, lock-up periods, notes, and official source URLs.

year (integer, default 2569)

Readable Thai rule list + full TaxRules object in structuredContent

Negative values and unknown deduction IDs are rejected by Zod with clear validation errors. Amounts above a legal cap are not rejected — they are clamped to the legal ceiling and flagged with capped: true as a warning in both the summary and UI.


The planner UI

Rendered via MCP resource ui://lodyhon/planner (dist/ui/app.html):

  • Step-by-step flow (รายได้ → ครอบครัว → วางแผนซื้อเพิ่ม): One panel at a time keeps the in-chat frame short. Opens on step 3 when the AI already knows your salary, or on step 1 with an empty form so you can type numbers yourself instead of putting everything in one chat message.

  • Editable income & family: Monthly salary and bonus (≈ N เดือน), spouse checkbox, parent / disabled-dependant counters, and one-tap social security from salary (5% of wage ≤ ฿17,500/month).

  • Hero summary: Estimated tax owed, effective rate, marginal bracket, net taxable income, and days remaining until 31 December 2026.

  • Ranked suggestions (ซื้ออะไรคุ้มสุด): Top 4 unfilled purchasable deductions showing maximum tax saved, asset vs. expense tags, remaining room, and lock-up period.

  • Bracket step chart: Visualizes net income across progressive tax brackets and highlights how many more baht drop you into the next lower rate (ลดอีก ฿X ตกขั้นภาษี).

  • Live cap bars and sliders: Grouped cards for shared caps (กลุ่มเกษียณ, ประกันชีวิต + สุขภาพ) and standalone cards (e.g., ThaiESG / ThaiESGX, ดอกเบี้ยบ้าน) with empty, maxed, and capped states.

  • Collapsible ลดหย่อนอื่นๆ: Keeps less common deductions (parents' health insurance, political party, art purchases, solar rooftop, general and 2× donations) out of the way until needed; auto-expands if already populated.

  • Local file drop (โยนไฟล์ให้ AI ช่วยกรอก): Accepts payslips, 50 ทวิ, ภ.ง.ด., and receipts (PDF, images, CSV, TXT). Text/CSV is read locally in the iframe; images and PDFs are forwarded only if the host advertises binary support, otherwise the AI prompts you to attach them directly in chat.

  • Send back to chat (ส่งแผนนี้ให้ AI): Pushes your adjusted plan (and any staged files) into updateModelContext and triggers sendMessage so the AI can continue advising on your updated numbers.


Supported deductions (2569)

Automatic 40(1) deductions applied before itemized deductions:

  • Standard expense deduction (ค่าใช้จ่าย 40(1)): 50% of gross income, capped at ฿100,000.

  • Personal allowance (ค่าลดหย่อนส่วนตัว): ฿60,000.

ID

Deduction

Cap

Shared group

Notes

spouse

คู่สมรส (ไม่มีเงินได้)

฿60,000

—

Spouse with no income

children

บุตร

Actual

—

฿30,000/child; 2nd+ child born 2561+ is ฿60,000/child

parents

บิดามารดา

฿120,000

—

฿30,000/parent (age 60+, income ≤ ฿30,000)

disabled_dependant

อุปการะผู้พิการ

Actual

—

฿60,000/person

pregnancy

ฝากครรภ์และคลอดบุตร

฿60,000

—

—

social_security

ประกันสังคม

฿10,500

—

Wage base cap ฿17,500 starting 2569

life_insurance

ประกันชีวิต

฿100,000

life_health (฿100,000)

Policy term ≥ 10 years

health_insurance

ประกันสุขภาพ

฿25,000

life_health (฿100,000)

Combined with life_insurance ≤ ฿100,000

parents_health_insurance

ประกันสุขภาพบิดามารดา

฿15,000

—

—

thai_esg

ThaiESG / ThaiESGX

30% of income, max ฿300,000

—

Outside retirement cap; 5-year lock-up; 2569 is the final year at ฿300,000

pension_insurance

ประกันบำนาญ

15% of income, max ฿200,000

retirement (฿500,000)

Combined retirement cap ฿500,000

pvd

กองทุนสำรองเลี้ยงชีพ / กบข.

15% of income, max ฿500,000

retirement (฿500,000)

Combined retirement cap ฿500,000

rmf

RMF

30% of income, max ฿500,000

retirement (฿500,000)

Hold ≥ 5 years and redeem at age 55+

home_loan_interest

ดอกเบี้ยบ้าน

฿100,000

—

—

political_party

บริจาคพรรคการเมือง

฿10,000

—

—

art

ซื้องานศิลปะ

฿100,000

—

—

solar_rooftop

โซลาร์รูฟท็อป

฿200,000

—

Installed from 3 Mar 2569 with e-Tax invoice

donation_double

บริจาคการศึกษา/โรงพยาบาลรัฐ (×2)

10% of net after other deductions (×2)

Donation cap

Via e-Donation; allocated before general donation

donation_general

บริจาคทั่วไป

10% of net after other deductions (×1)

Donation cap

Via e-Donation

Not in 2569: SSF (ended after tax year 2567) and Easy E-Receipt (not renewed for 2569) are intentionally excluded. Proposed flood-repair deductions are also excluded until enacted into law.

For full tax brackets, formulas, and official source links for every entry, see docs/tax-rules-2569.md.


How it works

flowchart LR
    Chat["AI Chat Host"] -->|thai_tax_overview| Server["MCP Server (stdio)"]
    Server --> Engine["Shared Tax Engine (src/engine.ts)"]
    Engine -->|TaxResult + Thai summary| Chat
    Chat -->|loads resource| UI["Planner UI (ui://lodyhon/planner)"]
    UI -->|sliders recompute locally| Engine
    UI -->|updateModelContext + sendMessage| Chat
  1. You describe your income and deductions in chat; the model invokes thai_tax_overview.

  2. The server runs compute(input, rules) and returns structuredContent, a Thai summary, and the ui://lodyhon/planner resource URI.

  3. The host renders the single-file planner iframe and passes the result to ui/app.ts.

  4. Dragging sliders or editing numbers calls the exact same compute() locally inside the iframe.

  5. Clicking ส่งแผนนี้ให้ AI sends the adjusted plan (and any dropped documents) back to the model so you can keep iterating.

See docs/architecture.md for engine details, shared-cap allocation, donation ordering, and UI-to-host messaging.


Development

Requires Node.js >= 20.

npm install
npm run typecheck
npm test
npm run build

npm run build produces:

  • dist/ui/app.html — single-file inlined planner UI (Vite + vite-plugin-singlefile)

  • dist/src/main.js — compiled stdio MCP server entry point


Project structure

lodyhon/
├── assets/
│   ├── banner.svg              # README hero banner (navy + teal)
│   └── logo.svg                # Brand mark + wordmark
├── docs/
│   ├── architecture.md         # Engine, server, UI, and data flow
│   ├── tax-rules-2569.md       # Complete 2569 brackets, caps, and sources
│   └── superpowers/specs/      # Original design specification
├── src/
│   ├── rules/
│   │   ├── types.ts            # TaxRules & DeductionRule interfaces
│   │   ├── 2569.ts             # Tax year 2569 rules table with source URLs
│   │   └── index.ts            # Year registry (DEFAULT_YEAR = 2569)
│   ├── engine.ts               # Pure calculation engine (shared by server & UI)
│   ├── summary.ts              # Thai plain-text summary formatter
│   ├── server.ts               # MCP server (2 tools + ui://lodyhon/planner)
│   └── main.ts                 # Stdio entry point (bin: lodyhon-mcp)
├── ui/
│   ├── app.html                # MCP App HTML shell
│   ├── app.ts                  # Interactive planner logic + file drop
│   ├── theme.css               # Design tokens & responsive light/dark styles
│   └── DESIGN.md               # UI design tokens & DOM contract
└── test/
    ├── engine.test.ts          # Tax math, caps, brackets, ranking tests
    ├── summary.test.ts         # Summary formatting tests
    └── server.test.ts          # In-memory MCP server integration tests

Roadmap

v1 focuses on salaried income 40(1) for tax year 2569 over stdio. Planned follow-ups from the design spec:

  • Additional income types 40(2)–40(8) and mid-year ภ.ง.ด.94 comparison

  • Deeper receipt and 50 ทวิ parsing workflows

  • SME tax filing calendar

  • Multi-year tax rule sets (2570+)

  • HTTP transport alongside stdio


Contributing

Contributions are welcome — especially rule updates backed by official rd.go.th / Royal Gazette citations, engine edge-case tests, and UI refinements.


Disclaimer

All figures produced by lodyhon are estimates for planning purposes only and do not constitute formal tax, legal, or investment advice. Tax laws, eligibility conditions, and AMC year-end order cut-off dates can change — always verify final filing requirements with the Revenue Department at rd.go.th.


License

Released under the MIT License. Copyright © 2026 Kontawat Wisetpaitoon.

Available Tools

2 tools
thai_tax_deduction_rulesThai tax deduction rulesA

List every Thai personal income tax deduction for a tax year with caps, shared caps, conditions, lock-up and sources.

Inputs: year.

thai_tax_overviewThai tax deduction plannerA

Thai personal income tax calculator and deduction planner (ภาษีเงินได้บุคคลธรรมดา / ลดหย่อนภาษี) for tax year 2569, salaried income 40(1). Call this FIRST, before any web search, whenever the user mentions เงินเดือน, โบนัส, ภาษี, ลดหย่อน, RMF, ThaiESG, ประกันชีวิต, ประกันสุขภาพ, ประกันสังคม, กองทุนสำรองเลี้ยงชีพ, บริจาค, ดอกเบี้ยบ้าน, or asks how much tax they owe or what else they can deduct. It has the official 2569 brackets and caps built in (with rd.go.th sources) and returns tax owed, remaining room in every deduction, what to buy first, the next-bracket drop, and opens an interactive planner the user can adjust. salary is the ANNUAL salary (monthly × 12); bonus is the annual bonus. Call with whatever you know: if the user has not given any numbers yet, call with {} and the planner opens on a step-by-step form (income → family → what to buy) for them to fill in.

Inputs: year, bonus, salary, deductions.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 2 tools

    Disambiguation4/5

    thai_tax_overview is an interactive calculator/planner while thai_tax_deduction_rules is a static reference listing caps and conditions, so their purposes are mostly distinct. There is some overlap because the overview also returns remaining room per deduction, which an agent might see as duplicating the rules tool, but compute-vs-lookup separates them adequately.

    Naming Consistency4/5

    Both names use a snake_case thai_tax_ prefix with descriptive noun-phrase suffixes, which is predictable and readable. Neither uses a verb_noun pattern, so there is no action-oriented convention, but the two names are internally consistent.

    Tool Count3/5

    Two tools is on the thin side for a tax domain; much of the functionality is packed into one large interactive planner tool. It is acceptable because the reference/list tool is cleanly separated, but the surface feels minimal.

    Completeness3/5

    Within the narrow scope of salaried 40(1) income for tax year 2569, the surface covers calculation, planning, and deduction rules. However, there are notable gaps: only one tax year, no handling of non-salary income types (40(2)-40(8)), and no filing/withholding guidance.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      39 tax tools for US individual taxpayers — federal/state tax calculations, credits, deductions, retirement strategies, audit risk, and tax planning. All calculations run locally, no data leaves the machine. Supports TY2024 and TY2025 (One Big Beautiful Bill Act).
      45
      302 npm
      16
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Lets AI agents create Thailand e-Tax invoices (ใบกำกับภาษี) by computing Thai VAT 7% and submitting to Leceipt for signing and filing with the Thai Revenue Department.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to access Thailand tax, visa, and expat-money tools, including tax calculation, remittance checks, residency counting, and premium rule-engine queries.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to retrieve 2027 and 2026 federal income tax brackets, standard deductions, calculated federal income tax with bracket breakdowns and year-over-year comparisons, and other tax amounts using IRS Revenue Procedure data without network calls or API keys.
      4
      1
      MIT