MCP Integration

Use KalimaLab as a Model Context Protocol (MCP) server — bring Arabic word intelligence directly into Claude Desktop, Cursor, and other AI tools.

What is MCP?

Model Context Protocol (MCP) is an open standard for connecting AI models to external tools and data sources. By adding KalimaLab as an MCP server, you give Claude, Cursor, and other compatible AI tools the ability to search Arabic words, analyze text, and validate vocabulary — without writing any glue code.

KalimaLab serves its MCP manifest at GET https://api.kalimalab.com/v1/mcp and accepts tool calls at POST https://api.kalimalab.com/v1/mcp. Tool calls require a valid API key.

Available tools

search_wordsSearch Arabic words by text, letter count, root, pattern, and part of speech.
get_wordGet full linguistic details for a single Arabic word.
get_daily_wordFetch the deterministic word of the day (same word all day, UTC).
get_random_wordsGet 1–20 randomly selected Arabic words.
analyze_textTokenize an Arabic passage and return word and letter frequency statistics.
validate_wordsCheck up to 100 words against the KalimaLab word database.
get_statsReturn database statistics: total words, roots, and patterns.

Client setup

Add the following to your MCP client configuration. The npx -y mcp-remote bridge is installed automatically.

{  "mcpServers": {    "kalimalab": {      "command": "npx",      "args": ["-y", "mcp-remote", "https://api.kalimalab.com/v1/mcp"],      "env": { "KALIMALAB_API_KEY": "klmt_live_your_key_here" }    }  }}

Configuration file locations

Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
Cursor: ~/.cursor/mcp.json
Windsurf: ~/.windsurf/mcp.json

Direct HTTP usage

You can also call the MCP endpoint directly from any HTTP client. The manifest is public; tool calls require your API key.

1. Fetch the manifest

bash
curl https://api.kalimalab.com/v1/mcp

2. Invoke a tool

bash
curl -X POST "https://api.kalimalab.com/v1/mcp" \  -H "x-api-key: klmt_live_your_key_here" \  -H "Content-Type: application/json" \  -d '{"tool": "search_words", "input": {"q": "كتب", "limit": 5}}'

Response

response.json
{  "data": {    "data": [      { "id": "wrd_001", "word": "كتب", "meaning_en": "to write", "letter_count": 3 }    ],    "total": 47  },  "error": null,  "meta": { "requestId": "req_abc123", "responseTimeMs": 12 }}

All tools follow the same request shape

Every tool call uses { "tool": "...", "input": { ... } }. The data field in the response is the raw tool output, wrapped in the standard KalimaLab envelope.

Discovery endpoint

KalimaLab also serves the manifest at the standard well-known location:

bash
curl https://api.kalimalab.com/.well-known/mcp.json

This redirects to GET /v1/mcp and is used by MCP-compatible discovery agents for automatic server detection.