Giving your AI agent a Vietnamese lunar calendar: a free MCP server and REST API
If you build anything for Vietnamese users (a booking app, a chatbot, a reminder bot, an HR tool), sooner or later someone asks a question your date library can't answer: "What is the lunar date today?" "When is TαΊΏt ne
If you build anything for Vietnamese users (a booking app, a chatbot, a reminder bot, an HR tool), sooner or later someone asks a question your date library can't answer:
- "What is the lunar date today?"
- "When is TαΊΏt next year?"
- "Is this Saturday a good day to open the shop?"
The Vietnamese lunisolar calendar is not just "the Chinese calendar with a different name". It is computed for UTC+7, so a few new moons fall on a different day than in UTC+8 calendars, and the leap months and the TαΊΏt date can differ too. Hard-coding a lookup table that you copied from somewhere is how bugs like "our app says TαΊΏt is on the wrong day" happen.
Here is a lighter option I've been using: a free MCP server plus a plain REST API that already handle this.
Option 1: plug the MCP server into your agent
The server speaks Streamable HTTP and needs no API key for the free tier. In any MCP-capable client:
{
"mcpServers": {
"amlichvietnam": {
"url": "https://amlichvietnam.vn/mcp"
}
}
}
Useful tools it exposes:
| Tool | What it does |
|---|---|
get_lunar_today |
Today's lunar date, can chi (stemβbranch), solar term, auspicious hours (ICT) |
convert_lunar_date |
Solar β lunar conversion, leap-month aware |
find_good_days / check_good_day
|
Auspicious days for a purpose (wedding, opening, moving houseβ¦) |
search_knowledge |
Search the cultural knowledge base |
Once it is connected, the agent can answer "what's the lunar date on 17 Feb 2027?" by calling the tool instead of guessing, and that is the whole point: no hallucinated dates.
Option 2: call the REST API directly
If you don't need an agent, the same data is behind a REST API (OpenAPI 3.1 spec available):
curl -s "https://amlichvietnam.vn/api/public/v1/lunar/today"
You get JSON with the solar date, the lunar date (with a leap flag), can chi for day/month/year, the current solar term, the "trα»±c" of the day and the list of auspicious hours, for example:
"lunar": { "day": 16, "month": 10, "year": 2026, "leap": false },
"can_chi": { "day": "NhΓ’m DαΊ§n", "month": "Kα»· Hợi", "year": "BΓnh Ngα»" }
Converting a specific date:
curl -s "https://amlichvietnam.vn/api/public/v1/lunar/convert?date=2027-02-06&direction=solar_to_lunar"
Things to keep in mind
- Time zone matters. Always treat dates as Asia/Ho_Chi_Minh (UTC+7). A date computed in UTC can land one day off around midnight.
- Rate limits. The free tier allows 60 requests/minute and 2,000/day per IP. Cache results; a lunar date never changes once computed.
-
Attribution. When you show results, the docs ask you to cite the source and the
source_urlreturned with each response. - It's cultural, not advice. "Good day" results are traditional references. Present them that way in your UI.
Wrap-up
For most apps you don't need to implement lunisolar astronomy yourself. Point your agent at the MCP endpoint, or call the REST API, and spend your time on the product instead.
Docs, the server card and the OpenAPI link are here: https://amlichvietnam.vn/en
Have you shipped lunar-calendar features before? I'd love to hear how you handled leap months.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.