Skip to main content

FateBridge

FateBridge:银色莫比乌斯环与星轨横幅

为 AI 应用提供可核对的术数与占星计算

简体中文 · English

PyPI Python CI License ModelScope MCP Server

FateBridge 为 AI 应用提供本地术数、占星与心理测量计算,通过 MCP、REST API、CLI 与 Python SDK 返回结构化事实、时间口径与运行回执。对话模型和界面由接入应用提供,计算服务无需 LLM API Key。

支持的能力

领域 当前计算范围 参考与详情
八字与关系 四柱、格局喜用、神煞、双人干支与十神关系、大运至流时 算法覆盖
中国术数与易占 紫微、奇门、大六壬(720课)、金口诀、太乙、梅花、六爻、河洛与参评 紫微斗数 · 算法覆盖
占星 西占本命/关系/推运(主限/黄道释放/多重回归)/幸运地图(ACG)/卜卦;印占、果老、宿曜与七曜 宿曜 · 占星骰 · 算法覆盖
人类图 太阳 88° 双时刻、门线、通道、类型与权威 人类图参考
玛雅历法与生命灵数 Dreamspell 13 月亮历与古典玛雅历(GMT 584283)、毕达哥拉斯/迦勒底生命灵数与五层倒三角密码 算法覆盖
风水空间 WMM2025/IGRF-14 地磁、八宅与阳宅三要、金锁砂水、年/月/日/时紫白、中州玄空宅盘与四层布局 家居风水
心理测量 IPIP 50 题大五人格、荣格 32 题心理类型(I/E 及 16 型)、恋爱能力 30 题五维与九型人格 45 题量表 覆盖矩阵

当前源码提供 86 个业务 REST 路由(另提供 /api/batch 批处理入口)。MCP 通过三个入口(discover_tools、run_calculation、run_batch)提供 86 项业务能力,覆盖 14 个 family。目录共有 86 条记录,CLI 可执行 86 条。三端共用规范工具名(spec.name)、请求字段与领域计算,见接口边界和算法覆盖矩阵。

60 秒快速开始

需要 uv 和 Python 3.10+(源码默认 3.12,CI 测试 3.10–3.13)。完整安装步骤与环境自检见环境安装与首次运行。

  • 已发布版本:uv tool install --python 3.12 fatebridge && fatebridge doctor(提供 fatebridge、fatebridge-api、fatebridge-mcp;找不到命令时运行 uv tool update-shell 并重开终端)。
  • 当前源码:git clone https://github.com/thomas-yanxin/FateBridge.git && cd FateBridge && uv sync --extra dev && uv run --extra dev fatebridge doctor(未发布变化见 CHANGELOG,已发布版本查对应标签)。

下列虚构示例在终端直接运行,无需启动服务(源码用户加 uv run --extra dev,Windows 写法见部署指南):

fatebridge bazi_birth_chart \
  --birth-year 1990 --birth-month 5 --birth-day 15 \
  --birth-hour 10 --birth-minute 30 --gender male \
  --birth-place 北京 --birth-timezone Asia/Shanghai \
  --fields day_master.stem day_master.element day_master.polarity

发现工具、增量展开视图或一次串联单/双主体多工具批处理(单批最多 64 条;fatebridge batch --request-file batch.json,支持 --out results.json 自包含落盘与 fatebridge read results.json 无损列式精读,以及 fatebridge batch --schema / fatebridge discover batch,对应 MCP run_batch 与 REST POST /api/batch):

fatebridge discover --input-mode event_clock
fatebridge discover bazi_birth_chart vedic_chart --detail brief
{
  "subjects": {
    "p1": {
      "gender": "male",
      "birth_year": 1990,
      "birth_month": 5,
      "birth_day": 15,
      "birth_hour": 10,
      "birth_minute": 30,
      "birth_timezone": "Asia/Shanghai",
      "birth_place": "北京"
    },
    "p2": {
      "gender": "female",
      "birth_year": 1992,
      "birth_month": 3,
      "birth_day": 2,
      "birth_hour": 8,
      "birth_minute": 30,
      "birth_timezone": "Asia/Shanghai",
      "birth_place": "北京"
    }
  },
  "context": {"analysis_year": 2026, "analysis_month": 10, "analysis_day": 12, "analysis_hour": 12, "analysis_timezone": "Asia/Shanghai", "analysis_place": "北京"},
  "calls": [
    {"id": "bazi", "tool": "bazi_overview", "subject": "p1", "fields": ["four_pillars", "day_master"]},
    {"id": "compat", "tool": "bazi_compatibility", "subjects": ["p1", "p2"], "arguments": {"relationship_type": "marriage"}, "fields": ["natal_contexts", "cross_chart_relations"]},
    {"id": "qimen", "tool": "qimen", "include": ["hidden_stems"]},
    {"id": "minggua", "tool": "fengshui_minggua", "subject": "p1"}
  ]
}

接入 AI 助手或应用

目标 运行与连接 指南
本机 Codex、Claude Desktop、Cursor 客户端启动 MCP stdio 子进程 MCP 部署
支持 URL 的 MCP 客户端 独立 Streamable HTTP 服务 HTTP 与远程部署
Web、移动端或后端服务 独立 REST 服务(API_HOST=127.0.0.1 fatebridge-api,端口 8010) 启动 REST · API 参考
批处理与终端脚本 CLI 单次或批量执行 Agent 协议 · 请求示例
  • MCP 验证:运行 fatebridge doctor --mcp 获取 executable 绝对路径注册客户端,升级后需重连 MCP;网络与 REST 鉴权边界见运行配置与安全策略(REST 密钥不保护 MCP)。
  • 结果核对:不猜测未知生时;默认返回确定性核心层并在 run_metadata.omitted_views / omitted_fields 记入省略的领域视图与通用 "audit" 视图(按需传 include=["audit"] 获取完整溯源与执行回执),控制规则见输出控制与结果读取;外置星历核对见星历数据;分层状态语义见核心概念。

开发与贡献

源码采用 Python src 布局,FastAPI、FastMCP、CLI 与 Python SDK 通过中央 ToolSpec 目录共享执行层与领域服务(见架构说明与 pyproject.toml)。

uv run --extra dev python scripts/check_docs.py
uv run --extra dev python -m pytest -q tests/quality/test_documentation_integrity.py tests/quality/test_doc_tool_counts.py
  • 问题反馈:请附版本、虚构最小复现与实际报错;安全漏洞请按 SECURITY.md 私下报告。

文档与许可

文档中心按 Diátaxis 四象限与双闭环索引全部维护文档;现象排查见故障排除。平台入口:ModelScope MCP Server。

项目代码采用 Apache-2.0。第三方组件与资料见 NOTICE;依赖、下载的星历与原典资料按各自声明核对许可。

Metadata

Release files for fatebridge 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fatebridge 0.1.2
File Size Uploaded Provenance Actions
fatebridge-0.1.2.tar.gz 5.0 MB With provenance Details for fatebridge-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fatebridge 0.1.2
File Interpreter ABI Platform Actions
fatebridge-0.1.2-py3-none-any.whl Python 3 none any Details for fatebridge-0.1.2-py3-none-any.whl

Total release size: 9.7 MB

Release files / fatebridge-0.1.2.tar.gz

Download URL fatebridge-0.1.2.tar.gz
Size 5.0 MB
Tags Source
SHA-256 checksum
How to use checksums
198f241d72180f2923d7f84da020cb0920bee7130376b2ad7c426c0c110b28de
BLAKE2b-256 checksum
How to use checksums
7909ef31eaeae2f0fd0616027f34569d3d128553b5adb54c55c0b01de27b4db7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / fatebridge-0.1.2-py3-none-any.whl

Download URL fatebridge-0.1.2-py3-none-any.whl
Size 4.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
950da02714ded260432c5e1915b00996ec5b46c595c16bf6f577604f634d6c13
BLAKE2b-256 checksum
How to use checksums
6dcc522d9c9c837eef6d03db12b8f473d568c52b0b40fae1c176657c47b34a28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for fatebridge 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fatebridge-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page