arabic_ordinal
Convert an integer to its Arabic ordinal words (e.g. 25 -> "الخامس والعشرون").
Format Arabic correctly — currency symbols, Hijri dates, number-to-words, six plural forms and RTL isolation — as callable tools.
LABSCO SUMMARY
The Saudi riyal has its own Unicode code point and is routinely emitted as the Iranian rial instead. Hijri output varies between Node, Chrome, Safari and Hermes. Arabic needs six plural forms and most libraries ship two. These are exactly the errors a model will produce confidently and nobody catches until something is printed.
An MCP wrapper around arabicfmt, a zero-dependency Arabic formatting library. It formats and spells currency, converts Gregorian dates to Hijri, writes numbers as Arabic words, picks the right plural form, repairs RTL sentences, and validates IBANs and Saudi IDs.
The arabicfmt-mcp npm package over stdio, registered as io.github.cc1a2b/arabicfmt-mcp. Node.js 18 or newer. No account, no key, no network — every answer is computed locally, and the underlying library has zero runtime dependencies.
One command — npx -y arabicfmt-mcp
USE CASES
The formatted figure with the right symbol and precision, and the same amount spelled out in words.
Frozen tables rather than the host engine's calendar, so the same date renders identically everywhere.
Wrap the Latin or numeric run in bidi isolates so the RTL sentence around it stays intact.
Parse a string with Arabic grouping and decimal separators back into a plain number.
Real checksums rather than a regex that accepts a well-shaped but invalid number.
A slug that survives instead of stripping to empty or mojibake, with transliteration available separately.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
arabic_ordinalConvert an integer to its Arabic ordinal words (e.g. 25 -> "الخامس والعشرون").
arabic_pluralSelect the correct Arabic plural form for a count from the six CLDR categories (e.g. 5 books -> "كتب"). Returns the chosen word.
arabic_to_wordsConvert an integer to its full Arabic cardinal words (e.g. 1234567 -> "مليون ومئتان وأربعة وثلاثون ألفاً وخمسمئة وسبعة وستون").
format_compactFormat a number in compact notation with Arabic scale words (e.g. 1200000 with locale "ar" -> "1.2 مليون").
format_currencyFormat a number as an Arabic currency amount with the correct symbol, grouping, and decimal precision (e.g. 1234.5 SAR -> "1,234.50 ر.س"). Handles the 2025-2026 Unicode currency-symbol transition (Saudi Riyal U+20C1, etc.).
format_durationFormat a duration in milliseconds as natural Arabic words (e.g. 7500000 -> "ساعتان وخمس دقائق").
format_hijriFormat a Gregorian date as a Hijri (Islamic) date string with Arabic month names and era (e.g. 2025-09-23 -> "٢٣ رمضان ١٤٤٧ هـ").
format_numberFormat a number with locale-aware grouping, decimal separators, and optional Eastern Arabic numerals (e.g. 1234567.89 with numerals "arab" -> "١٬٢٣٤٬٥٦٧٫٨٩").
format_relative_timeFormat a date relative to a base date in Arabic (e.g. three days ago -> "منذ ٣ أيام"). Defaults the base to now.
isolate_foreignWrap foreign/LTR runs (phone numbers, Latin text, URLs) inside Arabic text with Unicode bidi isolates so they render correctly in RTL contexts (e.g. "اتصل على +1 (555) 234-5678 الآن").
parse_numberParse a string containing Latin or Eastern Arabic digits (with Arabic grouping/decimal separators) into a JavaScript number (e.g. "١٬٢٣٤٫٥٦" -> 1234.56). Returns the number as a string.
slugifyConvert Arabic (or mixed) text into a URL-safe slug (e.g. "مدينة جدة" -> "mdynh-jdh").
spell_currencySpell out a currency amount in full Arabic words, including the major and minor units with correct grammatical agreement (e.g. 1234.5 SAR -> "ألف ومئتان وأربعة وثلاثون ريالاً وخمسون هللة").
to_hijriConvert a Gregorian date to its Hijri components. Returns a JSON object string like {"year":1447,"month":9,"day":23}.
transliterateTransliterate Arabic text to Latin script (e.g. "مُحَمَّد" -> "muhammad").
validate_ibanValidate an IBAN (International Bank Account Number) using its checksum and country length (e.g. "SA03 8000 0000 6080 1016 7519" -> "true"). Returns "true" or "false".
validate_saudi_idValidate a Saudi national/iqama ID number using its Luhn-style checksum (e.g. "1012345672" -> "true"). Returns "true" or "false".
BEFORE YOU INSTALL
17 tools when we connected. About 50 library functions, such as stripTashkeel and formatIBAN, are not exposed as MCP tools.
Node.js ≥ 18
All 3 documented clients run the server on your machine.
CONTEXT COST
Rated by the size of the 17 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npx -y arabicfmt-mcp{
"mcpServers": {
"arabicfmt": {
"command": "npx",
"args": [
"-y",
"arabicfmt-mcp"
]
}
}
}