Yijing Bazi MCP Server
# 易经八字分析 MCP 服务器
基于 MCP(Model Context Protocol)的易经与八字分析服务,提供起卦/解读、八字排盘/分析与综合咨询等能力。
## 快速开始
### 本地运行
```bash
npm install
npm start
```
### 开发模式
```bash
npm run dev
```
### NPM/NPX 运行
```bash
npx yijing-bazi-mcp@latest
```
## 客户端配置
### Claude Desktop
```json
{
"mcpServers": {
"yijing-bazi": {
"command": "npx",
"args": ["yijing-bazi-mcp@latest"],
"env": {
"LOG_LEVEL": "info",
"NODE_ENV": "production"
}
}
}
}
```
如果使用本地项目:
```json
{
"mcpServers": {
"yijing-bazi": {
"command": "node",
"args": ["src/index.js"],
"cwd": "项目完整路径",
"env": {
"LOG_LEVEL": "info",
"NODE_ENV": "development"
}
}
}
}
```
配置文件位置:
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
- Linux: `~/.config/Claude/claude_desktop_config.json`
### 其他 MCP 客户端(Trae/Cursor/Cherry Studio)
推荐用 `npm exec`:
```json
{
"mcpServers": {
"yijing-bazi": {
"command": "npm",
"args": ["exec", "yijing-bazi-mcp"],
"cwd": "项目完整路径",
"env": {
"NODE_ENV": "development"
}
}
}
}
```
## 可用工具(概览)
- 易经:`yijing_generate_hexagram`, `yijing_interpret`, `yijing_advise`
- 八字:`bazi_generate_chart`, `bazi_analyze`, `bazi_forecast`
- 综合:`combined_analysis`, `destiny_consult`
- 学习:`knowledge_learn`, `case_study`
## 使用示例
### 易经起卦
```json
{
"tool": "yijing_generate_hexagram",
"params": {
"question": "今年是否适合创业?",
"method": "coin",
"context": "目前在大公司工作,考虑自主创业"
}
}
```
### 八字分析
```json
{
"tool": "bazi_generate_chart",
"params": {
"birth_time": "1990-05-15T10:30:00+08:00",
"gender": "male",
"is_lunar": false,
"timezone": "Asia/Shanghai"
}
}
```
## 环境变量
支持 `.env`:
```bash
LOG_LEVEL=info
NODE_ENV=production
SERVER_NAME=yijing-bazi-mcp-server
ENABLE_CACHE=true
```
## 目录结构(简版)
```
src/
engines/ # 易经/八字/综合/知识引擎
data/ # 静态数据与表
utils/ # 工具/日志/校验/缓存
config/ # 运行时配置
index.js # 入口
```
## 免责声明
本项目仅供学习研究使用,分析结果仅供参考,不构成任何决策建议。
TDQS
Scored across 10 tools
The tools have some clear distinctions, such as between bazi_analyze (analyzing a birth chart) and yijing_interpret (interpreting hexagrams), but there is overlap in purpose. For example, bazi_forecast (predicting future luck) and destiny_consult (providing destiny consultation) could be confused as both involve future-oriented advice, and case_study (analyzing case studies) might overlap with combined_analysis (comprehensive analysis). Descriptions help differentiate, but ambiguity exists in the broader advisory functions.
The naming is mostly consistent with a clear pattern: most tools use a prefix like 'bazi_' or 'yijing_' followed by a verb_noun structure (e.g., bazi_analyze, yijing_generate_hexagram). However, there are minor deviations: case_study and knowledge_learn lack the prefix, and combined_analysis uses a different structure. Overall, the naming is readable and follows a predictable convention with only slight inconsistencies.
With 10 tools, the count is well-scoped for the server's purpose of Yijing and Bazi analysis. Each tool appears to serve a distinct role in the domain, such as chart generation, interpretation, forecasting, and learning. This number allows comprehensive coverage without being overwhelming, fitting typical expectations for a specialized server.
The tool set covers key aspects of Yijing and Bazi analysis, including generation (bazi_generate_chart, yijing_generate_hexagram), interpretation (bazi_analyze, yijing_interpret), forecasting (bazi_forecast), and advisory functions (yijing_advise, destiny_consult). Minor gaps might exist, such as lack of tools for historical data or advanced customization, but core workflows are well-covered, allowing agents to perform most essential tasks in this domain.