# criterion [Health: Active]

**Category:** 🔮 Spirituality & Esoterica  
**Repository:** https://github.com/BalajSaleem/criterion  
**GitHub Stars:** 21  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/criterion

## Description
Semantic search across 6,236 Quran verses and 12,416 authentic Hadiths for Islamic guidance.

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "criterion": {
    "url": "https://criterion.life/api/mcp"
  }
}
```

## Documentation

## What criterion does

criterion connects MCP-compatible AI assistants to a searchable corpus of Quran verses and Hadith narrations. Its MCP interface provides three tools: `search_quran` for semantic retrieval across 6,236 verses, `search_hadith` for searching 21,641 narrations from six collections, and `get_verse` for retrieving a Quran verse from a reference such as `2:255`.

The source collection covers all 114 Quran surahs and includes Arabic text, an English translation, and Slovak translation data. Hadith content comes from Sahih Bukhari, Sahih Muslim, Jami` at-Tirmidhi, Sunan Abi Dawud, 40 Hadith Nawawi, and Riyad as-Salihin. Hadith searches can use authenticity grades including Sahih, Hasan, and Da'if.

## How it works

Natural-language queries are converted into embeddings and matched against vector indexes in PostgreSQL with pgvector. The application uses 768-dimensional embeddings generated with Google Gemini's `text-embedding-004` model.

The broader application uses retrieval-augmented generation: an LLM selects Quran or Hadith tools, the database returns matching passages, and responses include source references linking to Quran.com or Sunnah.com. Quran retrieval can add surrounding verses to improve context. The application also supports streamed responses, although the MCP tools are the relevant interface for external assistants.

## Setup and configuration

For the hosted MCP service, add the endpoint to an MCP client configuration:

```json
{
  "mcpServers": {
    "criterion": {
      "url": "https://criterion.life/api/mcp"
    }
  }
}
```

Claude Desktop and Cursor are shown as supported clients. A local development setup requires Node.js 18 or newer, pnpm, and PostgreSQL with the pgvector extension. Install dependencies with `pnpm install`, enable pgvector with `pnpm db:enable-pgvector`, and apply migrations using `pnpm db:migrate`.

The application configuration uses `POSTGRES_URL` for the database, `XAI_API_KEY` for the Grok language model, and `AI_GATEWAY_API_KEY` for the AI gateway. Quran and Hadith ingestion scripts populate the database and generate embeddings; Quran ingestion can take 10–15 minutes. Start the development application with `pnpm dev`.

## Tools and capabilities

- `search_quran`: Semantically search the Quran corpus.
- `search_hadith`: Search Hadith narrations with collection and grade filtering.
- `get_verse`: Retrieve a specific Quran verse by reference.
- Context-aware Quran retrieval can include nearby verses around top matches.
- English and Slovak Quran reading data are available, with English positioned as the faster path.
- Search is backed by HNSW vector indexes, with documented search targets below 150 milliseconds for English Quran and Hadith queries.

## Limitations and notes

The MCP interface is focused on Quran and Hadith retrieval rather than general-purpose religious research. The project emphasizes core Islamic teachings and avoids sectarian debates and controversial topics. Source coverage and translation availability depend on the ingested datasets; Slovak support is available as translation data, while broader multilingual expansion is described as future-oriented. Running the full application locally also requires external AI API access and a configured PostgreSQL database.

_Full upstream README: https://allmcps.com/mcp/criterion/readme_

