# Mahjong Riichi Scoring AI Agent Connect

> Deterministic Japanese Riichi Mahjong scoring calculator.

## Overview
- **Category:** utilities
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_qDEK8YB5ElCk0O0Dk9NO0kpG8LhoidCo2wBSp7XE/ai-agent-connect
- **Tags:** mahjong, riichi, scoring, japanese-games, math

## Description

This MCP server provides precise scoring calculations for Japanese Riichi Mahjong. It handles the complex logic of converting han and fu into total points, applying scoring plateaus like Mangan and Yakuman, and determining exact payout distributions for both Ron and Tsumo wins. Use `calculate_final_score` to get the complete breakdown of points gained and lost, or `calculate_score_tier` to identify the specific scoring plateau of a hand.

## Tools

### calculate_final_score
The primary entry point to calculate the total points gained by the winner and the distribution of losses

### calculate_score_tier
Identifies which scoring plateau (Mangan, Haneman, etc.) a hand falls into

### get_payout_distribution
Determines exactly how many points each player must pay based on the win type and dealer status

## Prompt Examples

**Prompt:** 
```
Calculate the score for a hand with 4 han and 30 fu where the winner is the dealer and it was a Ron win.
```

**Response:** 
```
The total points gained is 8000.
```

**Prompt:** 
```
What is the scoring tier for 1 han and 20 fu?
```

**Response:** 
```
The hand falls into the standard scoring tier.
```

**Prompt:** 
```
Calculate the payout for a Tsumo win with 2 han and 40 fu where the winner is not the dealer.
```

**Response:** 
```
The winner receives 2000 points, with the dealer paying 1000 and the other two players paying 500 each.
```

## Frequently Asked Questions

**How does the scoring handle dealer status?**
The tool accounts for dealer status in the `get_payout_distribution` logic, ensuring that in a Tsumo win, the dealer pays a different amount than non-dealers.

**What are the scoring plateaus?**
The server implements standard Riichi plateaus including Mangan, Haneman, Baiman, Sanbaiman, and Yakuman via the `calculate_score_tier` tool.

**Can I calculate the exact points for a specific hand?**
Yes, by using the `calculate_final_score` tool with the number of han, fu, dealer status, and win type.
