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"
    }
ParametersJSON Schema
NameRequiredDescriptionDefault
topicYes
num_cardsNo
difficultyNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by disclosing key behaviors: it generates flashcards with question/answer pairs, uses a content engine, optimizes for spaced repetition, includes error handling with error messages, and raises ValueError for invalid num_cards. It doesn't mention rate limits, authentication needs, or destructive effects, but covers core operational behavior adequately.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with purpose, followed by detailed parameter and return explanations. Every sentence adds value, though the example is lengthy but informative. It could be slightly more concise by integrating some details more tightly, but overall structure is logical and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no annotations, but with output schema), the description is highly complete. It covers purpose, usage context, detailed parameter info, return values (including success/error cases), and provides an example. The output schema exists, so return value explanation in the description is beneficial but not strictly necessary, making this thorough.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate fully. It excels by providing detailed parameter semantics: topic as 'subject area, concept, or learning domain' with examples, num_cards with default, range, and optional status, and difficulty with options, default behavior, and optional status. This adds substantial meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Generate educational flashcards for effective study and memorization' and specifies it uses 'EduChain's content engine' with 'key concepts, definitions, and important facts.' It distinguishes from sibling tools (generate_mcqs, lesson_plan) by focusing on flashcard generation rather than multiple-choice questions or lesson plans. However, it doesn't explicitly contrast with siblings in the description text.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for study and memorization with spaced repetition learning, but doesn't explicitly state when to use this tool versus generate_mcqs or lesson_plan. It provides context about educational content generation but lacks specific guidance on alternative selection or exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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
    }
ParametersJSON Schema
NameRequiredDescriptionDefault
topicYes
num_questionsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it uses 'EduChain's QnA engine', generates 'well-structured' questions with 'four options and one correct answer', includes error handling with error messages, and specifies the ValueError exception for parameter validation. However, it doesn't mention rate limits, authentication requirements, or potential side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, parameters, returns, raises, example) and front-loaded with the core functionality. While comprehensive, some sentences could be more concise (e.g., the returns section is somewhat verbose). Overall, most content earns its place by adding value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity, no annotations, and the presence of an output schema, the description is complete enough. It thoroughly explains parameters, return structure (including success/error cases), exceptions, and provides a concrete example. The output schema means the description doesn't need to detail return values beyond what's provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds substantial meaning beyond the input schema, which has 0% description coverage. It provides detailed explanations for both parameters: 'topic' includes purpose, specificity guidance, and concrete examples; 'num_questions' explains default value, valid range, and constraints. This fully compensates for the schema's lack of descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verb ('generate') and resource ('multiple-choice questions'), and distinguishes it from sibling tools by specifying the type of educational content (MCQs vs flashcards or lesson plans). The opening sentence directly answers what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context through the 'educational topic' specification and parameter examples, but doesn't explicitly state when to use this tool versus the sibling tools (generate_flashcards, lesson_plan). No guidance is provided about alternative scenarios or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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"
    }
ParametersJSON Schema
NameRequiredDescriptionDefault
topicYes
durationNo
grade_levelNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it uses 'EduChain's content engine,' follows 'educational best practices,' and can be 'customized for different grade levels and durations.' It also details the return structure and error handling. However, it does not mention potential limitations like rate limits, authentication needs, or content generation constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and appropriately sized, starting with a clear purpose statement, followed by functional details, parameter explanations, return values, and an example. Most sentences earn their place by adding value, though some parts could be slightly more concise (e.g., the example is detailed but necessary). It is front-loaded with key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (generating educational content), no annotations, and an output schema provided, the description is complete. It explains the tool's purpose, behavior, parameters, return structure (including success and error cases), and includes a practical example. The output schema existence means the description doesn't need to detail return values further, and it adequately covers all necessary contextual aspects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must fully compensate. It provides detailed semantics for all three parameters: 'topic' with examples and specificity guidance, 'duration' with examples and default behavior, and 'grade_level' with examples and default behavior. This adds significant meaning beyond the basic schema, ensuring clarity on usage and expectations.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Generate a comprehensive, structured lesson plan for a given educational topic.' It specifies the verb ('generate'), resource ('lesson plan'), and scope ('comprehensive, structured'), distinguishing it from sibling tools like 'generate_flashcards' and 'generate_mcqs' which focus on different educational resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for creating lesson plans with educational best practices and customization for grade levels/durations, but does not explicitly state when to use this tool versus alternatives like the sibling tools. It mentions customization features but lacks explicit guidance on scenarios where this tool is preferred over others or any exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4/5.0
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
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    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.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TAKSH-PAL/Educhain_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server