fortune-mcp-server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
fortune-mcp-server
一个面向远程 AI Host 的只读命理 MCP Server。它通过 Streamable HTTP 暴露八字、黄历和塔罗工具,程序负责计算与抽取,语言模型负责理解问题和自然语言解释。
所有结果仅用于传统文化研究与娱乐,不应作为医疗、法律、投资或其他重大决定的依据。
工具
Tool | 输入 | 输出 | 性质 |
| 出生日期、时间、性别、可选地点 | 八字命盘与真太阳时信息 | 确定性计算 |
|
| 农历、干支、宜忌、神煞、方位、时辰宜忌 | 确定性计算 |
| 单牌或三牌阵、是否启用逆位 | 牌位、牌名、正逆位和关键词 | 安全随机抽取 |
三个 Tool 都会同时返回:
content:方便语言模型阅读的 JSON 文本;structuredContent:方便 MCP Host 做结构化处理的数据。
Related MCP server: taibu
设计边界
AI Host
│ Bearer Token
▼
POST /mcp
│ Streamable HTTP(无会话)
▼
McpServer
├─ calculate_bazi_chart ── shunshi-bazi-core
├─ get_daily_almanac ───── shunshi-bazi-core / tyme4ts
└─ draw_tarot_reading ──── 78 张静态牌组 + crypto.randomInt只提供远程 Streamable HTTP,不发布 npm CLI,也不提供 stdio 入口;
不访问本机文件,不执行任意代码,不发送邮件;
不保存用户输入、抽牌记录或 MCP 会话;
/mcp必须携带 Bearer Token,/health可以匿名访问;Server 只返回事实、计算结果和简短关键词,不在工具内部生成大段命理解读。
本地运行
要求 Node.js 20+ 与 pnpm 10。
pnpm install
$env:MCP_API_KEY="replace-with-a-long-random-token"
pnpm dev默认地址:
MCP:
http://127.0.0.1:3100/mcp健康检查:
http://127.0.0.1:3100/health
可选环境变量:
环境变量 | 默认值 | 说明 |
|
| HTTP 监听地址 |
|
| HTTP 监听端口 |
| 无 | 必填,至少 24 个字符 |
| 无 | 逗号分隔的 Host 白名单 |
Docker
复制环境变量示例并替换密钥:
Copy-Item .env.example .env
docker compose up --buildCompose 只把端口映射到本机 127.0.0.1:3100。正式部署时可以由 Caddy、Nginx 或其他网关代理 /mcp,同时设置实际域名对应的 MCP_ALLOWED_HOSTS。
MCP Client 示例
使用官方 TypeScript SDK 连接:
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const client = new Client({ name: "example-host", version: "1.0.0" });
const transport = new StreamableHTTPClientTransport(
new URL("http://127.0.0.1:3100/mcp"),
{
requestInit: {
headers: {
Authorization: `Bearer ${process.env.MCP_API_KEY}`,
},
},
},
);
await client.connect(transport);
const tools = await client.listTools();
console.log(tools.tools.map((tool) => tool.name));
await transport.close();开发检查
pnpm check检查内容包括 ESLint、TypeScript、领域单元测试、真实 Streamable HTTP MCP Client 集成测试和生产构建。
目录结构
src/
├─ index.ts # 进程启动与优雅关闭
├─ app.ts # HTTP 路由与无会话 MCP transport
├─ config.ts # 环境变量解析
├─ http/
│ └─ auth.ts # Bearer Token 校验
├─ server/
│ └─ create-fortune-server.ts # 每个请求创建独立 McpServer
├─ tools/
│ ├─ register-bazi-tool.ts
│ ├─ register-almanac-tool.ts
│ ├─ register-tarot-tool.ts
│ └─ tool-result.ts
└─ domain/
├─ date.ts
└─ tarot/
├─ cards.ts # 完整 78 张牌数据
└─ draw.ts # Fisher–Yates 与正逆位抽取Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted remote MCP server for BaZi (Four Pillars) charts and the Chinese almanac. No install.
BaZi, Zi Wei, Qi Zheng Si Yu, divination and almanac from a deterministic engine. Pay per call.
Deterministic BaZi and Chinese metaphysics tools for AI agents: charts, divination, almanac.
BaZi MCP gateway: 14 tools (6 fortune / 5 forum / 3 meta). API key required. Entertainment only.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceRemote MCP server for Zi Wei Dou Shu / Tu Vi Dau So astrology tools, exposing read-only tools like get_astrolabe, get_horoscope_decades, etc., designed for Railway deployment and OpenAI ChatGPT developer mode.-
- AlicenseNot gradedqualityAmaintenanceEnables traditional Chinese metaphysics tools like Bazi, Ziwei, and Qimen via MCP, integrating AI analysis for divination and fortune-telling.788AGPL 3.0
- AlicenseAqualityCmaintenanceMCP server for ai-divination-skills that provides tools for tarot draws, I Ching casts, Xiao Liu Ren casts, and Bazi chart generation, returning auditable JSON results for AI interpretation.56MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Eastern and Western divination, enabling tarot, Lenormand, I Ching, Meihua, Qi Men, BaZi, Zi Wei Dou Shu, Xiao Liu Ren and Da Liu Ren readings via the free QiyueAstro public API.MIT