# 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.