离线教育内容生成服务器

一个离线MCP服务器,模拟教育内容生成工具,无需依赖外部LLM,支持Claude Desktop集成或独立测试。

  • by Nihal108-bi
  • Python
  • 本地部署
  • 4 星标
  • 更新于
在 GitHub 查看 Nihal108-bi/offline-mcp-educational-server

使用说明

✅ README.md

# Offline MCP Server — EduChain Assignment Submission

This project implements an **offline MCP (Meta-Channel Protocol) server** that simulates educational content generation tools without using any external LLMs (e.g., OpenAI or Gemini). It is fully compatible with Claude Desktop or can be tested independently using browser, Postman, or cURL.

---

## 📂 Project Structure

. ├── run.py#运行Flask服务器的入口点 ├── requirements.txt#依赖关系(Flask) ├── claude_desktop_config.json#克劳德桌面配置(可选) ├── Sample_Responses.txt#示例API调用和响应 ├── README.md#此文件 └── app/ ├── 初始化.py#初始化Flask应用程序 ├── routes.py#Flask路由和UI表单 └── edu_utils.py#核心教育逻辑(MCQ、计划、抽认卡)


---

## 🚀 Features

| Tool             | Endpoint                | Description                                     |
|------------------|--------------------------|-------------------------------------------------|
| MCQ Generator    | `/generate-mcqs`         | Generates MCQs based on topic and count         |
| Lesson Plan Tool | `/get-lesson-plan`       | Returns a structured lesson plan for a subject  |
| Flashcards Tool  | `/generate-flashcards`   | Creates flashcards from topic keywords          |
| Test UI          | `/`                      | Browser form to test all routes easily          |

---

## 🧠 LLM-Free Design

Instead of calling real LLMs like OpenAI or Gemini, this project:
- Uses **handwritten logic**
- Returns **realistic educational content**
- Fully mimics JSON structure expected by Claude Desktop

---

## 🔧 Installation & Run

### Step 1: Install requirements

```bash
pip install -r requirements.txt

步骤2:运行Flask服务器

python run.py

默认情况下,服务器运行在:

http://localhost:5001

🌐 测试服务器(无需Claude)

在浏览器中访问:

http://localhost:5001

使用下拉菜单和表格进行测试:

  • 生成MCQ
  • 获取课程计划
  • 创建闪卡

或者使用Postman/cill。


🧪 样品申请

发布 /generate-mcqs

{
  "topic": "Python Basics",
  "count": 2
}

样品响应

{
  "mcqs": [
    {
      "question": "Which keyword is used to define a function in Python?",
      "options": ["define", "def", "func", "lambda"],
      "answer": "def"
    },
    ...
  ]
}

🛠 Claude桌面集成(可选)

使用 claude_desktop_config.json 提供的文件用于将此服务器连接到Claude Desktop。配置后重新启动Claude Desktop。


📥 提交清单

  • [x] mcp_server.py → 现在模块化: run.py + routes.py + utils.py
  • [x] claude_desktop_config.json
  • [x] Sample_Responses.txt
  • [x] README.md
  • [x] 不使用LLM(完全离线)
  • [x] 通过浏览器、Postman和curl进行测试

📧 作者

尼哈尔·贾斯瓦尔 B.技术(2026年) GitHub:[github/你的用户名]