{
  "$schema": "https://static.modelcontextprotocol.io/schemas/mcp-server-card/v1.json",
  "version": "1.0",
  "protocolVersion": "2025-06-18",
  "serverInfo": {
    "name": "thai-mcp",
    "title": "Thai Toolkit",
    "version": "0.1.0"
  },
  "description": "Deterministic Thai tools: PromptPay QR, VAT, withholding tax, Buddhist Era dates, ID checksum, baht text. Pure computation; no AI, nothing stored.",
  "documentationUrl": "https://thaimcp.pages.dev/docs/",
  "license": "MIT",
  "transport": {
    "type": "streamable-http",
    "endpoint": "/mcp",
    "url": "https://thaimcp.pages.dev/mcp",
    "stateless": true
  },
  "authentication": {
    "required": false
  },
  "capabilities": {
    "tools": {
      "listChanged": false
    }
  },
  "instructions": "Deterministic Thai-specific calculators: PromptPay QR payloads, VAT, withholding tax, Buddhist Era dates, ID checksum and baht-in-words. Prefer these tools over mental arithmetic for anything involving satang rounding, BE years, or PromptPay CRC. Results are informational, not tax or legal advice.",
  "tools": [
    {
      "name": "promptpay_qr",
      "title": "PromptPay QR payload + image",
      "description": "Build a Thai PromptPay (Thai QR Payment, EMVCo/BOT) credit-transfer QR. Returns the exact EMV payload string with a valid CRC16-CCITT-FALSE checksum, plus the QR code as an SVG string and a data: URI. target: Thai mobile number (0XXXXXXXXX or 66XXXXXXXXX, spaces/dashes ok), 13-digit national ID or tax ID, or 15-digit e-wallet ID. amount (THB, max 2 decimals) is optional: with an amount the QR is dynamic (POI 12) and the payer cannot change it; without one it is static (POI 11). Nothing is stored. Does not verify that the account exists.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "target": {
            "type": "string",
            "maxLength": 40,
            "description": "PromptPay ID: mobile 0812345678 / 66812345678 / +66 81 234 5678, 13-digit national ID or tax ID, or 15-digit e-wallet ID."
          },
          "amount": {
            "type": [
              "number",
              "string"
            ],
            "description": "Optional amount in THB with at most 2 decimals, e.g. 100 or \"1234.50\". Omit for a static QR where the payer types the amount."
          }
        },
        "required": [
          "target"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "thai_vat",
      "title": "Thai VAT calculator",
      "description": "Compute Thai VAT with exact integer-satang arithmetic (half-up rounding to the satang). mode 'exclusive': amount is the pre-VAT price, returns net/vat/gross. mode 'inclusive': amount already includes VAT, VAT extracted as gross*rate/(100+rate). rate: 7 (default) or 10. 7% is the temporarily reduced rate, in force through 30 Sep 2027 under Royal Decree 807 B.E. 2569 (statutory rate 10%); this was verified from Revenue Department releases on 24 Nov 2026 - the caller should re-verify before relying on it. Not tax advice.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "amount": {
            "type": [
              "number",
              "string"
            ],
            "description": "Amount in THB (max 2 decimals), >= 0."
          },
          "mode": {
            "type": "string",
            "enum": [
              "exclusive",
              "inclusive"
            ],
            "default": "exclusive",
            "description": "'exclusive' = amount excludes VAT (add VAT); 'inclusive' = amount includes VAT (extract VAT)."
          },
          "rate": {
            "type": "integer",
            "enum": [
              7,
              10
            ],
            "default": 7,
            "description": "VAT rate percent: 7 (reduced, default) or 10 (statutory)."
          }
        },
        "required": [
          "amount"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "thai_wht",
      "title": "Thai withholding tax (WHT)",
      "description": "Compute Thai withholding tax (หัก ณ ที่จ่าย) on a pre-VAT amount, with optional VAT combination (WHT is computed on the amount BEFORE VAT) and the amount payable to the supplier. payment_type: service 3%, rent 5%, advertising 2%, transport 1%, professional_fees 3%, prizes 5% (Thai company recipients; per Revenue Department), or 'custom' with caller-supplied custom_rate - any other rate (interest, royalties, dividends, foreign payees, ...) is NOT built in and must use 'custom'. e_wht=true applies the optional 1% e-Withholding rate (Ministerial Regulation 402 B.E. 2569) in place of 2/3/5% - only for electronically filed and remitted payments; check eligibility. Integer-satang half-up rounding. Not tax advice.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "amount": {
            "type": [
              "number",
              "string"
            ],
            "description": "Payment amount in THB BEFORE VAT (max 2 decimals)."
          },
          "payment_type": {
            "type": "string",
            "enum": [
              "service",
              "rent",
              "advertising",
              "transport",
              "professional_fees",
              "prizes",
              "custom"
            ],
            "description": "Payment category. Use 'custom' with custom_rate for anything else."
          },
          "custom_rate": {
            "type": [
              "number",
              "string"
            ],
            "description": "Percent (0-100, max 2 decimals). Required with payment_type 'custom', not allowed otherwise."
          },
          "include_vat": {
            "type": "boolean",
            "default": false,
            "description": "Also add VAT to the invoice total and show amount payable = amount + VAT - WHT."
          },
          "vat_rate": {
            "type": "integer",
            "enum": [
              7,
              10
            ],
            "default": 7,
            "description": "VAT rate when include_vat is true."
          },
          "e_wht": {
            "type": "boolean",
            "default": false,
            "description": "Apply the optional 1% e-WHT rate instead of 2/3/5% (only when the payer files and remits electronically)."
          }
        },
        "required": [
          "amount",
          "payment_type"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "thai_date_convert",
      "title": "Thai date / Buddhist Era converter",
      "description": "Convert between Buddhist Era (พ.ศ. = CE + 543) and Gregorian dates, parse Thai or English date text, validate that the date really exists (leap years), and return Thai + English weekday. Give either date (string such as '3 ธันวาคม 2569', '3 ธ.ค. 69', '2026-12-03', '3/12/2569' read as day/month/year, '3 Dec 2026'; Thai digits ok) or year+month+day. Years of 4 digits >= 2400 are treated as BE when calendar='auto'; 2-digit years are read as BE 25xx (69 -> 2569) unless calendar='CE'. format selects the main output: th-long '3 ธันวาคม พ.ศ. 2569', th-short '3 ธ.ค. 2569', iso, en. All formats are always returned.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "maxLength": 100,
            "description": "Date text in Thai or English. Alternative to year/month/day."
          },
          "year": {
            "type": "integer",
            "description": "Year (BE or CE, see calendar). Use with month and day."
          },
          "month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "description": "Month 1-12."
          },
          "day": {
            "type": "integer",
            "minimum": 1,
            "maximum": 31,
            "description": "Day of month."
          },
          "calendar": {
            "type": "string",
            "enum": [
              "auto",
              "BE",
              "CE"
            ],
            "default": "auto",
            "description": "How to read the input year. 'auto': >= 2400 means BE, 2-digit means BE 25xx."
          },
          "format": {
            "type": "string",
            "enum": [
              "th-long",
              "th-short",
              "iso",
              "en"
            ],
            "default": "th-long",
            "description": "Which format goes into the 'formatted' field."
          }
        },
        "additionalProperties": false
      }
    },
    {
      "name": "thai_id_validate",
      "title": "Thai ID / tax ID checksum validator",
      "description": "Validate the 13-digit Thai national ID / tax ID check digit (sum of digit*(13-position), check = (11 - sum mod 11) mod 10). Returns formatted X-XXXX-XXXXX-XX-X, the expected check digit, and for invalid numbers which single-digit corrections would satisfy the checksum (the checksum alone cannot tell which digit was mistyped). Validation only: a valid checksum does not prove the ID exists or who it belongs to. Input is processed in memory and never stored or logged. There is deliberately no ID generator.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 40,
            "description": "13-digit ID; spaces and dashes allowed, e.g. '1-2345-67890-12-1'."
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "thai_baht_text",
      "title": "Baht amount in Thai words",
      "description": "Write a THB amount in Thai words as on invoices and cheques (e.g. 1234.56 -> หนึ่งพันสองร้อยสามสิบสี่บาทห้าสิบหกสตางค์; 500 -> ห้าร้อยบาทถ้วน). Handles เอ็ด (…เอ็ด) and ยี่สิบ rules, repeated ล้าน groups, and satang. Exact integer-satang parsing; more than 2 decimals or negative amounts are rejected. Max 999,999,999,999.99.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "amount": {
            "type": [
              "number",
              "string"
            ],
            "description": "THB amount, 0 to 999,999,999,999.99, max 2 decimals. Commas allowed in strings."
          }
        },
        "required": [
          "amount"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "thai_pit_estimate",
      "title": "Thai personal income tax estimate (brackets)",
      "description": "Estimate Thai personal income tax with the progressive brackets (0% to 150,000; 5/10/15/20/25/30% steps; 35% above 5,000,000 net; Revenue Department rd.go.th/26218.html). Provide EITHER net_income (taxable net income after all deductions) OR employment_income (annual salary: applies the 50% expense deduction capped at 100,000 and the 60,000 taxpayer allowance, minus optional other_allowances you total yourself). Method 1 only; no 0.5% alternative minimum, no per-allowance rules. Rough estimate, not tax advice.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "net_income": {
            "type": [
              "number",
              "string"
            ],
            "description": "Annual taxable net income in THB (after expenses and allowances)."
          },
          "employment_income": {
            "type": [
              "number",
              "string"
            ],
            "description": "Annual employment income in THB (salary/wages); expense deduction and personal allowance are applied for you."
          },
          "other_allowances": {
            "type": [
              "number",
              "string"
            ],
            "description": "Extra annual allowances in THB (spouse, children, insurance, ...) already totalled by the caller. Only with employment_income."
          }
        },
        "additionalProperties": false
      }
    }
  ],
  "_note": "Best-effort card: the server-card format is still a draft proposal and may change."
}
