ai-mldeveloper-tools

Criterion

balajsaleem

by balajsaleem

Criterion — semantic search across Quranic verses and authentic Hadiths for precise Islamic guidance, study, and researc

Provides semantic search across Quran verses and authentic Hadiths for Islamic guidance.

github stars

11

0 commentsdiscussion

Both formats append explainx.ai attribution and the canonical URL for this MCP server listing.

Free forever with no monetization21,641+ authentic Hadiths from verified collectionsContext-aware verse retrieval

best for

  • / Islamic scholars and students researching religious texts
  • / New Muslims seeking authentic Islamic guidance
  • / Developers building Islamic knowledge applications

capabilities

  • / Search Quran verses using semantic similarity
  • / Search authentic Hadith narrations from 6 major collections
  • / Retrieve specific Quran verses by reference
  • / Get contextual verses surrounding search results

what it does

Provides semantic search across 6,236 Quran verses and 21,641 authentic Hadiths from major Islamic collections to deliver Islamic guidance based on verified sources.

about

Criterion is a community-built MCP server published by balajsaleem that provides AI assistants with tools and capabilities via the Model Context Protocol. Criterion — semantic search across Quranic verses and authentic Hadiths for precise Islamic guidance, study, and researc It is categorized under ai ml, developer tools. This server exposes 3 tools that AI clients can invoke during conversations and coding sessions.

how to install

You can install Criterion in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server supports remote connections over HTTP, so no local installation is required.

license

NOASSERTION

Criterion is released under the NOASSERTION license.

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](./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 - [Next.js 15](https://nextjs.org) App Router with React 19 & Tailwind CSS - [Vercel AI SDK](https://ai-sdk.dev) for LLM integration and streaming - [XAI Grok 4](https://x.ai) for intelligent natural language responses - [PostgreSQL](https://neon.tech) with [pgvector](https://github.com/pgvector/pgvector) for vector search - [Drizzle ORM](https://orm.drizzle.team) for type-safe database access - [Google Gemini](https://ai.google.dev) text-embedding-004 (768 dimensions) - HNSW indexes for <150ms similarity search - [Auth.js](https://authjs.dev) for authentication - Deployed on [Vercel](https://vercel.com) ## 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](https://neon.tech)) - API Keys: - XAI API Key (for Grok LLM) - Google AI Studio API Key (for embeddings) ### Installation 1. **Clone the repository** ```bash git clone cd criterion ``` 2. **Install dependencies** ```bash pnpm install ``` 3. **Set up environment variables** Create a `.env.local` file: ```bash # Database POSTGRES_URL=postgresql://... # AI APIs XAI_API_KEY=xai-... GOOGLE_GENERATIVE_AI_API_KEY=... # Authentication (optional) AUTH_SECRET=... ``` 4. **Enable pgvector extension** ```bash pnpm db:enable-pgvector ``` 5. **Run database migrations** ```bash pnpm db:migrate ``` 6. **Ingest Quran data** (generates embeddings for 6,236 verses) ```bash pnpm ingest:quran ``` This will take 10-15 minutes to complete. 7. **Test the Quran search** ```bash pnpm test:quran ``` 8. **Start the development server** ```bash pnpm dev ``` Your app should now be running on [localhost:3000](http://localhost:3000). ## Available Commands ### Development ```bash pnpm dev # Start dev server pnpm build # Build for production pnpm start # Start production server ``` ### Database ```bash pnpm db:generate # Generate Drizzle schema pnpm db:migrate # Run migrations pnpm db:studio # Open Drizzle Studio (GUI) ``` ### Data Ingestion & Testing ```bash # Quran pnpm clear:quran # Clear all Quran data pnpm ingest:quran # Ingest Quran verses and generate embeddings pnpm ingest:quran:slovak # Ingest Slovak translation pnpm test:quran # Test Quran search functionality # Hadith pnpm clear:hadith # Clear all Hadith data pnpm 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](./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](./MISSION.md)** — Our vision, values, and deeper purpose. Read this first to understand _why_ we build Criterion. - **[CRITERION_DETAILED.md](./CRITERION_DETAILED.md)** — Comprehensive technical documentation including architecture, implementation history, and performance metrics. - **[CRITERION.md](./CRITERION.md)** — Quick reference guide for setup and key concepts. ### Key Sections | Document | Purpose | | ------------------------- | ----------------------------------------------------------------------- | | **MISSION.md** | Vision, values, pillars, and long-term goals | | **CRITERION_DETAILED.md** | Technical architecture, database schema, components, and best practices | | **CRITERION.md** | Quick start, commands, and core concepts | | **README.md** | Getting started, features, and project overview | ## Architecture Overview ``` components/ ├── Chat UI (QuranVerses, HadithNarrations, MessageActions) ---

FAQ

What is the Criterion MCP server?
Criterion is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
How do MCP servers relate to agent skills?
Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
How are reviews shown for Criterion?
This profile displays 73 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.8 out of 5—verify behavior in your own environment before production use.

Use Cases

Extended AI Capabilities

Add new capabilities to Claude beyond text generation

Example

Access external data sources, execute code, interact with tools and services

Transform Claude from chatbot to action-taking agent

Context Enhancement

Provide Claude with access to relevant context and data

Example

Load project documentation, access knowledge bases, query databases

Get more accurate, context-aware responses

Workflow Automation

Automate multi-step workflows combining AI and external tools

Example

Research → Summarize → Create document → Send notification

Complete complex tasks end-to-end without manual steps

Implementation Guide

Prerequisites

  • Claude Desktop 0.7.0+ or Cursor IDE with MCP support
  • Basic understanding of MCP architecture and capabilities
  • Access credentials for integrated services (if required)
  • Willingness to experiment and iterate on configuration

Time Estimate

15-60 minutes depending on server complexity

Installation Steps

  1. 1.Install MCP server: npm install -g [package-name] or via GitHub
  2. 2.Add server configuration to ~/.claude/mcp.json
  3. 3.Provide required credentials and configuration
  4. 4.Restart Claude Desktop to load new server
  5. 5.Test basic functionality with simple prompts
  6. 6.Explore capabilities and experiment with use cases
  7. 7.Document successful patterns for reuse

Troubleshooting

  • MCP server not loading: Check config syntax, verify installation
  • Connection errors: Check network, firewall, credentials
  • Feature not working: Read server docs, check required parameters
  • Performance issues: Monitor resource usage, check for network latency
  • Conflicts with other servers: Check port assignments, namespace collisions

Best Practices

✓ Do

  • +Read server documentation thoroughly before setup
  • +Start with simple use cases to validate functionality
  • +Test in non-production environment first
  • +Monitor resource usage and performance
  • +Keep servers updated for bug fixes and new features
  • +Document configuration for team members
  • +Use environment variables for sensitive configuration

✗ Don't

  • Don't grant overly permissive access to MCP servers
  • Don't skip reading security considerations in docs
  • Don't expose sensitive data without proper controls
  • Don't run untrusted MCP servers without code review
  • Don't ignore error messages—investigate root cause

💡 Pro Tips

  • Combine multiple MCP servers for powerful workflows
  • Create custom MCP servers for your specific needs
  • Share successful configurations with team
  • Use MCP inspector for debugging
  • Join MCP community for tips and troubleshooting

Technical Details

Architecture

Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.

Protocols

  • Model Context Protocol (MCP)
  • JSON-RPC 2.0
  • stdio or HTTP transport

Compatibility

  • Claude Desktop
  • Cursor IDE
  • Custom MCP clients

When to Use This

✓ Use When

Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.

✗ Avoid When

Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.

Integration

  • Tool composition: Chain multiple MCP tools in workflows
  • Context augmentation: Provide AI with relevant external data
  • Action delegation: Let AI execute tasks on external systems
  • Bidirectional sync: Keep AI context and external systems in sync

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.

List & Promote Your MCP Server

Share your MCP server with the developer community

GET_STARTED →
MCP server reviews

Ratings

4.873 reviews
  • James Kapoor· Dec 20, 2024

    According to our notes, Criterion benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.

  • Mateo Nasser· Dec 16, 2024

    Criterion is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.

  • Ama Taylor· Dec 12, 2024

    We wired Criterion into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.

  • Ira Desai· Dec 8, 2024

    I recommend Criterion for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.

  • Ira Abbas· Dec 8, 2024

    Criterion is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.

  • Ishan Chawla· Nov 27, 2024

    Criterion has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.

  • Maya Singh· Nov 15, 2024

    Criterion is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.

  • Ishan Bhatia· Nov 11, 2024

    We wired Criterion into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.

  • Kwame Shah· Nov 7, 2024

    Criterion reduced integration guesswork — categories and install configs on the listing matched the upstream repo.

  • Maya Srinivasan· Nov 3, 2024

    According to our notes, Criterion benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.

showing 1-10 of 73

1 / 8