thailand-invoice-mcp
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.
README
Thailand Invoice MCP 🇹🇭 — How can my AI agent issue a Thai e-Tax Invoice (ใบกำกับภาษี)?
<!-- install-cta -->
Use it in 60 seconds
Paste this into your MCP client config (Claude Desktop, Cursor, Windsurf, or any MCP-capable agent):
{
"mcpServers": {
"thailand-invoice": {
"type": "http",
"url": "https://inv-th.wishpool.app/mcp"
}
}
}
Nothing to install. Credentials, when you need them, travel as HTTP headers on each request and are never stored — see the threat model.
Or run it yourself
Would you rather not send production credentials to a server you do not control? Deploy this identical code to your own account and point your agent at your own URL:
git clone https://github.com/junter1989k-ai/thailand-invoice-mcp && cd thailand-invoice-mcp && npx vercel --prod
MIT-licensed. Self-hosting removes us from the picture entirely, at no cost and with no loss of function.
Remote MCP server that lets any AI agent create Thailand e-Tax Invoices (ใบกำกับภาษี / Tax Invoice) through Leceipt, the merchant's own Revenue-Department-authorised e-Tax service provider. It computes Thai VAT 7% locally, submits the document to Leceipt, then polls the job and downloads the finished PDF/XML. Stateless, bring-your-own Leceipt API key, never stores anything.
Live endpoint: https://inv-th.wishpool.app/mcp · Registry: app.wishpool/thailand-invoice-mcp
Honest scope — what this server does and does NOT do
This wraps Leceipt's submit / job / file calls only. Signing and Revenue-Department filing happen inside your own Leceipt account.
- ✅ It does: compute the THB VAT math (percentVat
7/0/-1per line;includeVatbacks VAT out of gross prices), convert the date to the Buddhist-EradateBE, assemble the Leceipt document, forwardPOST /etax/documents/invoices-taxinvoiceswith your API key, and translate the response (job → status → file).query_jobpolls;download_documentfetches the produced file. - ❌ It does NOT: sign your invoice, hold your digital certificate (CA — TDID/INET), or act as an authentication intermediary. Your company profile and certificate live in your own Leceipt account; Leceipt signs each document and files it with the Thai Revenue Department. This server never sees the certificate.
This deliberate split keeps the security-critical material (certificate, RD credentials) entirely inside your Leceipt account — a compromise of this stateless forwarder cannot sign or file invoices.
Quick start
{
"mcpServers": {
"thailand-invoice": {
"type": "http",
"url": "https://inv-th.wishpool.app/mcp",
"headers": {
"x-leceipt-api-key": "your-leceipt-api-key",
"x-leceipt-mode": "live"
}
}
}
}
Self-register at my.leceipt.com/signup, then generate your API key in Settings → Connection to API → Generating API Key (shown only once). Required header: x-leceipt-api-key (for live and for query_job / download_document). Optional: x-leceipt-mode and the owner-policy headers below.
Modes. x-leceipt-mode: test (default) is a LOCAL dry-run — create_invoice assembles the document and computes VAT totals but does not submit (no fiscal effect). x-leceipt-mode: live submits to Leceipt → Thai Revenue Department (real fiscal effect). Leceipt has no separate sandbox host; for non-fiscal end-to-end testing use a test certificate inside your own Leceipt account.
Tools
| Tool | What it does |
|---|---|
create_invoice |
Assemble a Thai e-Tax Invoice from { number, customer, items, includeVat?, discount?, date?/dateBE? }, compute Thai VAT 7% locally, and (in live mode) submit to Leceipt. Out: job_id (live) or computed_totals + payload (test dry-run). |
query_job |
Poll GET /etax/jobs/{id}. Out: status processing (still creating/signing) or complete (with file_id). |
download_document |
GET /etax/files/{fileId}. Out: { content_type, size_bytes, content_base64 } — base64-decode for the signed PDF/XML. |
Thai VAT & the document fields
items[].vatRate(LeceiptpercentVat):7standard VAT 7% ·0zero-rated (e.g. exports) ·-1VAT-exempt / non-VAT. Default7.includeVat:false(default) = unit prices are net, VAT added on top;true= prices already include VAT (the server backs it out).customer:name+taxIdrequired.taxNumberType=TXID(juristic, 13-digit taxpayer id, default) ·NIDN(individual, 13-digit national id) ·CCPT(passport) ·OTHR. ForTXID/NIDNthetaxIdmust be exactly 13 digits.branchNumberdefaults to head office00000.date: pass Gregorian ISOYYYY-MM-DD(converted to the Buddhist-EradateBEdd/MM/yyyy, year + 543) ordateBEdirectly.
Owner policy guardrails ride optional headers (x-agentpay-max-amount, x-agentpay-approval-above, x-agentpay-allowed-tools) — set by the human owner in client config; the agent cannot relax them. Cap scope: the amount gate reads the computed grand total (THB, VAT-inclusive). When a document-level discount is set, Leceipt's total is authoritative.
Endpoints wrapped
Auth: single header API-Key: <key> (Azure API Management subscription key — no token exchange).
| Call | Endpoint |
|---|---|
| Submit | POST https://api.leceipt.com/etax/documents/invoices-taxinvoices → job { id } |
| Job status | GET https://api.leceipt.com/etax/jobs/{id} → processing / complete |
| Download | GET https://api.leceipt.com/etax/files/{fileId} → PDF/XML |
Develop
node test/serve.js # local server on :3251
node test/e2e.js # protocol + VAT-7% math + CORS + policy + validation asserts + LIVE Leceipt probe
The e2e suite makes a real call to the Leceipt e-Tax API: a fake API key runs POST /etax/documents/invoices-taxinvoices and surfaces Leceipt's native HTTP 401 Access denied due to invalid subscription key (Azure APIM) — the deepest live verification possible without an onboarded merchant key (Leceipt signs inside the account; we never sign).
Safety
Pure stateless translation layer. Signing and the Revenue-Department filing stay inside your own Leceipt account; the API key travels per-request in a header, nothing is stored. Privacy policy.
One family
Invoices, local payments in 81 countries, and cross-border logistics — one family, same stateless BYO pattern:
- 💳 Payments hub (Taiwan e-invoice 電子發票 included): mcp.wishpool.app
- 🧾 Invoice family hub: inv.wishpool.app
- 📦 Logistics family hub: logi.wishpool.app
Sister invoice servers: Saudi ZATCA inv-sa · Mexico CFDI 4.0 inv-mx · Poland KSeF inv-pl · Chile DTE inv-cl · Brazil NF-e inv-br · Peru CPE inv-pe · India GST inv-in · Costa Rica inv-cr · Malaysia inv-my.
MIT licensed.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。