AlQari MCP Server
The official Model Context Protocol (MCP) server for AlQari, the document intelligence platform for Arabic and English documents.
Connect AlQari to Claude, ChatGPT, Codex, Cursor or any other MCP-compatible assistant, and work with your company's documents in plain language:
"OCR this invoice and extract the invoice number, VAT number and total."
"Find last month's Acme Trading contracts and summarize their payment terms."
"Check this invoice: VAT must be 15% of the subtotal and the supplier VAT number must be present."
Features
- OCR for PDFs and images in Arabic, English or both
- Search your company's documents by the words, names, numbers and dates inside them
- Ask, summarize, extract fields and tables, classify and validate any document
- Run your AlQari workflows on local files and read their results
- Usage reporting: every billed result reports the credits it used and the balance left
Requirements
- Python 3.10 or newer
- An AlQari company account, and an API key created by a company Admin
- An MCP-compatible app, such as Claude Desktop, Claude Code, the ChatGPT desktop app, Codex or Cursor
Quick start
1. Create an API key
- Sign in at alqari.sa with an Admin account.
- Open Settings → API Keys (direct link).
- Under Create new key, enter a name such as
AI assistantand click Create. - Click Copy, store the key somewhere safe, then click I've saved my key.
The key starts with qari_ and is shown only once. If you don't see the API Keys tab, ask your company's AlQari Admin for a key.
2. Install
pip install alqari-mcp
This installs the alqari-mcp command. Desktop apps often don't share your terminal's PATH, so note its full path:
where alqari-mcp # Windows
which alqari-mcp # macOS / Linux
3. Connect your app
Replace qari_your_api_key below with your own key.
Claude Desktop
Open Settings → Developer → Edit Config and add the server to claude_desktop_config.json:
{
"mcpServers": {
"alqari": {
"command": "C:\\path\\to\\alqari-mcp.exe",
"env": {
"ALQARI_API_KEY": "qari_your_api_key"
}
}
}
}
Set command to the full path from step 2. On Windows, write each backslash twice, as shown. Restart Claude Desktop, and the AlQari tools appear in the chat's tools menu.
Claude Code
claude mcp add --transport stdio alqari --env ALQARI_API_KEY=qari_your_api_key -- alqari-mcp
Run /mcp inside Claude Code to check the connection.
ChatGPT desktop app and Codex
The ChatGPT desktop app, the Codex CLI and the Codex IDE extension share one MCP configuration. Either run:
codex mcp add alqari --env ALQARI_API_KEY=qari_your_api_key -- alqari-mcp
or add this to ~/.codex/config.toml:
[mcp_servers.alqari]
command = "alqari-mcp" # or the full path from step 2
tool_timeout_sec = 300
[mcp_servers.alqari.env]
ALQARI_API_KEY = "qari_your_api_key"
Codex stops a tool after 60 seconds by default, so raise tool_timeout_sec: OCR of long PDFs and workflow runs can take longer.
Cursor
Add the same mcpServers block shown for Claude Desktop to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project).
Other MCP apps
Any app that supports local (stdio) MCP servers can run AlQari. Set the command to alqari-mcp (or its full path) and the environment variable ALQARI_API_KEY to your key.
Web and mobile apps: ChatGPT and Claude on the web and on mobile can only connect to MCP servers hosted on the internet, so they can't run this local server. Use a desktop app or a coding tool instead.
Tools
| Tool | What it does |
|---|---|
search_documents |
Find documents by the words, names, numbers or dates in them |
list_documents |
List documents, filtered by file name, status or type |
get_document_text |
Read a document's stored OCR text, in chunks |
upload_and_ocr |
Upload a local PDF or image and extract its text |
ask_document |
Ask a question and get an answer based on the document |
summarize_document |
Summarize a document as a brief, bullet points, sections or a narrative |
extract_fields |
Extract named fields, such as invoice number or total, as structured data |
extract_tables |
Extract tables as rows and columns |
classify_document |
Identify the document type, optionally from your own list of labels |
validate_document |
Check a document against rules written in plain language |
list_workflows |
List your company's AlQari workflows |
run_workflow |
Run an "Upload Document" workflow on local files |
get_workflow_run |
Check a workflow run's status, results and cost |
Uploads accept .pdf, .png, .jpg, .jpeg, .tif, .tiff and .webp files, given by their full path.
Billing
Billed tools are charged to the AlQari company that owns the API key, at the same credit prices as the AlQari web app and API.
- Each billed result includes
credits_consumedandremaining_credits. Workflow runs report abillingbreakdown instead. Your assistant can tell you what each action cost. - A call is refused before any work starts if the company is out of credits, its subscription or trial has ended, or it has an overdue invoice. The error message explains which.
- Work that has already run, such as OCR of an uploaded file, is charged in full, even if this takes the company past its remaining credits.
- Every charge appears in your company's AlQari usage history.
Configuration
| Environment variable | Required | Default | Description |
|---|---|---|---|
ALQARI_API_KEY |
Yes | ||
ALQARI_TIMEOUT |
No | 300 |
|
ALQARI_BASE_URL |
No | https://api.alqari.sa |
Security
- Protect your API key. It gives access to all of your company's documents and credits. Keep it out of shared files and source control. If a key leaks, click Revoke next to it on the API Keys tab and create a new one. Each person should have their own key, so one can be revoked without affecting the others.
- Runs on your computer. The server is a small local program that your AI app starts. It talks only to the AlQari API, over HTTPS, and keeps no copies of your documents.
- Uploads are limited to documents. Only PDF and image files can be uploaded. Other files, such as
.envfiles or private keys, are refused before they are read. - Billed tools are marked. Free tools carry MCP's read-only hint and billed tools don't, so apps that support tool hints can ask you before a call that spends credits.
- Document content is treated as data. The assistant is told never to follow instructions written inside a document.
Troubleshooting
| Problem | What to do |
|---|---|
| The AlQari tools don't appear | Use the full path to alqari-mcp in your app's config, then fully restart the app. |
HTTP 401 |
|
HTTP 402 |
|
| A tool times out | Long PDFs and workflow runs can take minutes. Raise your app's tool timeout, and ALQARI_TIMEOUT if needed. |
run_workflow returns runs in still_running |
To test the server without an AI app, use the MCP Inspector, which requires Node.js:
npx @modelcontextprotocol/inspector -e ALQARI_API_KEY=qari_your_api_key alqari-mcp
License
Released under the MIT License.
Metadata
Release files for alqari-mcp 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| alqari_mcp-1.0.0.tar.gz | 15.1 kB | Without provenance | Details for alqari_mcp-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| alqari_mcp-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for alqari_mcp-1.0.0-py3-none-any.whl |
Total release size: 27.6 kB
Release files / alqari_mcp-1.0.0.tar.gz
| Download URL | alqari_mcp-1.0.0.tar.gz |
|---|---|
| Size | 15.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f9600de83b1cccc48a640990217ef31247b136a098ffa8fb9f115bd6a0a3429
|
|
BLAKE2b-256 checksum How to use checksums |
46b24b210aae96d053c063448c8b08a2edb3e8c1ec2fa5be2c3124ca73ca7948
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / alqari_mcp-1.0.0-py3-none-any.whl
| Download URL | alqari_mcp-1.0.0-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a5e3f517d3663f32fbce70432893c912ad2f99abe5388662a3e246a0814c8f8
|
|
BLAKE2b-256 checksum How to use checksums |
5321a817f62c5f885b1b623b1cef103ab07f832e625dc9bce32f5f51233efa36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for alqari-mcp 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.