japan-utils-mcp
japan-utils-mcp
MCP server exposing Japan-specific utilities to AI agents (Claude, Cursor, Cline, Continue, etc.). Hand your agent the small bag of JP-specific functions every Japan-related task needs but no generic LLM gets right reliably:
🗓️ Era ↔ Western year —
令和8年↔2026🔤 Kanji → Hepburn romaji —
山田太郎→yamada tarou📮 Postal code lookup —
150-0001→東京都 渋谷区 神宮前🎌 National holiday calendar — is
2026-05-03a holiday? what about all of 2026?🅰️ Kana conversion — hiragana ↔ katakana ↔ half-width katakana
📏 Width normalization — full-width (全角) ↔ half-width (半角) for ASCII, digits, kana
👤 Name splitting —
山田太郎→ surname山田+ given太郎(statistical model)
Built on top of well-maintained Japanese libraries (jpholiday, posuto, pykakasi, jaconv, namedivider-python) — wrapped as MCP tools so any AI agent can call them without re-implementing reading rules, era arithmetic, postal data, or name-splitting heuristics.
Why this exists
Generic LLMs hallucinate on JP-specific data:
"What year is 令和8年?" — often wrong
"Convert 山田太郎 to romaji" — gets the surname wrong half the time
"What's the address for postal code 150-0001?" — fabricates plausible-looking nonsense
"Is May 3rd a Japanese holiday?" — guesses
This MCP gives them a deterministic answer.
Related MCP server: Torify — Japanese Locale APIs for AI Agents
Tools
Tool | What it does |
|
|
|
|
| Mixed Japanese text → Hepburn romaji + hiragana reading |
| 7-digit JP postal code → prefecture / city / area, with kana readings |
| Date string → is it a national holiday? + Japanese name + weekday |
| Year → all national holidays for that year |
| hiragana ↔ katakana ↔ half-width katakana, any direction |
| Full-width ↔ half-width for ASCII, digits, kana (with per-category control) |
| Japanese full name → surname + given name (statistical model with confidence) |
All tools return structured JSON. See tool docstrings in src/japan_utils_mcp/server.py for full schemas and examples.
Installation
Run with uvx (no install — recommended)
uvx japan-utils-mcpThat's it. uvx (from uv) handles install + run in one shot, isolated from your global Python.
From source
git clone https://github.com/vivek081166/japan-utils-mcp.git
cd japan-utils-mcp
uv sync
uv run japan-utils-mcpConfiguration
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"japan-utils": {
"command": "uvx",
"args": ["japan-utils-mcp"]
}
}
}Claude Code
claude mcp add japan-utils -- uvx japan-utils-mcpCursor / Cline / Continue
Same JSON snippet as Claude Desktop, in their respective MCP config files.
Examples
Once connected, ask your agent things like:
What year is 令和8年? →
era_to_western("令和8年")→2026
What's the address for postal code 150-0001? →
lookup_postal_code("150-0001")→東京都 渋谷区 神宮前
Convert 山田太郎 to romaji. →
kanji_to_romaji("山田太郎")→yamada tarou
Is May 3rd 2026 a Japanese holiday? →
is_holiday("2026-05-03")→憲法記念日(Constitution Memorial Day)
List all Japanese holidays in 2026. →
list_holidays(2026)→ 18 holidays with names and dates
Convert ヤマダタロウ to hiragana. →
convert_kana("ヤマダタロウ", "hiragana")→やまだたろう
Normalize ABC123 to half-width. →
normalize_width("ABC123", "to_half")→ABC123
Split 長谷川健太 into surname and given name. →
split_japanese_name("長谷川健太")→長谷川/健太
Caveats
Romaji of personal names uses the most common reading — proper nouns with unusual readings will be wrong. This is a fundamental limitation of any kanji-to-romaji conversion without disambiguation context.
Postal code dataset ships via the
posutolibrary, refreshed against Japan Post's monthly KEN_ALL. If you need ultra-fresh data, refreshposutoperiodically.Holidays covers national holidays (国民の祝日) only — not company-specific or regional observances.
Era conversion supports Meiji (明治) through Reiwa (令和). Earlier eras are not supported.
Development
git clone https://github.com/vivek081166/japan-utils-mcp.git
cd japan-utils-mcp
uv sync
uv run python -c "from japan_utils_mcp.server import era_to_western; print(era_to_western('令和8年'))"License
MIT
Available Tools
9 toolsconvert_kanaA
Convert between hiragana, katakana, and half-width katakana.
Args: text: Input string. Mix of hiragana, katakana, kanji, ASCII is fine — non-target characters pass through unchanged. to: Target script. One of: - 'hiragana' : ひらがな (e.g. ヤマダ → やまだ) - 'katakana' : カタカナ (full-width) (e.g. やまだ → ヤマダ) - 'half_kana' : ハンカクカタカナ (half-width katakana) (e.g. ヤマダ → ヤマダ) - 'full_kana' : ヤマダ (half-width → full-width katakana)
Returns: dict with keys: - input: str - output: str - to: str
Examples: convert_kana("ヤマダタロウ", "hiragana") → "やまだたろう" convert_kana("やまだたろう", "katakana") → "ヤマダタロウ" convert_kana("ヤマダ", "half_kana") → "ヤマダ" convert_kana("ヤマダ", "full_kana") → "ヤマダ"
Inputs: text (required), to (required). Returns: object
era_to_westernA
Convert a Japanese era year to a Western (Gregorian) year.
Args: era_year: An era-year string. Accepts kanji form ('令和8年', '令和8', '令和元年'), single-letter alias ('R8', 'H30'), or English alias ('Reiwa 8', 'Heisei 30').
Returns: dict with keys: - western_year: int (Gregorian year) - era_kanji: str (e.g. '令和') - era_english: str (e.g. 'Reiwa') - year_of_era: int
Examples: era_to_western("令和8年") → {"western_year": 2026, ...} era_to_western("R8") → {"western_year": 2026, ...} era_to_western("Reiwa 8") → {"western_year": 2026, ...}
Inputs: era_year (required). Returns: object
is_holidayA
Check whether a date is a Japanese national holiday (祝日).
Args: date_str: Date in 'YYYY-MM-DD', 'YYYY/MM/DD', or 'YYYYMMDD' format.
Returns: dict with keys: - date: str (normalized 'YYYY-MM-DD') - is_holiday: bool - name_jp: str | None (holiday name in Japanese, if applicable) - weekday_jp: str (e.g. '月', '火', ...) - weekday_en: str (e.g. 'Monday')
Examples: is_holiday("2026-05-03") → {"is_holiday": True, "name_jp": "憲法記念日", ...} is_holiday("2026-05-04") → {"is_holiday": True, "name_jp": "みどりの日", ...} is_holiday("2026-05-08") → {"is_holiday": False, "name_jp": None, ...}
Notes: - Covers national holidays only (祝日 designated by the 国民の祝日に関する法律). Does not cover company-specific or regional observances. - 振替休日 (substitute holidays) are correctly identified.
Inputs: date_str (required). Returns: object
kanji_to_romajiA
Transliterate Japanese text (kanji + kana mix) to Hepburn romaji.
Args: text: Japanese text. May contain kanji, hiragana, katakana, ASCII. Non-Japanese characters pass through unchanged.
Returns: dict with keys: - romaji: str (space-separated Hepburn romaji) - hiragana: str (kanji converted to hiragana, kana preserved) - input: str (echo of the original input)
Examples: kanji_to_romaji("山田太郎") → {"romaji": "yamada tarou", "hiragana": "やまだたろう"} kanji_to_romaji("東京駅") → {"romaji": "toukyou eki", "hiragana": "とうきょうえき"}
Caveats: - Kanji with multiple readings (e.g. proper nouns) may be ambiguous. The transliteration uses the most common reading, which is sometimes wrong for personal names. Use as a starting point, not a guarantee.
Inputs: text (required). Returns: object
list_holidaysA
List all Japanese national holidays for a given year.
Args: year: Western year (e.g. 2026).
Returns: dict with keys: - year: int - count: int - holidays: list of {date: 'YYYY-MM-DD', name_jp: str, weekday_en: str}
Examples: list_holidays(2026) → {"year": 2026, "count": 16, "holidays": [...]}
Inputs: year (required). Returns: object
lookup_postal_codeA
Look up a Japanese postal code (郵便番号) and return address components.
Args: postal_code: 7-digit JP postal code. Accepts '150-0001', '1500001', '150 0001', or with full-width digits.
Returns: dict with keys: - postal_code: str (normalized 7-digit form) - prefecture: str (都道府県) - city: str (市区町村) - area: str (町域 — neighborhood/area) - prefecture_kana: str (katakana reading of prefecture) - city_kana: str - area_kana: str - found: bool (true if the code resolved)
Examples: lookup_postal_code("150-0001") → { "postal_code": "1500001", "prefecture": "東京都", "city": "渋谷区", "area": "神宮前", ... "found": True, }
Inputs: postal_code (required). Returns: object
normalize_widthA
Convert between half-width (半角) and full-width (全角) characters.
Args: text: Input string. mode: Conversion direction. One of: - 'to_full' : half-width → full-width for all categories (kana, ascii, digits) - 'to_half' : full-width → half-width for all categories - 'to_full_ascii_only' : convert only ASCII letters and digits to full-width, leave kana untouched - 'to_half_ascii_only' : convert only full-width ASCII to half-width - 'to_full_kana_only' : convert only half-width katakana to full-width - 'to_half_kana_only' : convert only full-width katakana to half-width
Returns: dict with keys: - input: str - output: str - mode: str
Examples: normalize_width("ABC123", "to_half") → "ABC123" normalize_width("ABC123", "to_full") → "ABC123" normalize_width("カタカナ", "to_full") → "カタカナ"
Inputs: text (required), mode. Returns: object
split_japanese_nameA
Split a Japanese full name into surname (姓) and given name (名).
Uses a kanji-feature-based statistical model (namedivider-python).
Args: full_name: Japanese full name written in kanji, with no separator (e.g. '山田太郎', '長谷川健太'). Names with existing separators (space, comma) are also accepted — the separator will be re-detected.
Returns: dict with keys: - input: str - family: str (姓 — surname) - given: str (名 — given name) - confidence: float (0.0–1.0; higher = more confident split) - algorithm: str (which underlying algorithm produced the split)
Examples: split_japanese_name("山田太郎") → {"family": "山田", "given": "太郎", ...} split_japanese_name("長谷川健太") → {"family": "長谷川", "given": "健太", ...} split_japanese_name("佐藤花子") → {"family": "佐藤", "given": "花子", ...}
Caveats: - Statistical model — not 100% accurate, especially for unusual names or non-traditional name compositions. - Confidence < 0.5 indicates an ambiguous split; treat with caution. - Single-kanji surnames + single-kanji given names (e.g. '林修') are fundamentally ambiguous without external context.
Inputs: full_name (required). Returns: object
western_to_eraA
Convert a Western (Gregorian) year to its Japanese era year.
Note: this returns the era in effect for the majority of the given Gregorian year. For year transitions (e.g. 1989 split between 昭和64 and 平成1), it returns the newer era.
Args: year: Western year (e.g. 2026). Must be 1868 or later.
Returns: dict with keys: - era_kanji: str - era_english: str - year_of_era: int (1 for the first year of an era; written as 元年 in formal Japanese) - era_year_kanji: str (e.g. '令和8年') - era_year_short: str (e.g. 'R8')
Examples: western_to_era(2026) → {"era_kanji": "令和", "era_english": "Reiwa", "year_of_era": 8, "era_year_kanji": "令和8年", "era_year_short": "R8"}
Inputs: year (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool targets a unique operation – kana conversion, era conversion, holiday checking, romaji transliteration, postal code lookup, width normalization, name splitting, and era-to-Western conversion. There is no functional overlap or ambiguity.
All tool names follow a consistent snake_case pattern with verb + noun or noun + verb structure (e.g., convert_kana, is_holiday, list_holidays). No mixed case or inconsistent styles.
With 9 tools covering a broad set of Japanese language utilities (kana, kanji, eras, holidays, addresses, names), the number feels well-scoped. Enough to be useful without being overwhelming.
The set covers essential Japanese text operations: kana/width normalization, romaji, era conversion both ways, holiday queries (single and list), postal code lookup, and name splitting. Minor gaps like lunar calendar or date formatting exist but do not undermine core utility.
Maintenance
Related MCP Connectors
Japan data tools for AI agents: calendar (rokuyo), address, name splitting, corporate number lookup
39 Japanese locale APIs — wareki, NTA invoice, 法人番号, postal, romanization, kanji-kana (Workers AI).
Japanese business days, holiday checks and invoice due dates for your AI agent.
13 free utility tools for AI agents: web text, markdown, hashing, IDs, dates, units, JSON.
Related MCP Servers
- AlicenseAqualityCmaintenanceJapan Operations OS for AI agents — 14 knowledge domains covering regulations, protocols, calendar, travel, food culture, language, disaster safety, daily life, and persistent memory. 31 MCP tools via REST + Streamable HTTP.31MIT
- AlicenseNot gradedqualityCmaintenanceTorify gives AI agents the Japanese locale primitives that standard libraries lack — imperial era date conversion (wareki), qualified invoice number validation with NTA registry lookup, corporate number lookup (法人番号), postal code resolution, name romanization (Hepburn), and kanji-to-kana conversion via Yahoo! JLP. 31 endpoints total. No authentication required for MCP. Pay-per-call $0.02/call viaMIT
- AlicenseAqualityDmaintenanceEnables AI assistants to perform Japanese business calendar calculations including holiday detection, business day arithmetic, payment date settlement, and deadline management using local data.6MIT
- AlicenseAqualityDmaintenancePortable agent tools with typed schemas (diff, cron, units, JSON→TS, outdoor helpers, prompts). Free to try—no account required.30MIT