🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

arabicfmt-mcp

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arabicfmt-mcp

Model Context Protocol (MCP) server exposing arabicfmt's Arabic-first formatting tools (currency, Hijri dates, numbers, bidi text, validation) to AI agents like Claude and Cursor.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

arabicfmt-mcp

A Model Context Protocol (MCP) server that exposes arabicfmt — Arabic-first formatting for numbers, currency, Hijri dates, bidirectional text, and validation — as callable tools for AI agents such as Claude Desktop, Claude Code, and Cursor.

Once connected, an agent can format Saudi Riyal amounts, convert Gregorian dates to Hijri, spell numbers in Arabic, isolate foreign text for correct RTL rendering, validate IBANs and Saudi IDs, and more — by calling tools directly instead of guessing.

Run

No install or build step required — it runs straight from npm over stdio:

npx arabicfmt-mcp

The server speaks MCP over stdio. It is meant to be launched by an MCP client (see below), not run interactively.

Requires Node.js >= 18.

Configure your client

Add the server to your client's mcpServers configuration.

Claude Desktop

Edit your config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "arabicfmt": {
      "command": "npx",
      "args": ["-y", "arabicfmt-mcp"]
    }
  }
}

Cursor

Edit ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project):

{
  "mcpServers": {
    "arabicfmt": {
      "command": "npx",
      "args": ["-y", "arabicfmt-mcp"]
    }
  }
}

Restart the client after editing, then ask the agent to use an arabicfmt tool.

Tools

ToolDescription
format_currencyFormat a number as an Arabic currency amount with the correct symbol and precision (e.g. 1234.5 SAR -> ١٬٢٣٤٫٥٠ ر.س).
spell_currencySpell a currency amount in full Arabic words with correct grammatical agreement.
format_hijriFormat a Gregorian date as a Hijri date string (e.g. ٢٣ رمضان ١٤٤٧ هـ).
to_hijriConvert a Gregorian date to Hijri components {year, month, day}.
arabic_to_wordsConvert an integer to Arabic cardinal words.
arabic_ordinalConvert an integer to Arabic ordinal words (e.g. 25 -> الخامس والعشرون).
format_numberFormat a number with grouping and optional Eastern Arabic numerals.
format_compactCompact notation with Arabic scale words (e.g. 1.2 مليون).
parse_numberParse a Latin/Eastern-Arabic numeric string into a number.
format_durationFormat milliseconds as natural Arabic words (e.g. ساعتان وخمس دقائق).
format_relative_timeFormat a date relative to a base date (e.g. منذ ٣ أيام).
arabic_pluralSelect the correct Arabic plural form for a count (CLDR categories).
isolate_foreignWrap foreign/LTR runs in bidi isolates for correct RTL rendering.
transliterateTransliterate Arabic text to Latin script.
slugifyConvert Arabic/mixed text into a URL-safe slug.
validate_ibanValidate an IBAN via checksum and country length.
validate_saudi_idValidate a Saudi national/iqama ID via its checksum.

Each tool returns its result as MCP text content. Date inputs are ISO 8601 strings (e.g. "2025-09-23"). The numerals option accepts "latn", "arab", or "arabext".

Development

cd mcp
npm install

Tool handlers are defined in tools.js and exported (tools, toolNames) so they can be unit-tested directly without a running server. index.js wires them into an McpServer (@modelcontextprotocol/sdk) over StdioServerTransport.

License

MIT (c) cc1a2b

Keywords

mcp

FAQs

Package last updated on 03 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts