Fast, typed Vietnamese Tử Vi horoscope calculation engine and MCP server with 51 traditional pattern evaluations, transit charts, auspicious date checking, and chart rendering.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
💡 Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
This is a Model Context Protocol (MCP) server developed in Python that calculates and manages Vietnamese "Tử Vi" horoscope charts. It is optimized to output clean, structured JSON data that LLM agents can easily read, interpret, and explain to users.

tuvi_mcp.database) for Python library consumers to save, retrieve, list, and delete horoscope profiles. (MCP tools are stateless and do not require a database.)ansaotuvi calculation logic internally with custom Tuần/Triệt double-cung fixes.Beyond the MCP server, tuvi-mcp-server ships a typed, ergonomic Python API for direct use in scripts, notebooks, or web backends:
The same library is what the MCP tools wrap, so behavior is identical whether you call Horoscope.from_birth(...).chart() or invoke the generate_horoscope tool from an MCP client.
timezone explicitly to the MCP tool (timezone accepts an integer like 8 or an h:30 string like "8:30"). Defaults to 7 when omitted. The astronomical engine uses the supplied timezone only for boundary rounding of the Solar↔Lunar date — the civil hour branch (chi giờ) is always derived from the user-supplied local clock time.[!NOTE] Traditional Calculations Disclaimer: Vietnamese "Tử Vi" is a highly rich astrological methodology with various traditional schools (e.g., Nam Phái vs. Bắc Phái). Calculation parameters, star rankings, element determinations, and interpretations may differ depending on the specific lineage or school. The output generated by this tool is calculated strictly according to standard consensus computational logic and should be treated as a computational reference rather than a definitive astrological interpretation.
You can install tuvi-mcp-server directly from PyPI:
If you want to contribute to the package or run unit tests, set up a local development environment:
Create Virtual Environment:
Install Package in Editable Mode:
Running Tests: Verify your local setup by running the test suite:
To run the server over HTTP (runs on port 1850 by default):
Override host and port:
All tools run locally inside the MCP environment. They require no external authentication or network rate limiting.
generate_horoscopeGenerates a full Tử Vi chart from raw birth details, with optional high-quality chart image rendering.
generate_image is True, renders a PNG file to a temporary location on the local filesystem and returns its path.name (string): Person's name (default: "Khách").day (integer): Day of birth (1-31).month (integer): Month of birth (1-12).year (integer): Year of birth.hour_val (string): Hour of birth (e.g., "14:30", "Ngọ", "Tý", or branch index 1-12). Interpreted as local civil time at the birthplace — do not convert to Vietnam time unless that is the intended civil-tz reference (see timezone below).gender_val (string): Gender ("Nam" or "Nữ", case-insensitive).is_solar (boolean): True for Solar, False for Lunar (default: True).current_year (integer, optional): Year to inspect transit stars/Vận Hạn for (defaults to current year).generate_image (boolean, optional): Whether to generate and return the high-quality chart image along with the chart data (default: True).timezone (integer or string, optional): UTC offset for the civil timezone at the birthplace. Accepts an integer (e.g. 7, -5) or an h:30 string (e.g. "7:30", "-5:30"). Default: 7 (ICT/Vietnam). Other minute values and out-of-range inputs are rejected. Only the boundary rounding of astronomical events (lunar day, tiết-khí, Đông chí) is affected — the civil hour branch (chi giờ) is always derived from hour_val.generate_image is True, returns a list containing [Image, chart_data] (where Image is a FastMCP Image content block pointing to the generated PNG).generate_image is False, returns the raw JSON dictionary chart_data directly. Contains keys: thien_ban (demographics, pillars, element, destiny) and dia_ban (12 houses with stars).{"error": "error_message"} if calculations fail.No reviews yet — be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/nmhaaa3218-tuvimcp)<a href="https://allmcps.com/mcp/nmhaaa3218-tuvimcp"><img src="https://allmcps.com/api/badge/nmhaaa3218-tuvimcp?style=directory" alt="TuViMCP on AllMCPs" /></a>