EduChain MCP Server
Uses OpenAI's API to power EduChain's educational content generation capabilities for creating multiple-choice questions, lesson plans, and flashcards.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@EduChain MCP Server generate 5 multiple choice questions about photosynthesis"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
EduChain MCP Server
A Model Context Protocol (MCP) server that integrates EduChain's educational content generation capabilities with Claude Desktop and other MCP-compatible clients.
๐ฏ Overview
The EduChain MCP Server provides three powerful educational tools accessible through Claude Desktop:
๐ Multiple Choice Questions (MCQs): Generate well-structured questions with plausible distractors
๐ Lesson Plans: Create comprehensive, structured lesson plans with objectives, activities, and assessments
๐๏ธ Flashcards: Generate educational flashcards optimized for spaced repetition learning
Related MCP server: EduChain MCP Server
๐ Features
Claude Desktop Integration: Seamless integration with Claude Desktop via MCP protocol
Type-Safe Implementation: Full type hints and comprehensive docstrings
Error Handling: Robust error handling and graceful degradation
Logging: Comprehensive logging for debugging and monitoring
Input Validation: Thorough validation of all input parameters
Environment Configuration: Support for environment variables
MCP Inspector Compatible: Works with MCP Inspector for debugging
๐ Requirements
Python 3.10 or higher
OpenAI API key (for EduChain functionality)
Claude Desktop (for MCP integration)
๐ง Installation
Clone the repository:
git clone https://github.com/yourusername/educhain-mcp.git cd educhain-mcpInstall dependencies:
pip install -e .Or install manually:
pip install educhain>=0.3.10 httpx>=0.28.1 "mcp[cli]>=1.10.1" python-dotenvSet up environment variables: Create a
.envfile in the project root:OPENAI_API_KEY=your_openai_api_key_here
๐ Usage
Running the Server
python mcp_server.pyThe server will start and listen for MCP connections via stdio transport, making it compatible with Claude Desktop.
Claude Desktop Configuration
Add the following to your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"Educhain_mcp": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/Educhain_mcp",
"run",
"mcp_server.py"
]
}
}
}MCP Inspector
For debugging and development, you can use the MCP Inspector:
npx @modelcontextprotocol/inspector python mcp_server.py๐ ๏ธ Available Tools
1. Generate MCQs
Function: generate_mcqs(topic: str, num_questions: int = 5)
Description: Generate multiple-choice questions for a given educational topic.
Parameters:
topic(str): The educational topic (e.g., "Photosynthesis", "World War II")num_questions(int, optional): Number of questions to generate (1-20, default: 5)
Example:
result = generate_mcqs("Photosynthesis", 3)2. Lesson Plan
Function: lesson_plan(topic: str, duration: Optional[str] = None, grade_level: Optional[str] = None)
Description: Generate a comprehensive, structured lesson plan.
Parameters:
topic(str): The lesson topic (e.g., "Introduction to Fractions")duration(str, optional): Lesson duration (e.g., "45 minutes", "1 hour")grade_level(str, optional): Target grade level (e.g., "Grade 5", "High School")
Example:
result = lesson_plan("Photosynthesis", "50 minutes", "Grade 7")3. Generate Flashcards
Function: generate_flashcards(topic: str, num_cards: int = 10, difficulty: Optional[str] = None)
Description: Generate educational flashcards for study and memorization.
Parameters:
topic(str): The subject area (e.g., "Spanish Vocabulary - Animals")num_cards(int, optional): Number of flashcards to generate (1-50, default: 10)difficulty(str, optional): Difficulty level ("beginner", "intermediate", "advanced")
Example:
result = generate_flashcards("Spanish Vocabulary - Animals", 5, "beginner")๐ Project Structure
educhain-mcp/
โโโ mcp_server.py # Main MCP server implementation
โโโ main.py # Simple entry point (not used for MCP)
โโโ pyproject.toml # Project configuration and dependencies
โโโ README.md # This documentation
โโโ .env # Environment variables (create this)๐ Logging
The server includes comprehensive logging to help with debugging and monitoring:
INFO Level: Server startup, tool execution, and success messages
WARNING Level: Missing environment variables and non-critical issues
ERROR Level: Tool execution failures and server errors
Logs are formatted with timestamps and include the module name for easy identification.
๐ก๏ธ Error Handling
The server implements robust error handling:
Input Validation: All parameters are validated before processing
Graceful Degradation: Errors are returned as structured responses
Logging: All errors are logged with detailed messages
Type Safety: Full type hints prevent common runtime errors
๐ค Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
๐ Acknowledgments
EduChain for the educational content generation capabilities
Model Context Protocol for the integration framework
Claude Desktop for the AI assistant platform
๐ง Support
For issues, questions, or contributions, please:
Check the Issues page
Create a new issue if your problem isn't already listed
Provide detailed information about your environment and the issue
๐ Changelog
v0.1.0
Initial release
Basic MCP server implementation
Three educational tools: MCQs, lesson plans, flashcards
Claude Desktop integration
Comprehensive documentation and error handling
Available Tools
3 toolsgenerate_flashcardsA
Generate educational flashcards for effective study and memorization.
This function creates a set of flashcards using EduChain's content engine,
focusing on key concepts, definitions, and important facts related to the topic.
Each flashcard contains a question/prompt on one side and a comprehensive
answer on the other side, optimized for spaced repetition learning.
Args:
topic (str): The subject area, concept, or learning domain for which to
create flashcards. Should be specific enough to generate focused content.
Examples: "Spanish Vocabulary - Food", "Chemistry - Periodic Table",
"History - World War I Events"
num_cards (int, optional): The number of flashcards to generate.
Defaults to 10. Must be between 1 and 50.
difficulty (Optional[str]): The difficulty level for the flashcards.
Options: "beginner", "intermediate", "advanced". If not provided,
a mixed difficulty approach will be used.
Returns:
Dict[str, Any]: A dictionary containing the generated flashcards and metadata.
On success:
- flashcards: List of flashcard objects with front and back content
- topic: The input topic
- count: Number of flashcards generated
- difficulty: Difficulty level (if specified)
On error:
- error: Detailed error message
Raises:
ValueError: If num_cards is not in the valid range (1-50)
Example:
>>> generate_flashcards("Spanish Vocabulary - Animals", 5, "beginner")
{
"flashcards": [
{
"front": "What is the Spanish word for 'dog'?",
"back": "perro (masculine noun)"
},
{
"front": "Translate: 'The cat is sleeping'",
"back": "El gato estรก durmiendo"
},
...
],
"topic": "Spanish Vocabulary - Animals",
"count": 5,
"difficulty": "beginner"
}
Inputs: topic (required), num_cards, difficulty. Returns: result
generate_mcqsA
Generate multiple-choice questions (MCQs) for a given educational topic.
This function leverages EduChain's QnA engine to create well-structured
multiple-choice questions with correct answers and plausible distractors.
Each question includes four options with one correct answer.
Args:
topic (str): The educational topic or subject area for which to generate
questions. Should be specific enough to generate focused questions.
Examples: "Photosynthesis", "World War II", "Python Programming"
num_questions (int, optional): The number of questions to generate.
Defaults to 5. Must be between 1 and 20.
Returns:
Dict[str, Any]: A dictionary containing the generated questions and metadata.
On success, includes:
- questions: List of question objects with options and correct answers
- topic: The input topic
- count: Number of questions generated
On error, includes:
- error: Error message describing what went wrong
Raises:
ValueError: If num_questions is not in the valid range (1-20)
Example:
>>> generate_mcqs("Photosynthesis", 3)
{
"questions": [
{
"question": "What is the primary purpose of photosynthesis?",
"options": ["A) ...", "B) ...", "C) ...", "D) ..."],
"correct_answer": "B"
},
...
],
"topic": "Photosynthesis",
"count": 3
}
Inputs: topic (required), num_questions. Returns: result
lesson_planA
Generate a comprehensive, structured lesson plan for a given educational topic.
This function creates a detailed lesson plan using EduChain's content engine,
including learning objectives, materials needed, activities, and assessment methods.
The lesson plan follows educational best practices and can be customized for
different grade levels and durations.
Args:
topic (str): The subject, concept, or learning objective for the lesson.
Should be specific and focused. Examples: "Introduction to Fractions",
"The American Revolution", "Basic HTML Tags"
duration (Optional[str]): The intended duration of the lesson.
Examples: "45 minutes", "1 hour", "2 class periods". If not provided,
a standard duration will be assumed.
grade_level (Optional[str]): The target grade level or educational level.
Examples: "Grade 5", "High School", "College Level", "Adult Education".
If not provided, a general approach will be used.
Returns:
Dict[str, Any]: A comprehensive lesson plan dictionary containing:
On success:
- title: Lesson title
- objectives: Learning objectives and goals
- materials: Required materials and resources
- activities: Structured learning activities
- assessment: Methods for evaluating student learning
- duration: Lesson duration
- grade_level: Target grade level
On error:
- error: Detailed error message
Example:
>>> lesson_plan("Photosynthesis", "50 minutes", "Grade 7")
{
"title": "Understanding Photosynthesis",
"objectives": ["Students will understand...", "Students will be able to..."],
"materials": ["Textbook", "Microscope", "Plant samples"],
"activities": [
{
"name": "Introduction",
"duration": "10 minutes",
"description": "..."
},
...
],
"assessment": "Quiz on key concepts",
"duration": "50 minutes",
"grade_level": "Grade 7"
}
Inputs: topic (required), duration, grade_level. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: generate_flashcards creates study cards for memorization, generate_mcqs produces multiple-choice questions for assessment, and lesson_plan designs structured teaching guides. There is no overlap in functionality, and the descriptions clearly differentiate their educational applications.
All three tools follow a consistent verb_noun naming pattern (generate_flashcards, generate_mcqs, lesson_plan). The use of 'generate' for two tools and 'lesson' for the third is appropriate given their distinct outputs, maintaining readability and predictability throughout.
With only 3 tools, the server feels under-scoped for an educational content generation domain. While the tools cover flashcards, MCQs, and lesson plans, there are likely missing operations like quiz generation, study guides, or content summarization that would better serve the apparent purpose.
The tool set has significant gaps for an educational server. It lacks tools for updating or managing generated content, creating different assessment types (e.g., essays, true/false), or integrating with learning management systems. This incomplete coverage may lead to agent failures when broader educational workflows are needed.
Maintenance
Related MCP Connectors
Build study flashcards and exam-prep decks from your AI chat, all stored locally.
Create and review spaced-repetition flashcards in your free Klappa decks from any AI assistant.
AI-powered corporate learning platform โ manage courses, users, and insights via Claude.
Create, edit and publish Educaplay educational games and quizzes from any AI assistant.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude Desktop to interact with the Gauntlet Incept system for generating, tagging, and grading educational content for K-8 students directly through natural language.1ISC
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered generation of educational content including multiple-choice questions, lesson plans, and flashcards on any topic through integration with the EduChain library and DeepSeek model via OpenRouter.-
- FlicenseNot gradedqualityDmaintenanceIntegrates the EduChain library with Claude Desktop to generate educational content such as multiple-choice questions, lesson plans, and flashcards. It utilizes Gemini LLMs through LangChain to provide local and secure content generation tools.-
- FlicenseNot gradedqualityDmaintenanceEnables the generation of educational content such as multiple choice questions, lesson plans, and flashcards by connecting local Ollama models to Claude. It leverages the Educhain library to provide structured AI-powered learning tools through the Model Context Protocol.-