# shinkuan/akagi

> akagi is a real-time mahjong AI assistant for Mahjong Soul, Tenhou and other platforms. It watches a game over a local MITM proxy or a Chromium window that it launches, mirrors the game state, and shows shanten, waits, agari rate, tenpai rate, per-opponent deal-in risk and a recommended discard in a draggable HUD. Its core is a single Rust binary built with Tauri, with a TypeScript frontend.

Source: https://github.com/shinkuan/akagi
Indexed: commit 97478d0 on 2026-08-14 by Repowise. Facts come from the source and git history, not from the maintainer.

## Facts

- Type: Command-line tool
- Language: Rust
- Stars: 1,141 at index time
- License: Apache-2.0
- Code health: 6.0/10, Fair
- Last commit: 2026-08-13
- Contributors: 16

## How it works

Game traffic enters through the MITM proxy or through frames the Chromium window intercepts over the Chrome DevTools Protocol. src/event_bus.rs defines the channel types that subsystems use, and src/lib.rs wires those buses at boot, so each subsystem holds only its own bus handles. The built-in bot's entry point is native_bot/src/lib.rs, which provides a decision each turn that the frontend/src/main.tsx app shows in the HUD through push events such as bot-response. With AutoPlay enabled, src/autoplay/majsoul/mod.rs carries out the bot's decisions in the game client. Bots installed from GitHub or a ZIP are extracted under mjai_bot, where bot.py is validated before use.

- frontend/index.html: entry point
- frontend/src/App.tsx: entry point
- frontend/src/i18n/index.ts: entry point
- frontend/src/main.tsx: entry point
- native_bot/src/lib.rs: entry point
Modules: src, frontend, native_bot, tests, assets, root, mjai_bot, .github. 352 files, 76,232 lines, 4,996 symbols.

## Code health

- Score: 6.0/10 (Fair)
- Rank: #215 of 4,000+ indexed repos
- Hotspots: src/autoplay/majsoul/mod.rs, src/bridge/majsoul/mod.rs, src/bot/manager.rs, src/bot/native.rs, src/ipc/commands.rs
- Lowest file: src/lib.rs
- Dead code: 35 findings

## Maintenance

- Last commit 2026-08-13, first commit 2024-01-05, 618 commits
- 16 contributors, bus factor 1

## Security

- Security findings are shown to signed-in users at https://repowise.dev/repo/shinkuan/akagi/security

## More

- Page: https://repowise.dev/repo/shinkuan/akagi
- Ask this codebase: https://repowise.dev/repo/shinkuan/akagi/chat
- Docs: https://repowise.dev/repo/shinkuan/akagi/docs
- MCP (signs in with Repowise on first use):
    claude mcp add --transport http repowise https://api.repowise.dev/mcp/shinkuan/akagi
