tojeong-mcp
Calculates Tojeongbigyul (토정비결) fortune for a given birth date and year, returning total fortune and monthly forecasts based on traditional Korean divination methods.
README
토정비결 MCP (tojeong-mcp)
생년월일로 해당 연도의 토정비결(土亭祕訣) 운세를 조회하는 MCP 서버. 작괘(作卦)로 3자리 괘(卦)를 산출하고, 그 괘의 총운(總運) 과 12개월 월별운 원문을 그대로 반환한다.
데이터 전용 서버. 해석·조언·페르소나는 이 서버가 만들지 않는다. 결정론적 구조화 데이터만 반환하며, 해석은 상위 레이어(SKILL/LLM)의 몫이다. 시(時)는 사용하지 않는다.
작괘(作卦) 공식
| 괘 | 공식 | 나머지 0 처리 |
|---|---|---|
| 상괘(上卦) | (한국나이 + 태세수) % 8 | 0 → 8 |
| 중괘(中卦) | (당년 생월의 날수 + 월건수) % 6 | 0 → 6 |
| 하괘(下卦) | (음력 생일 + 일진수) % 3 | 0 → 3 |
- 한국나이 = 당년(當年) − 음력 출생년 + 1 (토정비결은 음력 체계이므로 출생년은 음력 연도 기준. 양력 입력도 음력 변환 후의 연도를 쓴다 — 해 경계 출생자, 예: 양력 1월 초 출생은 음력 전년으로 계산될 수 있다.)
- 날수 = 당년 음력 생월이 대월(大月)이면 30, 소월(小月)이면 29
- 태세수·월건수·일진수는 출생 시점이 아니라 당년(當年)의 해당 연·월·일 간지(干支) 기준이다.
- 괘코드 = 상·중·하 3자리 결합 (예: 2·1·2 →
212), 총 8×6×3 = 144괘.
조견표(早見表) — 수리 산출과 출처
조견표는 임의 나열이 아니라 두 개의 표준 수표에서 결정론적으로 산출된다. src/ganji.js가 진실 출처이며, npm run build:jogyeonpyo로 data/jogyeonpyo.json(60갑자 완전 표)을 생성한다.
- 선천수(先天數): 甲己子午=9 · 乙庚丑未=8 · 丙辛寅申=7 · 丁壬卯酉=6 · 戊癸辰戌=5 · 巳亥=4
- 중천수(中天數): 甲己辰戌丑未=11 · 乙庚申酉=10 · 丙辛亥子=9 · 丁壬寅卯=8 · 戊癸巳午=7
| 수 | 조합 |
|---|---|
| 태세수(太歲數) | 中天數(천간) + 中天數(지지) |
| 월건수(月建數) | 先天數(천간) + 先天數(지지) |
| 일진수(日辰數) | 先天數(천간) + 中天數(지지) |
출처 (독립 3소스 교차 검증):
- badukworld.co.kr — 작괘법 및 선천수·중천수 수표 원문
- chunun.com — 60갑자 태세수·월건수·일진수 대조표
- myungmundang.net — 계산 예시
테스트(test/calc.test.js)가 "생성 표 = 공식 = 공개 대조표 앵커" 등가를 강제한다.
음양력 변환과 연·월·일 간지 산출은 korean-lunar-calendar를 사용한다.
도구(Tools)
tojeong_fortune (주력)
생년월일로 당년 토정비결 운세를 조회한다.
| 입력 | 타입 | 기본값 | 설명 |
|---|---|---|---|
birth_date |
string (YYYY-MM-DD) | (필수) | 생년월일 |
calendar |
"solar" | "lunar" |
"solar" |
입력 달력 종류 |
is_leap_month |
boolean | false |
음력 윤달 여부 (calendar=lunar일 때만 유효) |
target_year |
integer | 현재 연도 | 운세를 보는 해(당년) |
출력: gwae_code, gwae{sang,jung,ha}, chongun, months{1..12}, 그리고 계산 감사(audit)용 meta(음/양력 생일, 윤달 정규화 여부, 한국나이, 태세·월건·일진 간지·수, 생월 날수).
윤달생은 평달로 간주하는 통례를 적용하며, 이때
meta.leap_month_normalized: true로 표기한다.당년 생월이 소월(29일)인데 생일이 30일이면 말일(29일)로 당겨 계산하고
meta.day_clamped: true로 표기한다. 이는 문서화된 전통 규칙이 아니라 무음(silent) 오답을 막기 위한 구현 관례다.
tojeong_gwae_lookup (보조)
괘코드(111~863, 상1-8·중1-6·하1-3)로 해당 괘의 총운·월별운 원문을 그대로 조회한다. 브라우징·테스트·SKILL 개발용.
설치
npm install
npm test # 픽스처 6종 검증
MCP 클라이언트 등록
Claude Desktop claude_desktop_config.json 또는 헤르메스 에이전트 MCP 설정:
{
"mcpServers": {
"tojeong": {
"command": "node",
"args": ["/absolute/path/to/mcp-tojeong/src/index.js"]
}
}
}
데이터·해석문 출처
144괘 한글 해석문은 개인 소장 자료(1998)를 기반으로 현대 맞춤법으로 윤문한 것이다. 데이터 구조: { "<괘코드>": { code, chongun, months } }.
라이선스
MIT © molpass
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.