mcp-thai-textSAFE
MCP server giving AI agents correct Thai text handling: word segmentation, caption line wrapping, and tone-mark-safe rendering
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
[](https://github.com/anthonychkwn/mcp-thai-text/actions/workflows/ci.yml)
An MCP server that gives AI agents correct Thai text handling: word segmentation, caption line wrapping, and tone-mark-safe text rendering.
Why
Agents working with Thai run into three problems that do not exist in English:
- No spaces between words. Splitting on whitespace returns the whole sentence as one token. Anything that needs word boundaries (wrapping, counting, alignment to speech) needs a dictionary-based tokenizer.
- Line breaking is a language problem, not a length problem. Breaking captions on character count splits words in half. And even at word boundaries, a line that ends on a lead-in word (เพราะ, แล้ว, คือ) or starts with an enclitic (ครับ, นะ, ไหม) reads wrong on screen.
- Renderers silently misspell Thai. Pillow without libraqm and libass subtitle burn-in both drop stacked tone marks: เนื่อง comes out as เนือง, นี้ as นี. No error is raised. The output is just wrong.
This server packages the fixes as three MCP tools so any client (Claude Code, Claude Desktop, or your own agent loop) can call them.
Tools
Install
pip install -r requirements.txt
Register with Claude Code:
claude mcp add thai-text -- python /path/to/mcp-thai-text/server.py
Or in any MCP client config:
{
"mcpServers": {
"thai-text": {
"command": "python",
"args": ["/path/to/mcp-thai-text/server.py"]
}
}
}render_text_png needs a Thai-capable font (
a37a331f41a0OBSERVED · 2026-10-11Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add mcp-thai-text -- uvx mcp-thai-text
{
"mcpServers": {
"mcp-thai-text": {
"command": "uvx",
"args": [
"mcp-thai-text"
]
}
}
}Exposed tools (3)
3 read · 0 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
render_text_png | read | Render Thai text to a PNG with correct mark stacking. |
segment_words | read | Split Thai text into words. |
wrap_caption_lines | read | Break Thai text into caption/subtitle lines at word boundaries. |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (3)
sudo apt-get update -q
sudo apt-get install -y -q fonts-noto-core fontconfig
mcp, pythainlp, Pillow, numpy, uharfbuzz, freetype-py
Gates applied: no_behavioural_pass.
a37a331f41a0full audit observations/trust-audit/mcp-server/anthonychkwn__mcp-thai-text.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-11 | a37a331f41a0 | SAFE | B | 89 | first audit |
Questions
What is the mcp-thai-text MCP server?
MCP server giving AI agents correct Thai text handling: word segmentation, caption line wrapping, and tone-mark-safe rendering
What tools does mcp-thai-text expose?
3 in total: 3 read-only, 0 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is mcp-thai-text safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does mcp-thai-text need?
No credential environment variables were found in its source, so it appears to need none.
How current is this page?
The grade is for one exact copy of the source (a37a331f41a0), read on 2026-10-11. The repository is watched and re-audited when it changes.