Skip to main content
Glama

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

  1. Clone the repository:

    git clone https://github.com/yourusername/educhain-mcp.git
    cd educhain-mcp
  2. Install dependencies:

    pip install -e .

    Or install manually:

    pip install educhain>=0.3.10 httpx>=0.28.1 "mcp[cli]>=1.10.1" python-dotenv
  3. Set up environment variables: Create a .env file in the project root:

    OPENAI_API_KEY=your_openai_api_key_here

๐Ÿƒ Usage

Running the Server

python mcp_server.py

The 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

  1. Fork the repository

  2. Create a feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add some amazing feature')

  4. Push to the branch (git push origin feature/amazing-feature)

  5. Open a Pull Request

๐Ÿ™ Acknowledgments

๐Ÿ“ง Support

For issues, questions, or contributions, please:

  1. Check the Issues page

  2. Create a new issue if your problem isn't already listed

  3. 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 tools
generate_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

    A4/5.0

    Scored across 3 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count2/5

    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.

    Completeness2/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude Desktop to interact with the Gauntlet Incept system for generating, tagging, and grading educational content for K-8 students directly through natural language.
      1
      ISC
    • F
      license
      Not graded
      quality
      D
      maintenance
      Integrates 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.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables 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.
      -