MCP Arabic Toolkit
# MCP Arabic Toolkit ๐
[](https://opensource.org/licenses/MIT)
[](https://github.com/seotarek/mcp-arabic-toolkit/actions/workflows/ci.yml)
[](https://www.python.org/downloads/)
[](https://modelcontextprotocol.io/)
**A high-performance Model Context Protocol (MCP) server providing Arabic Natural Language Processing (NLP), text normalization, diacritics stripping, dialect detection, and token efficiency analysis for AI agents.**
Developed by **Tarek Mohamed** ([@seotarek](https://github.com/seotarek))
---
## โจ Features
- โก **Model Context Protocol (MCP) Compatible:** Plug directly into Claude Desktop, Cursor, and any MCP client.
- ๐งน **Advanced Arabic Normalization:** Unify complex Alef variants, Hamza, Yaa, Taa Marbuta, and strip Tatweel.
- ๐ฏ **Tashkeel Stripping:** Remove diacritics (Harakat) accurately with zero distortion to core roots.
- ๐ฃ๏ธ **Arabic Dialect Classification:** Heuristic and marker-based identification across **Egyptian (EGY)**, **Levantine (LEV)**, **Gulf (GLF)**, **Maghrebi (MAG)**, and **Modern Standard Arabic (MSA)**.
- ๐ **Token & Prompt Efficiency Metrics:** Calculate character-to-word and token compression statistics to optimize LLM prompt budgets for Arabic workloads.
---
## ๐ ๏ธ MCP Tools Exposed
| Tool Name | Description |
| :--- | :--- |
| `arabic_normalize_text` | Normalizes Arabic letters, unifies orthographic variants, and strips elongation. |
| `arabic_strip_diacritics` | Strips all Tashkeel / Harakat from the input text. |
| `arabic_detect_dialect` | Identifies regional dialect with confidence scores. |
| `arabic_token_metrics` | Measures Arabic prompt density, word counts, and estimated token ratios. |
---
## ๐ Quickstart & Installation
### Option A: Direct Run via `uvx` (No installation needed)
```bash
uvx mcp-arabic-toolkit
```
Or configure Claude Desktop / Cursor directly:
```json
{
"mcpServers": {
"arabic-toolkit": {
"command": "uvx",
"args": ["mcp-arabic-toolkit"]
}
}
}
```
### Option B: Local Clone & Development
```bash
git clone https://github.com/seotarek/mcp-arabic-toolkit.git
cd mcp-arabic-toolkit
pip install -e .
```
---
## ๐งช Testing
Run the automated test suite:
```bash
python -m unittest discover tests
```
---
## ๐ License
This project is open source and available under the [MIT License](LICENSE).
TDQS
Scored across 4 tools
arabic_normalize_text and arabic_strip_diacritics overlap substantially, since normalization explicitly includes stripping diacritics and Tatweel, making strip_diacritics a near-subset. Descriptions do clarify that normalize additionally unifies Alef/Yaa variants, but an agent wanting only diacritic removal has two plausible choices. The other two tools (dialect detection, token metrics) are clearly distinct.
All four names use a consistent snake_case arabic_ prefix with a verb_noun structure (normalize_text, strip_diacritics, detect_dialect). arabic_token_metrics deviates slightly toward a noun phrase rather than an action verb, but the set reads predictably overall.
Four tools is a tight, well-scoped surface for a niche text-processing toolkit, with no filler operations. It is on the thin side โ one or two more capabilities would round out the offering โ but each existing tool earns its place.
The surface covers normalization, diacritic removal, dialect detection, and token statistics, but omits other core Arabic text operations such as tokenization/segmentation, stemming or stopword removal, and transliteration. Notably there is a metrics tool but no actual tokenizer, leaving a gap for prompt-processing workflows.