rtl-mcp
This MCP server provides right-to-left (RTL) awareness tools for coding agents, enabling detection and fixing of layout issues in RTL contexts, normalization of Arabic text, and text direction detection.
lint_rtl_code: Check code snippets (CSS, HTML, JSX, TSX) for RTL problems like physical CSS properties, directional Tailwind utilities, anddirattribute issues, suggesting logical replacements.lint_rtl_path: Scan files or directories on disk for the same RTL issues, skippingnode_modulesand build artifacts.normalize_arabic: Normalize Arabic text by stripping diacritics, unifying alef forms, and optionally converting digits, collapsing whitespace, and folding Taa Marbuta and Alef Maqsura for fuzzy matching (not for display).detect_direction: Determine if a string is RTL, LTR, mixed, or neutral, and recommend an appropriatedirattribute value.
Both lint tools accept a baseDir parameter ("ltr" or "rtl") to correctly map physical to logical properties based on the document's base direction.
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., "@rtl-mcp Lint this component for RTL issues."
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.
rtl-mcp
An MCP server that gives a coding agent right-to-left awareness.
Ask an agent for a card component and you get ml-4 text-left — correct English, broken Arabic. The agent has no way to check itself, because nothing in its toolbox knows what RTL is. This gives it four tools that do.
Install
Point your MCP client at the package. Nothing to install first — npx fetches it.
Claude Code
claude mcp add rtl -- npx -y rtl-mcpAny client that reads an mcpServers block (Claude Desktop, Cursor, Windsurf, Zed):
{
"mcpServers": {
"rtl": {
"command": "npx",
"args": ["-y", "rtl-mcp"]
}
}
}Related MCP server: code-review-automation
Tools
Tool | What the agent gets |
| Pass a snippet and a filename; get every physical CSS property, directional Tailwind utility and |
| The same check across a file or a whole directory on disk. |
| Fold the spellings users type interchangeably into one key — strips diacritics and tatweel, unifies the alef forms. For search and matching, not for display. |
| Whether a string is |
Both lint tools accept baseDir: "rtl" for an Arabic-first app — see below.
Why normalize_arabic matters
مُحَمَّد and محمد are the same name and different strings. So are أحمد and احمد. A user who types their name without diacritics will not find their own record, and the bug reads like a broken database rather than a text problem.
normalize_arabic("مُحَمَّدْ") → "محمد"
normalize_arabic("أحـمد") → "احمد"The two folds that change meaning — ى → ي and ة → ه — are off by default. They widen fuzzy search and corrupt anything you display.
Pass baseDir: "rtl" for an Arabic-first app
Which logical side a physical one maps to depends on the document's base direction. In ltr, left is the start; in rtl, left is the end. So text-right in an English-first app becomes text-end, and in an app rooted at <html dir="rtl"> it becomes text-start — the opposite edge. Take the default on an Arabic app and the agent mirrors a working layout.
Utilities the author already scoped, like ltr:left-3 rtl:right-3, are left alone entirely.
Why detect_direction is not just a regex
Arabic-Indic digits (٢٠٢٦) live inside the Arabic Unicode block, so the obvious implementation calls them RTL. Under the bidirectional algorithm they are class AN, not AL — they never set the direction of a paragraph. Only strong letters vote here, so ٢٠٢٦ comes back neutral and inherits its container's direction, which is what the spec says should happen.
Zero runtime dependencies
MCP over stdio is JSON-RPC 2.0, one message per line. The reference SDK brings seventeen transitive dependencies — Express, Hono, CORS, JOSE — none of which a stdio server uses. So the protocol layer here is written directly, and the only runtime dependency is rtl-lint.
That trade is only safe if conformance is proven rather than assumed. The test suite drives this server with the official SDK's client over a real stdio pipe. If the hand-written layer ever drifts from the specification, the reference implementation stops talking to it and CI goes red.
Protocol revisions understood: 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05. The server negotiates whichever one the client asks for.
Library use
The Arabic helpers work standalone, no MCP involved:
import { normalizeArabic, detectDirection } from "rtl-mcp/arabic";
normalizeArabic("مُحَمَّد"); // "محمد"
normalizeArabic("٢٠٢٦", { convertDigits: true }); // "2026"
detectDirection("مرحبا React").direction; // "mixed"Requirements
Node.js 20 or newer. (Node 18 reached end of life in April 2025.)
License
MIT © Khalel Hawary
Available Tools
4 toolsdetect_directionA
Report whether a string is predominantly right-to-left, left-to-right, mixed or neutral, and what to set dir to. Use it when you need to decide the direction of a label, a database field or a block of user content.
Inputs: text (required).
lint_rtl_codeA
Check a snippet of CSS, HTML, JSX or TSX for layout that breaks in right-to-left languages: physical CSS properties, directional Tailwind utilities, and dir problems. Returns each finding with the logical replacement. Use this before handing RTL-facing markup back to the user.
Inputs: code (required), filename (required), baseDir.
lint_rtl_pathA
Check a file or a whole directory on disk for right-to-left layout problems. Skips node_modules and build output.
Inputs: path (required), baseDir.
normalize_arabicA
Normalise Arabic text so that forms users type interchangeably compare equal — strips diacritics and tatweel and folds the alef variants. Use it for search keys, deduplication and matching, never for text you are about to display.
Inputs: text (required), convertDigits, unifyTaaMarbuta, unifyAlefMaqsura, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool serves a clearly distinct purpose: linting a snippet versus linting a path are separated by input scope, while direction detection and text normalization address different RTL concerns. The descriptions make the boundaries between tools easy to identify.
All tool names follow a consistent verb_object snake_case pattern: lint_rtl_code, lint_rtl_path, detect_direction, and normalize_arabic. The naming style is uniform and predictable.
Four tools is a well-scoped set for an RTL-focused utility server. Each tool covers a distinct RTL need without unnecessary redundancy or bloat.
The set covers the main RTL workflows: linting code, checking paths, detecting text direction, and normalizing Arabic text. A minor gap is the lack of equivalent normalization for other RTL scripts or an auto-fix option, but core use cases are well covered.
Maintenance
Related MCP Connectors
The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
MCP Server for JFrog, providing tools for development and artifact management.
ArcAgent MCP server for bounty discovery, workspace execution, and verified coding submissions.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server for correct Arabic formatting — currency, Hijri dates, number-to-words, RTL fixes and validation across all 22 Arab countries. Zero-dependency.17141 npm3MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for automated code review using AI agents. It analyzes code diffs or file paths for bugs, security issues, and style violations.MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that gives AI coding agents codebase navigation intelligence, enabling symbol lookup, reference finding, type inspection, and diagnostics through tools like locate, refs, hover, diagnostics, status, and rename.548 npmMIT
- AlicenseBqualityAmaintenanceAn MCP server for elite Arabic and bilingual RTL/LTR UI/UX design, providing tools for design pipelines, anti-AI-slop auditing, RTL layout conversion, Arabic typography optimization, and accessibility checks.14MIT