parsi-mcp
An offline MCP server giving AI agents Persian and Iran-specific tools for dates, validators, text, money, and RTL frontend work.
Convert between Gregorian and Jalali calendars; format, parse, add, diff, and inspect Jalali dates/years.
Validate and normalize Iranian national ID, bank card, Sheba, mobile, and postal code; identify bank, mobile operator, and landline province.
Process Persian text: normalization, ZWNJ/punctuation fixes, digit conversion, words↔numbers, slugify, sanitize, grouped-number parsing/formatting.
Handle money: rial/toman conversion, price in Persian words, VAT helper, price-input snippet.
Support RTL frontends: guidelines, CSS/Tailwind audit and logical-property conversion, starter snippets.
Runs fully offline with no API keys.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@parsi-mcp Convert 1403/05/12 to Gregorian, then format it in Persian with weekday"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
parsi-mcp
English | فارسی
An MCP server that gives AI agents (Claude, Cursor, VS Code Copilot and others) reliable Persian and Iran-specific tools. It runs fully offline, with no API keys: Jalali dates, Iranian validators, Persian text handling, grouped price inputs with Persian words, and an RTL frontend toolkit.
56 tools. See the full list in TOOLS.md.
Install
Requires Node.js 18+. The
npxcommands below work once the package is published to npm; until then use the local build.
Claude Code
claude mcp add parsi -- npx -y parsi-mcpOr install the plugin, which adds the MCP server and the persian-rtl-frontend skill:
claude plugin marketplace add amirjld/parsi-mcp
claude plugin install parsi@parsi-mcpCursor (~/.cursor/mcp.json or .cursor/mcp.json in a project)
{ "mcpServers": { "parsi": { "command": "npx", "args": ["-y", "parsi-mcp"] } } }Claude Desktop (claude_desktop_config.json: %APPDATA%\Claude\ on Windows, ~/Library/Application Support/Claude/ on macOS)
{ "mcpServers": { "parsi": { "command": "npx", "args": ["-y", "parsi-mcp"] } } }VS Code (.vscode/mcp.json)
{ "servers": { "parsi": { "type": "stdio", "command": "npx", "args": ["-y", "parsi-mcp"] } } }Agent skill (tells agents to build Persian UIs RTL-first and to call these tools):
npx skills add amirjld/parsi-mcpFrom source
git clone https://github.com/amirjld/parsi-mcp.git
cd parsi-mcp && npm install && npm run build
# then use: { "command": "node", "args": ["/absolute/path/to/parsi-mcp/dist/index.js"] }Related MCP server: torob-mcp
Before and after
You ask: "Build a checkout page in Persian with a price field."
Without parsi-mcp, agents typically produce an LTR page with margin-left and text-left, a plain number box, and Latin digits.
With parsi-mcp, the agent loads the RTL guidelines, takes rtl_starter_snippet for the layout and price_input_snippet for the field, and validates payment fields with validate_card_number and validate_sheba:
<html lang="fa" dir="rtl">
<!-- price input: typing 200000 shows ۲۰۰٬۰۰۰ -->
<input inputmode="numeric" value="۲۰۰٬۰۰۰" />
<p aria-live="polite">دویست هزار تومان</p>
</html>What is inside
Area | Highlights |
Jalali calendar | convert, format, parse, add, diff, month grid for date pickers, week/month/quarter/year ranges, relative text ( |
Iranian validators | national ID, legal-entity national ID, bank card, Sheba, mobile, postal code, bank and operator lookup, phone display formats, address parsing (province, postal code, plaque/unit/floor) |
Persian text | normalization, ZWNJ fixes, digits, number and ordinal words, words to number, slugs, fuzzy search, Persian sort, keyboard-layout fix, text stats and reading time, direction detection and bidi wrapping, safe truncation, lorem ipsum |
Money | rial/toman, grouped digits, price in words, VAT helper, Excel-safe CSV export, short forms ( |
RTL frontend | guidelines prompt/resource, CSS and Tailwind audit, converters to logical properties, starter snippets, price input snippets, Persian font presets |
Data | 31 provinces with ISO 3166-2 codes and capitals |
Data notes
Bank BINs, Sheba codes, mobile prefixes and province data only include entries confirmed by public sources. Lunar (Hijri) holiday dates, vehicle plate parsing and national-ID city lookup are not included because reliable offline data could not be verified. The VAT helper needs you to supply the rate.
Develop
npm install
npm run build
npm test
npm run docs:tools # regenerate TOOLS.md (a test fails if it is out of date)Each tool is a small pure function in src/lib, registered in src/server.ts. Contributions are welcome.
Releasing
See the maintainer steps in RELEASING.md.
License
MIT
Available Tools
56 toolsbank_from_cardB
Identify the Iranian bank from a card number (first 6 digits / BIN).
Inputs: card (required).
bank_from_shebaB
Identify the Iranian bank from a Sheba (IBAN) number (3-digit bank code).
Inputs: sheba (required).
calculate_vatB
VAT helper. Rate (percent) must be supplied. mode 'exclusive' = amount excludes tax, 'inclusive' = amount includes tax.
Inputs: mode (required), amount (required), ratePercent (required).
convert_rial_tomanB
Convert between rial and toman (1 toman = 10 rial).
Inputs: to (required), from (required), amount (required).
csv_export_safeA
Build Excel/Sheets-safe CSV from rows: UTF-8 BOM, correct quoting, Persian digits in numeric cells converted to ASCII so Excel treats them as numbers, formula-injection guard, warnings for digit strings Excel may corrupt.
Inputs: rows (required), bom, delimiter, excelSafe.
decimal_to_persian_wordsC
Decimals, percents and fractions in Persian words: '12.5' -> 'دوازده ممیز پنج دهم', percent adds درصد, fraction '3/4' -> 'سه چهارم'.
Inputs: value (required), mode, halfAsNim.
detect_text_directionA
Detect text direction (first-strong and dominant script, mixed flag) and optionally wrap the text bidi-safely: Unicode isolates (FSI/RLI/LRI) or HTML / dir=auto. Use for usernames, product names and mixed Persian/English strings.
Inputs: text (required), wrap.
fix_keyboard_layoutA
Fix text typed with the wrong keyboard layout using the standard Iranian layout (ISIRI 9147): 'sghl' -> 'سلام', and Persian typed on English back to Latin. direction 'auto' picks by script.
Inputs: text (required), direction.
format_iran_phoneC
Display formats for an Iranian mobile (0912 345 6789, +98 912 345 6789, E.164) or landline (021-12345678). Accepts Persian digits, +98, 0098.
Inputs: value (required), persianDigits.
format_jalali_dateC
Format a Jalali date. Tokens: YYYY YY MMMM MM M DD D dddd.
Inputs: day (required), year (required), month (required), pattern, +1 more.
format_number_groupedB
Group digits in threes (200000 -> 200,000 or ۲۰۰٬۰۰۰). Accepts Persian/Arabic digits.
Inputs: value (required), digits, separator.
format_short_numberB
Short Persian number form: 2500000 -> '۲٫۵ میلیون', 1200 -> '۱٫۲ هزار' (style 'latin' gives 2.5M). Optional unit like تومان.
Inputs: value (required), unit, style, maxFraction, +1 more.
gregorian_to_jalaliC
Convert a Gregorian date to the Jalali (Persian) calendar.
Inputs: day (required), year (required), month (required).
iran_business_daysA
Business-day helper: op 'is_business_day', 'add' (days may be negative) or 'count' (days after 'date' up to and including 'to'). Weekend is Friday (optionally Thursday too); supply holidays yourself or enable the fixed solar ones.
Inputs: op (required), date (required), to, days, +3 more.
iran_holidaysA
Fixed solar-calendar public holidays of a Jalali year (Nowruz 1-4 Farvardin, 12-13 Farvardin, 14-15 Khordad, 22 Bahman, 29 Esfand) with Gregorian dates, plus the Hijri-based holiday list WITHOUT dates. Lunar holidays shift yearly and need the official annual calendar.
Inputs: year (required).
iran_provincesA
List Iran's 31 provinces with ISO 3166-2 code, Persian/English names and capital. Optional query matches Persian or English names (letter-variant tolerant).
Inputs: query.
jalali_addB
Add days, months and/or years to a Jalali date (month overflow clamps to month length).
Inputs: day (required), year (required), month (required), days, +2 more.
jalali_ageA
Age (years, months, days, total days) from a Jalali birth date. asOf defaults to today.
Inputs: birth (required), asOf.
jalali_diffA
Days between two Jalali dates plus a Persian relative description.
Inputs: to (required), from (required).
jalali_month_gridA
Calendar grid for a Jalali month (for date-pickers): weeks of 7 cells with day number, Gregorian date and Friday flag; null cells pad the edges. Default week starts Saturday.
Inputs: year (required), month (required), weekStart.
jalali_period_rangeA
Start/end (Jalali and Gregorian) of the Jalali day, week (Saturday-Friday), month, quarter (season) or year containing a date. Use for reports and finance periods instead of Gregorian date libraries.
Inputs: date (required), period (required).
jalali_to_gregorianC
Convert a Jalali (Persian) date to the Gregorian calendar.
Inputs: day (required), year (required), month (required).
jalali_year_infoB
Leap-year status and month length for a Jalali year.
Inputs: year (required), month.
landline_provinceC
Find the province of an Iranian landline number from its area code.
Inputs: value (required).
mobile_operatorB
Detect the mobile operator (MCI/Irancell/Rightel) of an Iranian mobile number.
Inputs: value (required).
normalize_mobileB
Validate and normalize an Iranian mobile number to 09xxxxxxxxx.
Inputs: value (required).
normalize_persian_textB
Normalize Arabic letter variants to Persian, clean spacing, and convert digits to Persian.
Inputs: text (required).
number_to_persian_wordsB
Write a non-negative integer in Persian words, e.g. for invoices.
Inputs: value (required).
parse_grouped_numberA
Strip separators and Persian/Arabic digits to a clean number, e.g. '۲۰۰٬۰۰۰' -> '200000'.
Inputs: text (required).
parse_iran_addressB
Heuristically extract province, city (province capitals only), valid postal code, and plaque/unit/floor numbers from a Persian address string.
Inputs: text (required).
parse_jalali_dateB
Parse text like '1403/05/09', '۱۴۰۳-۵-۹' or '9 مرداد 1403' into a Jalali date.
Inputs: text (required).
persian_font_presetB
CSS for Persian fonts (vazirmatn, shabnam, sahel, iransans): import link, font stack with fallbacks, RTL base styles. IRANSans is commercial so no CDN is given.
Inputs: font (required), selector.
persian_fuzzy_searchA
Fuzzy-match a query against candidate strings, treating Arabic/Persian letter variants (ي/ی, ك/ک, آ/ا), diacritics, ZWNJ and digit styles as equal. Returns ranked matches with scores.
Inputs: query (required), candidates (required), limit, threshold.
persian_lorem_ipsumA
Deterministic Persian placeholder text (seeded, original word list; not real prose) for mockups.
Inputs: seed, paragraphs, wordsPerSentence, sentencesPerParagraph.
persian_ordinalB
Persian ordinal words: 3 -> سوم, 21 -> بیست و یکم, 30 -> سیام. 1 gives اول (set firstAsYekom for یکم).
Inputs: value (required), firstAsYekom.
persian_relative_timeA
Persian relative time like '۳ روز پیش' or '۲ ساعت دیگر'. Pass an ISO timestamp; 'now' defaults to the current time. Months = 30 days, years = 365 days.
Inputs: timestamp (required), now, persianDigits.
persian_sortA
Sort strings in Persian alphabetical order (ا ب پ ت ... ی). Digits first (numeric), then Persian, then Latin. Ignores ZWNJ and Arabic/Persian letter variants.
Inputs: items (required), order.
persian_text_statsA
Character, letter, digit, ZWNJ, word, sentence and paragraph counts for Persian/mixed text, plus reading time. wordsPerMinute is an adjustable assumption (default 180).
Inputs: text (required), wordsPerMinute.
persian_words_to_numberB
Convert Persian number words to a number, e.g. 'دویست و پنجاه هزار' -> 250000.
Inputs: text (required).
price_input_snippetB
Ready-to-use RTL-friendly price input code: digit grouping while typing with caret preserved, live Persian words (aria-live), raw value submission. variant 'core' returns the shared helpers.
Inputs: variant (required).
price_to_persian_wordsB
Amount in Persian words with unit, e.g. 200000 toman -> 'دویست هزار تومان'. Toman may have one decimal digit (tenths = rials).
Inputs: amount (required), unit.
rtl_audit_cssB
Scan CSS/HTML/JSX/Tailwind text for LTR-only patterns (margin-left, ml-4, text-align:left, float:left, left/right, forced ltr, directional icons...) and suggest logical replacements.
Inputs: code (required).
rtl_convert_cssB
Convert physical CSS (and React style objects) to logical properties.
Inputs: css (required).
rtl_convert_tailwindB
Convert Tailwind physical utilities to logical ones (ml-4 -> ms-4, pr-2 -> pe-2, text-left -> text-start).
Inputs: text (required).
rtl_guidelinesA
Full RTL frontend guidelines for Persian/Arabic UIs (also available as prompt and resource 'rtl-frontend-guidelines').
Inputs: no named parameters.
rtl_starter_snippetC
Minimal RTL-ready setup for html, css, tailwind, nextjs, react or vue.
Inputs: framework (required).
sanitize_persian_textB
Fix ZWNJ (half-space) for می/نمی and plural suffixes, Persian punctuation and spacing, Arabic letter variants.
Inputs: text (required).
slugify_persianC
Create a URL slug from Persian/Latin text.
Inputs: text (required), separator.
to_persian_digitsC
Convert any digits in a string to Persian digits.
Inputs: text (required).
truncate_persian_textB
Truncate text to maxLength (ellipsis included) without breaking words, ZWNJ-joined words, surrogate pairs or diacritics. mode 'word' (default) or 'char'.
Inputs: text (required), maxLength (required), mode, ellipsis.
validate_card_numberA
Validate a 16-digit Iranian bank card number (Luhn).
Inputs: value (required).
validate_jalali_dateA
Form validation for a Jalali date with readable reasons: month/day ranges (leap-aware), min, max and notFuture checks. Never throws.
Inputs: date (required), max, min, notFuture.
validate_legal_national_idB
Validate an 11-digit Iranian legal-entity national ID (شناسه ملی شخص حقوقی / company ID) with its checksum.
Inputs: value (required).
validate_national_idB
Validate an Iranian national ID (code melli) using its checksum.
Inputs: value (required).
validate_postal_codeC
Validate an Iranian 10-digit postal code.
Inputs: value (required).
validate_shebaC
Validate an Iranian Sheba (IBAN) number.
Inputs: value (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 56 tools
Most tools have clearly distinct purposes, but several clusters overlap: normalize_persian_text vs sanitize_persian_text, and the multiple number-to-words/formatting tools (number_to_persian_words, price_to_persian_words, decimal_to_persian_words, format_short_number). Descriptions help, but with 56 tools an agent may still hesitate between adjacent normalization/formatting utilities.
Names are uniformly snake_case and descriptive, with no camelCase mixing. The only minor inconsistency is that some are verb_noun (validate_*, format_*, parse_*) while others are noun-based (iran_provinces, persian_text_stats, rtl_starter_snippet), but the pattern remains predictable.
56 tools is far above the recommended 3–15 range and exceeds the 25+/50+ thresholds for overload. Even though the server covers a broad utility domain, this many separate tools creates selection overhead and agent confusion.
The surface is very comprehensive for Persian/Iranian development: text normalization, Jalali dates, numbers, banking/ID validators, phone data, and RTL frontend utilities. Gaps remain around official/lunar holiday dates and some edge cases (e.g., negative number words), but core workflows are well covered.
Maintenance
Related MCP Connectors
Web scraping and Iranian-web data tools for AI agents: JS rendering, proxies, Markdown output.
300+ offline developer utilities, plus 22 AI tools with a free API key. JSON, JWT, regex, cron, SQL.
300+ deterministic data utilities for AI agents: validate, normalize, parse, match, redact.
PDF and image tools for AI agents: compress, merge, split, OCR, sign. Runs locally, never uploads.
Related MCP Servers
AlicenseNot gradedqualityCmaintenanceEnables AI agents to scrape and interact with the live web, including Iranian sites, through remote Streamable HTTP tools for JavaScript rendering, rotating Iranian proxies, anti-bot handling, screenshots/PDFs, and site-specific actors with Markdown, text, or HTML output.MIT- AlicenseBqualityBmaintenanceEnables AI agents to compare prices across Iranian online and in-person shops, inspect each seller's offer with warranty and installment details, review roughly a year of price history, score deals, and find the cheapest shop for a whole basket. It is read-only, requires no account or API key, and runs locally for Claude, Cursor or Copilot.26454 PyPI1PolyForm Noncommercial 1.0.0
- AlicenseAqualityBmaintenanceEnables AI agents to read official Central Bank of Iran data through 11 read-only tools: historical exchange rates for ~48 currencies, inflation, weekly interbank and policy rates, news, liquidity, monthly statistics tables, sukuk auctions and open market operations, with no API key required. Text is Persian, dates accept Jalali or Gregorian, and output is compact JSON.11170 PyPIPolyForm Noncommercial 1.0.0
- AlicenseAqualityBmaintenanceEnables AI agents to query Iran's official calendar from Time.ir, convert dates across Jalali, Gregorian, and Hijri calendars, check holidays and occasions, and retrieve prayer times for Iranian cities.13311 PyPIPolyForm Noncommercial 1.0.0