rtl-mcp
MCP server that gives coding agents right-to-left awareness with tools to lint RTL code, normalize Arabic text, and detect text direction.
README
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-mcp
Any client that reads an mcpServers block (Claude Desktop, Cursor, Windsurf, Zed):
{
"mcpServers": {
"rtl": {
"command": "npx",
"args": ["-y", "rtl-mcp"]
}
}
}
Tools
| Tool | What the agent gets |
|---|---|
lint_rtl_code |
Pass a snippet and a filename; get every physical CSS property, directional Tailwind utility and dir problem, each with its logical replacement. Powered by rtl-lint. |
lint_rtl_path |
The same check across a file or a whole directory on disk. |
normalize_arabic |
Fold the spellings users type interchangeably into one key — strips diacritics and tatweel, unifies the alef forms. For search and matching, not for display. |
detect_direction |
Whether a string is rtl, ltr, mixed or neutral, and what to set dir to. |
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.
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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.