freebazi-mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alex Su
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,92 @@
1
+ # freebazi-mcp
2
+
3
+ A [Model Context Protocol](https://modelcontextprotocol.io) server that computes a full Chinese **Bazi** (八字, Four Pillars of Destiny) chart from a birth date, time, and place.
4
+
5
+ It wraps the same calculation engine that powers **[freebazi.com](https://freebazi.com)**: an offline engine that corrects for **True Solar Time** and historical **daylight saving**, and is cross-validated against established Bazi libraries. No API key, no network calls, everything runs locally.
6
+
7
+ ## What it returns
8
+
9
+ Give it a birth moment and a city, and `compute_bazi_chart` returns:
10
+
11
+ - The **Four Pillars** (Year, Month, Day, Hour), each as a Heavenly Stem and Earthly Branch
12
+ - Your **Day Master** (日干) and the **Ten Gods** (十神) of every character
13
+ - **Hidden Stems** (藏干), **Na Yin** (纳音), and the **Twelve Growth Stages** (十二长生)
14
+ - **Five Elements** distribution, both visible and including hidden stems
15
+ - **Shen Sha** (神煞) and **branch relations** (合冲刑害)
16
+ - **Luck Pillars** (大运) with the current period flagged, and the current year's pillar
17
+ - A link to the full interactive chart on [freebazi.com](https://freebazi.com)
18
+
19
+ ## Install
20
+
21
+ Requires Node.js 18+.
22
+
23
+ Run directly with npx:
24
+
25
+ ```bash
26
+ npx freebazi-mcp
27
+ ```
28
+
29
+ ### Claude Desktop
30
+
31
+ Add to your `claude_desktop_config.json`:
32
+
33
+ ```json
34
+ {
35
+ "mcpServers": {
36
+ "freebazi": {
37
+ "command": "npx",
38
+ "args": ["-y", "freebazi-mcp"]
39
+ }
40
+ }
41
+ }
42
+ ```
43
+
44
+ Other MCP clients (Cline, Continue, Cursor, etc.) take the same `command` / `args`.
45
+
46
+ ## Tools
47
+
48
+ ### `compute_bazi_chart`
49
+
50
+ Compute a full chart.
51
+
52
+ | Argument | Type | Notes |
53
+ |---|---|---|
54
+ | `year`, `month`, `day` | number | Birth date |
55
+ | `hour`, `minute` | number | Local clock time as recorded (omit if `timeUnknown`) |
56
+ | `gender` | `"male"` \| `"female"` | Needed for luck-pillar direction |
57
+ | `city` | string | e.g. `"Taipei"`, `"New York"`. Resolved to longitude + time zone for True Solar Time |
58
+ | `longitude`, `utcOffset` | number | Alternative to `city` |
59
+ | `timeUnknown` | boolean | Hour pillar becomes tentative |
60
+ | `trueSolarTime` | boolean | Default `true` |
61
+ | `dayRule` | `"zi23"` \| `"midnight"` | Day boundary, default 23:00 |
62
+ | `yearRule` | `"lichun"` \| `"cny"` | Year boundary, default Li Chun |
63
+
64
+ ### `search_cities`
65
+
66
+ Search about 490 major world cities by English or Chinese name. Returns each match's country, longitude, and IANA time zone, so you can pass an exact city to `compute_bazi_chart`.
67
+
68
+ ## Example
69
+
70
+ > Compute the Bazi chart for someone born 15 June 1990, 9:30 AM, in New York.
71
+
72
+ The server resolves New York, applies True Solar Time (9:30 AM becomes 8:34 AM, 56 minutes earlier, which shifts the Hour pillar), and returns the four pillars 庚午 壬午 辛亥 壬辰 with a Xin (辛) yin Metal Day Master, all Ten Gods, elements, luck pillars, and more.
73
+
74
+ ## Accuracy and honesty
75
+
76
+ Solar-term boundaries are computed from the sun's apparent longitude with standard astronomical formulas, and time zones (including historical daylight saving) are resolved from the IANA database. The engine's four pillars match established libraries character for character across thousands of test charts.
77
+
78
+ Bazi is a traditional framework for reflection on temperament, tendencies, and timing. This tool describes a chart; it does not predict events.
79
+
80
+ ## Links
81
+
82
+ - Interactive calculator, guides, and full charts: **[freebazi.com](https://freebazi.com)**
83
+ - What is a Day Master: [freebazi.com/day-master](https://freebazi.com/day-master/)
84
+ - The Ten Gods explained: [freebazi.com/ten-gods](https://freebazi.com/ten-gods/)
85
+
86
+ ## Credits
87
+
88
+ City data from [GeoNames](https://www.geonames.org/) (CC BY 4.0). Simplified to Traditional conversion via OpenCC.
89
+
90
+ ## License
91
+
92
+ MIT