Thai Text
БесплатноНе проверенMCP server giving AI agents correct Thai text handling: word segmentation, caption line wrapping, and tone-mark-safe rendering
Описание
MCP server giving AI agents correct Thai text handling: word segmentation, caption line wrapping, and tone-mark-safe rendering
README
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
| tool | input | output |
|---|---|---|
segment_words |
Thai text | list of words (PyThaiNLP newmm) |
wrap_caption_lines |
Thai text, max chars per line | caption lines broken at word boundaries, with lead-in and enclitic rules applied |
render_text_png |
text, output path, font, size, color, glow | a PNG with HarfBuzz-shaped, correctly stacked Thai text |
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 (Kanit, Sarabun, Noto Sans Thai). It checks common install locations and takes an explicit font_path otherwise.
Test
python test_client.py
Spawns the server over stdio as a real MCP client, lists the tools, and exercises all three, including writing an actual PNG and asserting it exists.
Example
wrap_caption_lines on a sentence with max_chars: 14:
เพราะภาษาไทย
ไม่มีช่องว่าง
ระหว่างคำการ
ตัดบรรทัดจึง
ต้องตัด
ที่ขอบเขตของคำ
จริง
Every break lands on a word boundary, no line starts with an enclitic, and no line ends on a lead-in.
Related
- thai-text-render: the standalone rendering library this server's
render_text_pngis built on, with a visual before/after of the tone-mark bug. - thai-talkinghead-autocut: the video pipeline where these rules were battle-tested against real footage.
License
MIT
Установить Thai Text в Claude Desktop, Claude Code, Cursor
unyly install thai-textСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add thai-text -- uvx --from git+https://github.com/anthonychkwn/mcp-thai-text mcp-thai-textПошаговые гайды: как установить Thai Text
FAQ
Thai Text MCP бесплатный?
Да, Thai Text MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Thai Text?
Нет, Thai Text работает без API-ключей и переменных окружения.
Thai Text — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Thai Text в Claude Desktop, Claude Code или Cursor?
Открой Thai Text на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzMCP-Agent
A simple, composable framework to build agents using Model Context Protocol by [LastMile AI](https://www.lastmileai.dev)
автор: lastmile-aiSpring AI MCP Client
Provides auto-configuration for MCP client functionality in Spring Boot applications.
mcp.natoma.ai
A Hosted MCP Platform to discover, install, manage and deploy MCP servers by [Natoma Labs](https://www.natoma.ai)
MCPHub
Website to list high quality MCP servers and reviews by real users. Also provide online chatbot for popular LLM models with MCP server support.
MCP Servers Rating and User Reviews
Website to rate MCP servers, write authentic user reviews, and [search engine for agent & mcp](http://www.deepnlp.org/search/agent)
mkinf
An Open Source registry of hosted MCP Servers to accelerate AI agent workflows.
Compare Thai Text with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
