Skip to main content
Glama
README.md
# EduChain MCP Server for Claude Desktop

A local MCP (Model Context Protocol) server that integrates the **EduChain** educational content generation library with **Claude Desktop**, allowing users to generate MCQs, lesson plans, and flashcards using LLMs like **Gemini** (via LangChain).

---

## ๐Ÿš€ Features

- **Multiple Choice Questions Generator**
- **Lesson Plan Generator**
- **Flashcard Generator**
- Claude-compatible **MCP server** with `FastMCP`
- Fully local, secure, and extensible integration

---

## ๐Ÿง  Powered By

- [EduChain](https://github.com/satvik314/educhain)
- [LangChain](https://www.langchain.com/)
- [Claude Desktop](https://www.anthropic.com/index/claude-desktop)
- [Gemini API (Google)](https://ai.google.dev/)

---

## ๐Ÿ“ Project Structure

```
โ”œโ”€โ”€ server.py # Main MCP server script
โ”œโ”€โ”€ get_educhain.py # LLM & EduChain config using Gemini
โ”œโ”€โ”€ tools/
โ”‚ โ”œโ”€โ”€ generate_mcqs.py
โ”‚ โ”œโ”€โ”€ generate_lesson_plan.py
โ”‚ โ””โ”€โ”€ generate_flashcards.py
โ”œโ”€โ”€ educhain/ # Cloned EduChain repo (not pushed)
โ”œโ”€โ”€ .env # Contains GEMINI_API_KEY
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ Educhain_McpReport.pdf
โ”œโ”€โ”€ sample_output.txt # Sample response from all tools/resources
โ””โ”€โ”€ README.md

---

## โš™๏ธ Installation

### 1. Clone and Install EduChain Locally

```bash
git clone https://github.com/satvik314/educhain.git
cd educhain
pip install .
```

### 2. Install Required Packages

```bash
pip install -r requirements.txt
```

### 3. Add your Gemini API key

Create a `.env` file:

```env
GEMINI_API_KEY=your-gemini-api-key-here
```

---

## ๐Ÿงช Running the MCP Server

### Option 1: Manual Run (for testing)

```bash
python server.py
```

### Option 2: Claude-Managed (recommended)

Use the following `claude_config.json`:

```json
{
  "mcpServers": {
    "educhain": {
      "command": "python",
      "args": ["server.py"],
      "cwd": "C:/absolute/path/to/project",
      "transport": "stdio",
      "env": {
        "DANGEROUSLY_OMIT_AUTH": "true"
      }
    }
  }
}
```

Save it to:

```bash
C:/Users/YOURNAME/.claude/config.json
```

Then restart Claude Desktop and go to `Developer โ†’ Restart Server`.

#### ๐Ÿ” Alternative: Use Auth Tokens for Collaboration

If you're working in a collaborative setup or want stricter control, you can remove the `DANGEROUSLY_OMIT_AUTH` setting and instead use the `auth_token` from the MCP Inspector like this:

```json
{
  "mcp_servers": [
    {
      "label": "EduChain Gemini Server",
      "url": "http://127.0.0.1:6277",
      "auth_token": "your-session-token"
    }
  ]
}
```

This is useful when running the server via:

```bash
mcp dev server.py
```

It connects through the local proxy with full inspection/debug support.

---

## ๐Ÿงฐ Available Tools & Resources

| Name                      | Type     | Description                                   |
| ------------------------- | -------- | --------------------------------------------- |
| `generate_mcq_tool`       | Tool     | Creates multiple-choice questions for a topic |
| `generate_flashcard_tool` | Tool     | Generates flashcards for a topic              |
| `lesson_plan_resource`    | Resource | Provides a structured lesson plan             |

---

## ๐Ÿ›  Troubleshooting

- If ports like `6277` or `6274` are in use, kill conflicting processes
- MCP Inspector (via `mcp dev server.py`) may block Claude โ€” only run one at a time
- Ensure `educhain/` is installed but **not committed** (add it to `.gitignore`)

---

## ๐Ÿ’ก Contributions

This integration was created as part of an internship assignment to showcase:

- LLM tool integration
- MCP protocol understanding
- Custom tool chaining with LangChain
- Gemini API usage via LangChain adapters

---

## ๐Ÿ“„ License

This repository is for educational and internship use. EduChain is used under its respective open license.

---

## ๐Ÿ™Œ Acknowledgements

- [@satvik314](https://github.com/satvik314) for EduChain
- Anthropic for Claude Desktop
- Google for Gemini

---

## ๐Ÿ“ž Contact

Feel free to reach out via [LinkedIn](https://linkedin.com) or email for collaboration or queries.