Skip to main content
Glama
wtigero

Thai Toolkit MCP

by wtigero
README.md
# 🇹🇭 Thai Toolkit MCP

**Thai-specific utilities for AI agents — as a Model Context Protocol (MCP) server.**

Give Claude (or any MCP client) the exact, rule-based Thai building blocks it gets wrong on its own:
validate a **national / tax ID**, read an amount as **Thai baht text**, convert **Buddhist-era (พ.ศ.)
dates**, compute **7% VAT** and withholding tax, normalize **Thai phone numbers**, and look up
**provinces**.

Every tool is a **pure, offline function** — no API keys, no network calls, deterministic results.
Fast, private, and safe to run locally.

## Why this exists

LLMs are unreliable at exact Thai tasks: they miscompute the national-ID checksum, misread baht text,
and mishandle Buddhist-era years. This server moves those tasks to verified code, so the agent gets the
right answer every time.

## Tools

| Tool | What it does | Example ask |
|------|--------------|-------------|
| `thai_validate_id` | Validate a 13-digit national / tax ID via checksum | "Is 1-1011-12345-67-8 a valid Thai ID?" |
| `thai_baht_to_text` | Read a THB amount in Thai (for invoices/cheques) | "Write ฿1,234.50 in Thai text" |
| `thai_convert_date` | Format / convert Gregorian ↔ Buddhist-era dates | "What is 2026-06-13 in Thai?" |
| `thai_calculate_vat` | Add / extract 7% VAT and withholding tax | "Extract VAT from a ฿1,070 invoice" |
| `thai_format_phone` | Normalize to local + E.164, classify mobile/landline | "Format +66 81 234 5678" |
| `thai_lookup_province` | Province info (Thai/English) and its region | "Which region is Phuket in?" |

## Install

```bash
git clone https://github.com/wtigero/thai-toolkit-mcp.git
cd thai-toolkit-mcp
pip install -e .
```

## Connect it

**Claude Desktop** — add to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "thai-toolkit": {
      "command": "thai-mcp"
    }
  }
}
```

**Claude Code:**

```bash
claude mcp add thai-toolkit -- thai-mcp
```

Then ask: *"อ่าน ฿1,234.50 เป็นตัวอักษรไทย"* and the agent calls the tool.

## Develop

```bash
pip install -e ".[dev]"
python -m pytest            # or: python tests/test_utils.py
```

## License

MIT — see [LICENSE](LICENSE).

TDQS

A4.2/5.0

Scored across 6 tools

Disambiguation5/5

Each tool targets a distinct aspect of Thai data (currency, tax, date, phone, province, ID) with no functional overlap. An agent can easily select the appropriate tool without ambiguity.

Naming Consistency5/5

All tools follow a consistent 'thai_verb_noun' pattern using snake_case, making the API predictable and easy to remember.

Tool Count5/5

Six tools cover a well-scoped set of common Thai-specific utilities without being too few or too many. Each tool serves a clear purpose.

Completeness4/5

The tool set addresses core Thai localization needs (currency, tax, date, phone, location, ID). Minor gaps exist (e.g., address formatting, income tax) but are acceptable for a focused toolkit.

Maintenance

ActivityInactive
ResponsivenessNo issues