What 知己排盘 BaZi MCP server does
知己排盘 BaZi MCP server exposes the calculation engine behind 知己排盘 as an MCP interface. It computes the Four Pillars and can also return assessments for day-master strength, pattern classification, and yong shen. The output is structured calculation data; it does not generate explanatory fortune-telling text or predict events.
The engine covers Gregorian and lunar calendar conversion, solar terms, heavenly-stem and earthly-branch conversion, and the year change at Li Chun. It also includes three handling rules for assigning the day pillar around the late-night Zi hour. These choices can affect results near calendar boundaries.
How it works
The MCP interface has one tool, bazi_compute. Its input can describe a Gregorian birth date, a lunar birth date, or an already known set of Four Pillars. When longitude is included, the calculation adjusts clock time to true solar time using both longitude correction and the equation of time. This requires the standard time-zone offset with daylight-saving effects removed.
The computed result can include the pillars, strength scoring based on timing, location, and support, pattern analysis, and yong shen analysis with climate adjustment. The server also places usage boundaries in the instructions returned during MCP initialization, so connected clients can pass those constraints into the model context.
Setup and configuration
For an MCP client that launches a subprocess over standard input and output, add the package command to the client configuration:
{
"mcpServers": {
"zhiji-bazi": {
"command": "npx",
"args": ["-y", "zhiji-bazi-mcp"]
}
}
}
The package can also be used directly from Node or Bun as a TypeScript library. Its calculation API includes functions for building charts, converting calendar components, correcting true solar time, and analyzing strength, patterns, and yong shen.
For HTTP operation, run bun run mcp/server.ts. The default port is 8787, and the HTTP entry point limits each IP to 60 requests per minute by default. Set MCP_CALLS_PER_MIN to change that limit. Hosted MCP endpoints are also listed by the project at https://zhijipaipan.com/bazi-api/mcp and https://api.szxishe.cn/mcp.
Tools and capabilities
- Compute a chart from Gregorian, lunar, or pillar input.
- Convert between Gregorian and lunar calendar components.
- Apply Li Chun year changes and solar-term month rules.
- Correct birth time with longitude and the equation of time.
- Score day-master strength.
- Classify patterns and select yong shen.
- Return formatted pillar text and the day master through the library API.
Limitations and notes
知己排盘 BaZi MCP server does not provide shen sha, major and annual cycles, relationship matching, na yin, geographic five-element analysis, or AI-generated interpretation. Strength, pattern, and yong shen results represent one methodological approach rather than universally accepted conclusions. Their thresholds were calibrated from practice, and the project notes that pattern analysis has known false positives for some follow-the-pattern cases.
Results may differ from other charting implementations, especially around late Zi hours, leap months, and solar-term boundaries. Birth time is personal data, so examples and tests use synthetic information. The project describes BaZi as traditional culture and does not present its calculations as investment, medical, legal, or other decision-making advice.