NCERT MCP

NCERT MCP

An MCP server that turns the entire NCERT/CBSE curriculum into queryable infrastructure, enabling semantic search, RAG explanations, question generation, and curriculum mapping for grades 1–12.

Category
Visit Server

README

NCERT MCP

Note: This project is a TypeScript/Bun port inspired by the original work from hatchedland/ncert-mcp. An open-source Model Context Protocol (MCP) server and REST API that turns the entire NCERT/CBSE curriculum (Grades 1–12) into structured, queryable infrastructure.

Built for ed-tech companies that want to build on top of NCERT content — explanations, question generation, semantic search, and topic mapping — without rebuilding the data pipeline themselves.


What it does

Capability Description
Semantic search Vectorless search over NCERT chunks via Minisearch — each result includes topic highlight, Bloom's level, and pre-filled actions (explain, question, learning path)
Keyword search BM25 search across all chapter PDFs
RAG explanations Grade-aware explanations with Markdown structure, LaTeX formulas, Mermaid diagrams, and callout notes
Question generation Structured MCQ / SAQ / LAQ with marking schemes, Bloom's tagging
Question papers Full CBSE-pattern papers: class test → pre-board → board exam
Curriculum graph Prerequisite edges across subjects — powers learning paths
Question bank Persistent SQLite store; questions reused across papers, never re-generated
REST API / OpenAPI All tools exposed as HTTP endpoints for ChatGPT Custom Actions & non-MCP clients
Remote MCP Dedicated Express SSE server for Claude.ai remote connectors

Architecture

  • Runtime: Bun + TypeScript
  • Web Framework: Hono + Zod (for OpenAPI spec generation)
  • Database: Better-SQLite3 (Metadata) + Minisearch (Vectorless Search Index)
  • AI/LLM Client: Universal openai SDK pointing to OpenRouter (Use Claude, Gemini, DeepSeek, etc)
  • Deployment: Cloudflare Workers (Serverless REST API and SSE) + Cloudflare D1 (Database)

MCP Tools (13 tools)

Textbook tools

Tool Description
list_books List available NCERT textbooks, filter by grade/subject
list_topics Chapter titles for a textbook
get_chapter Full extracted text of one chapter
get_chapter_metadata Source URL, download date (fast, no PDF parse)
search_chapters BM25 keyword search across all PDFs

Search tools

Tool Description
search_content Semantic search with grade/subject/Bloom's filters. Returns scored results with pre-filled action params
get_curriculum_map Topics + Bloom's level distribution per chapter

RAG + Generation tools

Tool Description
generate_explanation RAG-grounded explanation — Markdown, LaTeX, Mermaid diagrams
generate_question Single structured question (MCQ/SAQ/LAQ) with marking scheme
generate_question_paper Full CBSE-pattern paper (class test → board exam)
list_exam_types List supported exam types with marks, duration, sections

Curriculum Graph tools

Tool Description
get_prerequisites Direct prerequisite topics for a given topic
get_learning_path Full ordered prerequisite chain, roots first

REST API Endpoints

Method Path Description
GET /openapi.json OpenAPI 3.1 spec (plug into ChatGPT / Swagger)
GET /health Health check
GET /books List textbooks
GET /books/{grade}/{subject}/topics Chapter list
GET /books/{grade}/{subject}/chapters/{n} Full chapter text
GET /books/{grade}/{subject}/chapters/{n}/metadata Chapter metadata
GET /search/content Semantic search — returns highlight, actions, topic, bloom_level per result
GET /search/chapters BM25 keyword search
GET /curriculum/{grade}/{subject} Curriculum map (topics + Bloom's per chapter)
POST /explain Stream explanation (SSE) — Markdown, LaTeX, Mermaid diagram
POST /question Stream question generation (SSE)
GET /exam-types List supported exam types
POST /question-paper Generate full question paper
GET /graph/prerequisites Prerequisite topics
GET /graph/learning-path Full learning path

Quick start

Prerequisites

  • Bun (v1.0+)
  • An OpenRouter API key (or any OpenAI-compatible key)

1. Clone and set up

git clone https://github.com/Jinansh230705/ncert-mcp
cd ncert-mcp
bun install

2. Configure environment

cp .env.example .env
# Edit .env — add OPENAI_API_KEY, optionally OPENAI_BASE_URL and MODEL_NAME

3. Ingest data (run once locally)

Downloads all K-12 NCERT PDFs, chunks them, tags each chunk with Bloom's level/topic/difficulty via OpenRouter, and writes the SQLite + Minisearch index:

bun run ingest

This is a one-time local step. Re-run to pick up newly added textbooks. Already-processed chapters are skipped automatically.

4. Run locally

# REST API + OpenAPI (http://localhost:8000)
bun run dev

# MCP stdio server (for Claude Desktop)
bun run dev:mcp

# MCP SSE server (for Claude Remote Connectors)
bun run dev:remote

Usage & Integrations

1. Hosted MCP (Claude.ai)

You can connect directly to the hosted MCP server without running it locally.

Connection Guide for Claude.ai:

  1. Go to Claude.ai and add a new Remote MCP Server.
  2. URL: https://ncert.getmaterio.app/mcp/sse
  3. Authentication: None (No Auth)

2. ChatGPT Custom GPT

Try it out on ChatGPT using the GPT Store: NCERT GPT

Alternatively, create your own Custom GPT and paste the OpenAPI spec: https://ncert.getmaterio.app/openapi.json

3. Local MCP — Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "ncert-mcp": {
      "command": "bun",
      "args": ["run", "/absolute/path/to/ncert-mcp/src/mcp.ts"]
    }
  }
}

4. Testing with MCP Inspector

npx @modelcontextprotocol/inspector bun run src/mcp.ts

5. Cloudflare Deployment

Deploy the repository to Cloudflare Workers using Wrangler:

bun run deploy

Note: Ensure you have provisioned a Cloudflare D1 database and updated your wrangler.toml accordingly. The database schema is automatically applied using the provided migrations or the ingestion script.


Contributing

Pull requests welcome!

  1. Add textbook mappings to NCERT_TEXTBOOK_CHAPTERS in src/pipeline.ts
  2. Run bun run ingest to download and index new PDFs
  3. Add new MCP tools to src/mcp.ts and src/mcp-express.ts
  4. Add corresponding REST routes to src/index.ts

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured