Skip to main content
Glama
Nihal108-bi

offline-mcp-educational-server

by Nihal108-bi
README.md


### โœ… `README.md`

```markdown
# 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                          # Entry point to run the Flask server
โ”œโ”€โ”€ requirements.txt                # Dependencies (Flask)
โ”œโ”€โ”€ claude\_desktop\_config.json      # Claude Desktop configuration (optional)
โ”œโ”€โ”€ Sample\_Responses.txt            # Sample API calls and responses
โ”œโ”€โ”€ README.md                       # This file
โ””โ”€โ”€ app/
โ”œโ”€โ”€ **init**.py                 # Initializes the Flask app
โ”œโ”€โ”€ routes.py                   # Flask routes and UI form
โ””โ”€โ”€ edu\_utils.py                # Core educational logic (MCQs, plans, flashcards)

````

---

## ๐Ÿš€ 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
````

### Step 2: Run the Flask server

```bash
python run.py
```

By default, the server runs on:

```
http://localhost:5001
```

---

## ๐ŸŒ Test the Server (Without Claude)

Visit in browser:

```
http://localhost:5001
```

Use the dropdowns and forms to test:

* Generate MCQs
* Get Lesson Plan
* Create Flashcards

Or use Postman / curl.

---

## ๐Ÿงช Sample Request

**POST** `/generate-mcqs`

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

**Sample Response**

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

---

## ๐Ÿ›  Claude Desktop Integration (Optional)

Use the `claude_desktop_config.json` file provided to connect this server to Claude Desktop. Restart Claude Desktop after configuring it.

---

## ๐Ÿ“ฅ Submission Checklist

* [x] `mcp_server.py` โ†’ now modular: `run.py + routes.py + utils.py`
* [x] `claude_desktop_config.json`
* [x] `Sample_Responses.txt`
* [x] `README.md`
* [x] Uses NO LLMs (fully offline)
* [x] Tested via browser, Postman, and curl

---

## ๐Ÿ“ง Author

**Nihal Jaiswal**
B.Tech (2026)
GitHub: \[[github.com/yourusername](https://github.com/Nihal108-bi)]