# Mahjong Scoring Engine AI Agent Connect

> A deterministic Riichi Mahjong scoring calculator for Yaku, Fu, and final scores.

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

## Description

This MCP server provides precise, deterministic scoring for Riichi Mahjong. It connects AI agents to the complex logic of Japanese Mahjong scoring, including Yaku identification, Fu calculation, and final score distribution. Use `calculate_hand_value` to find the total Han and specific Yaku, `calculate_fu_points` to determine the point base, and `calculate_final_score` to get the final payment breakdown for both Tsumo and Ron wins.

## Tools

### calculate_final_score
Converts Han and Fu into the final score and payment breakdown

### calculate_fu_points
Calculates the Fu (point base) of the winning hand

### calculate_hand_value
Calculates the total Han count and lists applicable Yaku for a Mahjong hand

## Prompt Examples

**Prompt:** 
```
Calculate the hand value for these tiles: 123m 456p 789s 11z 234s, with no dora, no riichi, and it is a closed hand.
```

**Response:** 
```
The total Han is 1 (Tanyao).
```

**Prompt:** 
```
What is the final score for a 4 Han, 30 Fu hand where the winner is the dealer and it was a Ron win?
```

**Response:** 
```
The final score is 8000 points, paid by a single player.
```

**Prompt:** 
```
Calculate the Fu for a hand with tiles 123m 456p 789s 11z 234s, winning tile 1z, win type tsumo, and the hand is closed.
```

**Response:** 
```
The total Fu is 30.
```

## Frequently Asked Questions

**How do I calculate the total Han?**
You can use the `calculate_hand_value` tool. Provide the 14 tiles, dora indicators, and whether the hand is open or closed.

**Does this handle dealer multipliers?**
Yes, the `calculate_final_score` tool automatically applies the 1.5x multiplier for the dealer.

**Can I calculate Fu for a Tsumo win?**
Yes, use `calculate_fu_points` and specify 'tsumo' as the win type to include the necessary Tsumo points.
