finds.dev← search

// the find

EndlessCheng/mahjong-helper

★ 2,344 · Go · MIT · updated Jun 2022

日本麻将助手:牌效+防守+记牌(支持雀魂、天凤)

A Go CLI/server that analyzes Japanese riichi mahjong hands in real time — tile efficiency, defense/danger-tile reading, and discard tracking — by intercepting WebSocket traffic from Tenhou and Mahjong Soul. Built for competitive riichi players who want EV-style guidance (not just shanten) while playing or reviewing kifu.

The algorithmic core is real: shanten calculation, ukeire, agari/yaku detection, and risk-tile scoring all have dedicated implementations and unit tests (shanten_search_test.go, agari_test.go, risk_wall_test.go, yaku_test.go), not a thin wrapper around someone else's library. It also reverse-engineered and implemented Mahjong Soul's protobuf protocol (liqi.proto/liqi.pb.go) to parse kifu and live games, which is nontrivial. Works standalone too — the CLI takes a hand string directly for 何切る (what-to-discard) practice without needing the live-game plumbing at all.

Dead since June 2022 — both Tenhou and Majsoul have shipped client/protocol changes since, so the WebSocket injection almost certainly needs rework before it functions against current clients. The install flow is a liability: disable Chrome's localhost cert validation, install a third-party header-rewriting extension, pull a remote JSON ruleset, and patch the game's minified JS to exfiltrate traffic to a local server — any one step breaking (as several linked GitHub issues already show) silences the whole tool with no clear error. Self-signed cert and private key are committed to the repo (res/selfsigned.key), which is a bad habit even for localhost-only TLS. Documentation is Chinese-only with no English README, which will hard-block most non-Chinese riichi players from even attempting setup.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →