AstroStellar MCP Server

AstroStellar MCP Server

An MCP server for Zi Wei Dou Shu (Purple Star Astrology) that enables users to construct and interpret natal charts through natural language conversation, integrating a knowledge base of classical texts.

Category
Visit Server

README

🌟 AstroStellar倩星玫府— 玫埮斗数智胜 Skill

满倩星曜尜垃盘䞭。倩星玫府观心见呜。

AstroStellar 是䞀欟基于玫埮斗数叀籍的智胜排盘䞎解盘系统以 OpenClaw Skill + MCP Server 双重圢态提䟛服务。甚户只需像聊倩䞀样逐步提䟛出生信息即可自劚排出完敎呜盘并获埗基于叀籍知识库的䞓䞚解读。


✹ 它胜做什么

功胜 诎明
🧮 智胜排盘 蟓入生蟰 → 自劚计算完敎呜盘十四䞻星、四化、十二宫、倧限、流幎
📚 叀籍查乊 ChromaDB 语义检玢从 18 仜叀籍 + 213 页《玫埮斗数党乊》䞭查扟盞关解读
🔮 敎䜓解盘 生成六倧板块结构化报告呜盘抂览 → 呜宫总论 → 十二宫简析 → 四化点睛 → 栌局刀断 → 流幎提点
💬 䞓项问答 莢运、感情、事䞚、健康  随䜠问
🌞 善解人意 䞀次只问䞀䞪问题记䞍枅时蟰也䞍怕像朋友聊倩䞀样自然

🏗 原理

敎䜓架构

┌──────────────────────────────────────────────────┐
│                     👀 甚户                       │
│         飞乊 / 埮信 / Telegram 等枠道              │
└────────────────────┬─────────────────────────────┘
                     │ 自然语蚀对话
                     ▌
┌──────────────────────────────────────────────────┐
│               🊞 OpenClaw 平台                     │
│                                                    │
│   ┌──────────────────────────────────────┐        │
│   │            SKILL.md                   │        │
│   │  · 10 步定盘对话状态机                │        │
│   │  · 善解人意的人物讟定                 │        │
│   │  · MCP 协议工具调床                   │        │
│   └──────────────┬───────────────────────┘        │
│                  │ MCP Protocol                    │
└──────────────────┌────────────────────────────────┘
                   ▌
┌──────────────────────────────────────────────────┐
│              🔧 MCP Server (Python)                │
│                                                    │
│   ┌────────────┐ ┌──────────┐ ┌────────────────┐ │
│   │ 排盘匕擎    │ │ 解盘匕擎  │ │ 知识库匕擎      │ │
│   │ chart.py   │ │interp.py │ │ knowledge.py   │ │
│   │            │ │          │ │                │ │
│   │ 日历蜬换    │ │ 星曜解读  │ │ ChromaDB       │ │
│   │ 四柱掚算    │ │ 宫䜍解读  │ │ 语义检玢       │ │
│   │ 五行局      │ │ 栌局检测  │ │ 18 MD + 1 PDF │ │
│   │ 安呜宫      │ │ 绌合解盘  │ │                │ │
│   │ 安十四䞻星  │ │ 䞓项问答  │ │                │ │
│   │ 安四化      │ │          │ │                │ │
│   │ 倧限/流幎   │ │          │ │                │ │
│   └────────────┘ └──────────┘ └────────────────┘ │
└──────────────────────────────────────────────────┘

排盘算法

排盘栞心基于倪阳黄经倩文算法独立计算 24 节气亀节时刻䞍䟝赖任䜕查衚数据

  1. 日历蜬换lunar_calendar.pylunardate 库莟莣公历⇄农历互蜬四柱掚算䜿甚干支纪日基点1900-01-01 = 甲戌日按距基点倩数掚富日柱
  2. 安呜宫/身宫chart.py寅起正月按生月顺逆数再按生时顺逆数
  3. 安十四䞻星根据五行局数和农历日定玫埮䜍眮玫埮系六星逆排倩府系八星顺排
  4. 安四化十干四化衚党芆盖
  5. 排倧限/流幎阳男阎女顺行阎男阳女逆行局数起运

知识库

  • 数据源18 仜 Markdown 栌匏玫埮斗数叀籍 + 213 页《玫埮斗数党乊》PDF南北山人版
  • 检玢方匏ChromaDB 向量数据库 + sentence-transformers 倚语蚀嵌入暡型
  • 持久化銖次加蜜后存入 data/chroma_db/后续盎接读取无需重倍构建

解盘匕擎

采甚「数据 + 知识库 + 结构化暡板」䞉合䞀方匏

  1. 从 stars.json 获取十四䞻星结构化属性五行、阎阳、庙旺、萜陷、各宫解读
  2. 从 ChromaDB 语义检玢盞关叀籍段萜
  3. 按六倧板块暡板组装䞺完敎报告
  4. 䞓项问答通过 30+ 关键词智胜路由到盞关宫䜍

📊 䞋蜜䜍眮

GitHub 仓库 https://github.com/zhaopeng309/AstroStellar

git clone https://github.com/zhaopeng309/AstroStellar.git
cd AstroStellar

🚀 䜿甚方法

第䞀步克隆项目

git clone https://github.com/zhaopeng309/AstroStellar.git
cd AstroStellar

第二步创建虚拟环境

python3 -m venv venv
source venv/bin/activate

第䞉步安装䟝赖

pip install -r requirements.txt

⚠ 銖次安装䌚䞋蜜 sentence-transformers 嵌入暡型纊 500MB请确保眑络畅通䞔磁盘空闎充足。

第四步可选初始化知识库

知识库䌚圚銖次调甚 astrostellar_search_knowledge 时自劚构建。也可以手劚初始化

source venv/bin/activate
python -c "from src.knowledge import init_knowledge_base; init_knowledge_base('references', 'data/chroma_db')"

初始化完成后ChromaDB 数据䌚持久化到 data/chroma_db/后续启劚无需重倍构建。

第五步启劚 MCP Server

source venv/bin/activate
python src/server.py

MCP Server 䜿甚 stdio 䌠蟓协议由 OpenClaw 平台自劚调甚无需手劚暎露端口。

第六步圚 OpenClaw 䞭䜿甚

将 SKILL.md 蜯连接到 OpenClaw 的 skills 目圕或盎接通过 OpenClaw 的 Skill 管理加蜜。

对话瀺䟋

甚户垮我排盘
倩星🌞 䜠奜呀我是倩星可以垮䜠排玫埮斗数呜盘  
      先从最简单的问题匀始䜠是哪䞀幎出生的比劂 1990

甚户1990
倩星奜的1990 幎记䞋了 ✍
      接䞋来䜠的生日是几月几号
      📝 已收集1990 幎

甚户6月15日
倩星知道了6 月 15 日 ✍
      这䞪日期是公历还是农历
      📝 已收集1990 幎 6 月 15 日

  继续 10 步定盘  

倩星🌞 䜠的玫埮斗数呜盘
      ━━━━━━ 四柱 ━━━━━━
      幎柱庚午 月柱壬午 日柱蟛亥

甚户我的莢运怎么样
倩星关于莢运——
      莢垛宫坐申宫内歊曲倩府逢化犄则莢运亚通  

📂 项目结构

AstroStellar/
├── SKILL.md                  # OpenClaw 技胜定义对话流 + 人物讟定
├── skill-card.md             # 技胜元数据
├── README.md                 # 本文件
├── requirements.txt          # Python 䟝赖
│
├── plan/                     # 完敎匀发计划4 仜
│   ├── Inflare_Development_Plan.md   # 总䜓架构
│   ├── Phase2_Development_Plan.md    # 排盘栞心
│   ├── Phase3_Development_Plan.md    # 解盘 + 知识库
│   └── Phase4_Development_Plan.md    # SKILL.md + 集成
│
├── src/                      # 栞心匕擎
│   ├── lunar_calendar.py      # Block 1: 日历 + 四柱 + 五行局 + 节气计算
│   ├── chart.py               # Block 2: 排盘栞心呜宫→䞻星→四化→倧限→流幎
│   ├── knowledge.py           # Block 3a: 知识库ChromaDB 语义检玢
│   ├── interpreter.py         # Block 3b: 解盘匕擎
│   └── server.py              # Block 4: MCP Server3 䞪 tool
│
├── data/                     # 数据
│   ├── stars.json            # 十四䞻星结构化属性
│   └── chroma_db/            # ChromaDB 持久化知识库本地生成䞍纳入 git
│
├── references/               # 玫埮斗数参考乊籍
│   ├── major-star.md         # 十四䞻星诊解
│   ├── palace.md             # 十二宫诊解
│   ├── mutagen.md            # 四化星
│   ├── pattern.md            # 栌局倧党
│   ├── setup.md              # 安星诀排盘口诀
│   └── 玫埮斗数党乊.pdf       # 213 页叀籍党乊
│
└── tests/                    # 自劚化测试225+ 甚䟋
    ├── test_calendar.py       # 日历 + 四柱 + 五行局
    ├── test_chart.py          # 排盘栞心
    ├── test_knowledge.py      # 知识库
    ├── test_interpreter.py    # 解盘匕擎
    └── test_server.py         # MCP Server

🧪 测试

cd AstroStellar
source venv/bin/activate
python -m pytest tests/ -v

圓前测试芆盖225+ 甚䟋党郚通过。

💡 知识库测试test_knowledge.py涉及 embedding 暡型若内存䞍足可跳过python -m pytest tests/ -v --ignore=tests/test_knowledge.py


📚 技术栈

组件 技术 甹途
历法 lunardate 公历⇄农历互蜬1900-2100
节气 纯 Python 倪阳黄经算法 立春/惊蛰等 12 节亀节时闎
排盘 纯 Python 实现 呜宫、䞻星、四化、倧限、流幎
知识库 ChromaDB + sentence-transformers 叀籍语义检玢
MCP mcp (FastMCP) 标准 Tool 接口
测试 pytest 单元 + 集成

⚠ 泚意事项

  • 幎仜范囎支持 1900-2100 幎lunardate 库限制
  • ChromaDB 初始化銖次构建知识库需䞋蜜 embedding 暡型~500MB完成后持久化无需重倍
  • MCP 协议Server 䜿甚 stdio 䌠蟓由 OpenClaw 自劚管理生呜呚期
  • 虚拟环境始终圚项目 venv 䞭运行䞍芁䜿甚系统 Python

🌟 倩星玫府 — 满倩星曜尜垃盘䞭

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured