mcp-bazi-project-guide

mcp-bazi-project-guide is a cursor rule for Cursor from mymcp-fun/bazi. It costs 5 tokens per session (1,762 once invoked), scanned A, original, MIT.

A project guide for a TypeScript MCP server that calculates BaZi, a Chinese astrology system based on a person's birth date and time, including its associated Five Elements. It documents the server structure, tests, dependencies, and main tool.

In plain words
What is it for?
Use it when developing, testing, or packaging the server and its `get_bazi_details` tool. The guide covers its TypeScript files, Node.js setup, lunar-calendar library, and accuracy tests.
Why use it?
It gives developers the project context needed to maintain or extend the server. It also explains how the modern MCP server API validates inputs and exposes the calculation tool.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when developing, testing, or packaging the server and its get_bazi_details tool. The guide covers its TypeScript files, Node.js setup, lunar-calendar library, and accuracy tests.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/mymcp-fun/bazi/mcp-bazi-project-guide
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/mymcp-fun/bazi

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-bazi-project-guide

README.md
[![agentmods](https://agentmods.dev/badge/rules/mymcp-fun/bazi/mcp-bazi-project-guide/github.svg)](https://agentmods.dev/rules/mymcp-fun/bazi/mcp-bazi-project-guide)
Your own site
<a href="https://agentmods.dev/rules/mymcp-fun/bazi/mcp-bazi-project-guide"><img src="https://agentmods.dev/badge/rules/mymcp-fun/bazi/mcp-bazi-project-guide/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-bazi-project-guide

Your own site · 80×15
<a href="https://agentmods.dev/rules/mymcp-fun/bazi/mcp-bazi-project-guide"><img src="https://agentmods.dev/badge/rules/mymcp-fun/bazi/mcp-bazi-project-guide.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 5 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,762 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00005 $0.01762
Opus 5 $0.00003 $0.00881
Sonnet 5 $0.00001 $0.00352
Haiku 4.5 $0.00001 $0.00176

Measured 11d ago against content hash 355d6dcd1fb9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

mcp-bazi-project-guide scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/mcp-bazi-project-guide.mdc · 195 lines

How it starts

The opening of the file, as written. The whole thing — 195 lines — stays where its author put it; the contents beside it link to each section on GitHub.

八字计算MCP服务器项目指南

🎯 项目概述

这是一个基于TypeScript的专业八字计算MCP服务器,使用lunar-javascript库提供八字计算服务。项目已完成现代化API升级,采用最新MCP SDK,可通过npm包@mymcp-fun/[email protected]一行命令使用。

📁 项目结构

核心源代码

  • src/server.ts - MCP服务器主入口,使用新版McpServer API和registerTool方法
  • src/bazi-service.ts - 八字计算核心服务,包装lunar-javascript库
  • src/types.ts - TypeScript类型定义,包含输入输出接口

配置文件

测试文件

文档

  • README.md - 项目说明文档,包含安装使用指南
  • LICENSE - MIT开源许可证

🔧 技术栈

核心依赖

  • @modelcontextprotocol/sdk: 最新MCP协议SDK,使用McpServer类
  • zod: Schema验证库,版本3.25.67+
  • lunar-javascript: 权威的中文农历计算库,1600+周下载量
  • TypeScript: 类型安全的JavaScript超集,版本5.0+
  • Node.js: 运行环境,要求18.0+

现代化API特性

  • McpServer类: 替代旧版Server类,更简洁的API
  • registerTool方法: 自动处理MCP协议细节
  • Zod验证: 内置参数验证和类型安全
  • 简化代码: 从173行减少到89行(48%缩减)

🎯 核心功能

MCP工具: get_bazi_details

计算生辰八字和五行信息的主要工具

输入参数:

interface BaziToolInput {
  year: number;        // 出生年份 (1900-2100)
  month: number;       // 出生月份 (1-12)
  day: number;         // 出生日期 (1-31)
  hour: number;        // 出生时间 (0-23)
  gender?: string;     // 性别 (可选,默认male)
  timezone?: string;   // 时区 (可选,默认Asia/Shanghai)
}

输出结果 (使用中文字段名):

interface BaziResult {
  四柱: {              // 四柱信息
    年柱: string;      // 年柱,如"乙酉"
    月柱: string;      // 月柱,如"己丑"
    日柱: string;      // 日柱,如"丁巳"
    时柱: string;      // 时柱,如"壬子"
  };
  五行: {              // 五行分析(整数计数)
    木: number;        // 木,如1
    火: number;        // 火,如2
    土: number;        // 土,如2
    金: number;        // 金,如1
    水: number;        // 水,如2
  };
  生肖: string;        // 生肖,如"鸡"
  星座: string;        // 星座,如"水瓶"
  农历: {              // 农历日期
    农历年: number;
    农历月: number;
    农历日: number;
    是否闰月: boolean;
    农历月名: string;  // 如"腊月"
  };
  日主: string;        // 日主天干,如"丁"
}

Read the full file on GitHub · 195 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 195 lines · 5 tokens per session scan A 355d6dcd1fb9

Subscribe to this mod's changes

mcp-bazi-project-guide is a cursor rule published in the GitHub repository mymcp-fun/bazi (10 stars, last pushed 1y ago), licensed MIT. It adds 5 tokens to every session and 1,762 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.