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.
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
openaiSDK 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:
- Go to Claude.ai and add a new Remote MCP Server.
- URL:
https://ncert.getmaterio.app/mcp/sse - 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.tomlaccordingly. The database schema is automatically applied using the provided migrations or the ingestion script.
Contributing
Pull requests welcome!
- Add textbook mappings to
NCERT_TEXTBOOK_CHAPTERSinsrc/pipeline.ts - Run
bun run ingestto download and index new PDFs - Add new MCP tools to
src/mcp.tsandsrc/mcp-express.ts - Add corresponding REST routes to
src/index.ts
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。