Criterion

io.github.BalajSaleem由 GitHub 账号 BalajSaleem 发布v1.0.0更新于 Nov 2, 2026

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

已验证Streamable HTTP可网页运行网页搜索与抓取知识与记忆

概览

AI 生成的概览

远程 MCP 服务器,对古兰经经文与可靠圣训做语义检索,为伊斯兰教义问题返回带引用的段落。

可以做什么
  • 用自然语言检索全部 6,236 节古兰经经文
  • 检索六部圣训集中的圣训,可按等级与合集筛选
  • 按章节与节号等引用定位某一节经文
  • 对靠前的结果附带前后文与来源引用
适用场景
适合让助手在回答伊斯兰教义相关问题时以古兰经与圣训原文为依据,而不是依赖通用知识,可用于学习、了解或研究。
运行要求
需要一个远程 MCP 端点;未声明任何软件包、账号或 API 密钥。README 中的自建说明(Node.js、PostgreSQL、XAI 与 Google AI 密钥)仅适用于自行部署副本,与托管端点无关。
安装前请注意
查询会发送到第三方托管服务,问题与检索词会离开本机。README 说明项目回避教派与争议话题,并默认使用 Sahih 等级圣训,因此结果反映这些编辑取向;引用请对照原始来源核实。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Criterion,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.BalajSaleem%2Fcriterion/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "criterion": {
      "type": "http",
      "url": "https://criterion.life/api/mcp"
    }
  }
}

README

Criterion - Islamic Knowledge Assistant

An AI-powered Da'i (invitor to Islam) bringing authentic Islamic guidance to seekers worldwide.

Built on the Quran and authentic Hadith. Free forever. For the sake of Allah.

Mission · Features · Tech Stack · Getting Started · MCP Server · Documentation


Mission

Criterion exists to bring authentic Islamic knowledge to anyone seeking truth, using modern technology to make divine guidance accessible to all of humanity — freely, forever, for the sake of Allah alone.

Our Four Pillars

  1. Truth & Authenticity — Every response is grounded in verified sources (Quran and Sahih Hadith). We never fabricate or hallucinate.
  2. Fundamentals & Simplicity — We focus on core Islamic teachings that unite. We avoid sectarian debates and controversial topics.
  3. For the Sake of Allah — Criterion will always be free, with no monetization or organizational promotion. This is Sadaqah Jariyah.
  4. State of the Art — We use cutting-edge AI to deliver Islamic guidance effectively to the masses.

👉 Read the full mission and vision in MISSION.md

Key Differentiators

Mission-Aligned:

  • ✨ Free Forever — No paywalls, no ads, no monetization. Built fi sabilillah (for Allah's sake)
  • 📚 Fundamentals-Focused — Avoids sectarian debates, focuses on universally accepted Islamic teachings
  • 🛡️ Trust-First — Grade-filtered authentic Hadith (defaults to Sahih), verified sources only
  • 🤝 Seeker-Oriented — Designed for curious minds, new Muslims, and students of knowledge
  • 🕌 Da'i Personality — Compassionate, knowledgeable, humble guidance

Technical Excellence:

  • 🎯 Semantic Search — Natural language queries return relevant verses from 6,236 Quran verses + 21,641 Hadith narrations
  • 📖 Contextual Retrieval — Top results include ±2 surrounding verses/narrations for proper context
  • 🌐 Multilingual — Read in English (fast) + Slovak (expandable to 10+ languages)
  • 🔗 Accurate Citations — All responses include source references with hyperlinks (Quran.com, Sunnah.com)
  • ⚡ Fast — <150ms query response time

Features

What Criterion Does

✅ Semantic Quran Search — Ask natural language questions, get relevant verses
✅ Semantic Hadith Search — Search authentic Hadith with grade & collection filtering
✅ Contextual Understanding — Top results include surrounding context for proper meaning
✅ Accurate Citations — Every response cites real sources with hyperlinks
✅ Multilingual Reading — English (fast) + Slovak (single JOIN <200ms)
✅ Shareable URLs — /quran/search?q=patience, /hadith/search?q=charity, and /quran/2/255 with metadata
✅ Real-time Streaming — Progressive response generation with token-by-token delivery
✅ Tool-Based RAG — LLM autonomously decides when to retrieve from Quran/Hadith

Technical Stack

How It Works

The RAG Pipeline

User Question    ↓XAI Grok 4 LLM (decides which tools to use)    ↓Tool Selection:  - queryQuran → 6,236 verses (top 7 for chat, top 20 for search)  - queryHadith → 21,641 hadiths from 6 collections (top 3 for chat, top 15 for search, with grade filtering)    ↓Vector Search (768-dim Gemini embeddings)    ↓Context Enhancement (top 3 get ±2 surrounding verses)    ↓LLM Generates Response with Citations    ↓Real-time Stream to User (Server-Sent Events)

Data

  • 6,236 Quran verses from all 114 Surahs

    • Arabic text (Tanzil Quran)
    • English translation (master)
    • Slovak translation (expandable)
    • 768-dimensional embeddings (Gemini text-embedding-004)
  • 21,641 Hadith narrations from 6 major collections (Kutub al-Sittah subset)

    • Sahih Bukhari (7,558)
    • Sahih Muslim (2,920)
    • Jami` at-Tirmidhi (3,951)
    • Sunan Abi Dawud (5,274)
    • 40 Hadith Nawawi (42)
    • Riyad as-Salihin (1,896)
    • Grade filtering (Sahih, Hasan, Da'if)
    • 768-dimensional embeddings

Performance

  • Quran search: <150ms (English), <200ms (translated)
  • Hadith search: <150ms
  • Vector search: Powered by HNSW indexes
  • Streaming: Real-time token-by-token delivery

Getting Started

Prerequisites

  • Node.js 18+ and pnpm
  • PostgreSQL database (recommend Neon)
  • API Keys:
    • XAI API Key (for Grok LLM)
    • Google AI Studio API Key (for embeddings)

Installation

  1. Clone the repository
bash
git clone <repo-url>cd criterion
  1. Install dependencies
bash
pnpm install
  1. Set up environment variables

Create a .env.local file:

bash
# DatabasePOSTGRES_URL=postgresql://...
# AI APIsXAI_API_KEY=xai-...AI_GATEWAY_API_KEY=...
# Authentication (optional)AUTH_SECRET=...
  1. Enable pgvector extension
bash
pnpm db:enable-pgvector
  1. Run database migrations
bash
pnpm db:migrate
  1. Ingest Quran data (generates embeddings for 6,236 verses)
bash
pnpm ingest:quran

This will take 10-15 minutes to complete.

  1. Test the Quran search
bash
pnpm test:quran
  1. Start the development server
bash
pnpm dev

Your app should now be running on localhost:3000.

Available Commands

Development

bash
pnpm dev          # Start dev serverpnpm build        # Build for productionpnpm start        # Start production server

Database

bash
pnpm db:generate  # Generate Drizzle schemapnpm db:migrate   # Run migrationspnpm db:studio    # Open Drizzle Studio (GUI)

Data Ingestion & Testing

bash
# Quranpnpm clear:quran         # Clear all Quran datapnpm ingest:quran        # Ingest Quran verses and generate embeddingspnpm ingest:quran:slovak # Ingest Slovak translationpnpm test:quran          # Test Quran search functionality
# Hadithpnpm clear:hadith  # Clear all Hadith datapnpm ingest:hadith # Ingest Hadith and generate embeddings

MCP Server

Criterion exposes its semantic search capabilities through the Model Context Protocol (MCP), allowing AI assistants like Claude Desktop and Cursor to search Quran and Hadith directly.

Quick Setup:

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

Available Tools:

  • search_quran — Search 6,236 Quran verses
  • search_hadith — Search 21,641 authentic Hadiths from 6 collections
  • get_verse — Retrieve specific verse by reference (e.g., "2:255")

👉 Read full MCP documentation in MCP.md

Project Structure

criterion/├── app/│   ├── (auth)/          # Authentication routes│   ├── (chat)/          # Chat interface and API│   │   └── api/chat/    # Main chat endpoint│   ├── search/          # Quran search page│   │   └── api/         # Quran search API│   ├── hadith/│   │   └── search/      # Hadith search page and API│   └── quran/           # Quran reading pages├── lib/│   ├── ai/│   │   ├── embeddings.ts     # Core RAG logic│   │   ├── prompts.ts        # Da'i system prompts│   │   └── tools/│   │       ├── query-quran.ts   # Quran search tool│   │       └── query-hadith.ts  # Hadith search tool│   └── db/│       ├── schema.ts         # Database schema│       └── migrations/       # SQL migrations├── components/│   ├── chat.tsx              # Main chat UI│   ├── quran-verses.tsx      # Quran display component│   ├── hadith-narrations.tsx # Hadith carousel│   └── hadith/│       └── hadith-card.tsx   # Reusable hadith card├── scripts/│   ├── ingest-quran.ts       # Quran data ingestion│   ├── ingest-hadith.ts      # Hadith data ingestion│   └── test-*.ts             # Test scripts└── data/    ├── quran*.txt            # Quran translations    └── *-full.json           # Hadith collections

Documentation

Understanding Criterion

  • MISSION.md — Our vision, values, and deeper purpose. Read this first to understand why we build Criterion.
  • CRITERION_DETAILED.md — Comprehensive technical documentation including architecture, implementation history, and performance metrics.
  • CRITERION.md — Quick reference guide for setup and key concepts.

Key Sections

DocumentPurpose
MISSION.mdVision, values, pillars, and long-term goals
CRITERION_DETAILED.mdTechnical architecture, database schema, components, and best practices
CRITERION.mdQuick start, commands, and core concepts
README.mdGetting started, features, and project overview

Architecture Overview

components/├── Chat UI (QuranVerses, HadithNarrations, MessageActions)├── Search Pages (Quran and Hadith semantic search with filters)├── Hadith Components (reusable HadithCard for search and chat)├── Quran Pages (shared components for context, language selection)└── UI Components (buttons, inputs, etc.)
lib/├── ai/│   ├── embeddings.ts (vector search logic)│   ├── prompts.ts (Da'i system prompts)│   └── tools/ (queryQuran, queryHadith, requestSuggestions)├── db/│   ├── schema.ts (Drizzle ORM definitions)│   └── queries.ts (database functions)└── monitoring/ (performance tracking)
app/├── (chat)/api/chat (main chat endpoint)├── quran/search/ (Quran search page and API)├── hadith/search/ (Hadith search page and API)├── quran/ (Quran reading pages)└── (auth)/ (authentication)

Data Attribution

  • Quran Text: Tanzil.net — Creative Commons Attribution 3.0
  • Quran Translations: Multiple sources with proper attribution
  • Hadith Collections: Sunnah.com, IslamicNetwork.com
  • Embeddings: Google Gemini text-embedding-004

Our Commitment

Criterion is built with these commitments:

  • ✅ Never monetize Islamic knowledge
  • ✅ Always cite sources with proper references
  • ✅ Never fabricate verses or hadiths
  • ✅ Focus on fundamentals — avoid sectarian debates
  • ✅ Build for the community — this belongs to all Muslims and benefits all humanity
  • ✅ Stay at the forefront — leverage state-of-the-art technology

Contributing

We welcome contributions from developers, scholars, and community members who share our mission. Please see CONTRIBUTING.md for guidelines.

License

  • Quran Text: Creative Commons Attribution 3.0 (Tanzil.net)
  • Hadith Data: From verified Islamic sources with proper attribution
  • Code: See LICENSE file for details

"Invite to the way of your Lord with wisdom and good instruction, and argue with them in a way that is best." — Quran 16:125

May Allah accept this work and make it a means of guidance for seekers everywhere. Ameen.

来源:README.md,提交 691e714

工具

0
SourceWeft 尚未读取此服务器的工具。

版本历史

1
  1. v1.0.0最新Sep 16, 2026

评分

已满足适用检查项的 75%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。