Ashok54942/MCP-server
If you are the rightful owner of MCP-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
EduChain is an AI-powered educational content server that adheres to the Multi-Agent Collaboration Protocol (MCP), enabling integration with agentic hosts like Claude Desktop.
EduChain: AI-Powered Educational Content Server (MCP Compliant)
This project demonstrates an AI-powered server built with Flask and Google's Gemini AI, designed to generate and retrieve educational content. It adheres to the principles of the Multi-Agent Collaboration Protocol (MCP), allowing integration with agentic hosts like Claude Desktop.
Project Overview
EduChain provides the following core functionalities:
- AI-Powered Lesson Plan Generation: Dynamically creates comprehensive lesson plans for any given topic.
- AI-Powered Multiple-Choice Question (MCQ) Generation: Generates MCQs on demand for specified topics.
- Predefined MCQ Retrieval: Serves a curated set of multiple-choice questions from a static JSON file, with optional subject-based filtering.
The server is built using Python with Flask, LangChain for AI orchestration, and Pydantic for data validation.
Task Breakdown & Completion
This repository covers the completion of the following tasks:
Task 1: Set Up the EduChain Environment
- Description: Installation of necessary libraries and initial configuration to generate educational content using a sample topic.
- Completion: The
generate_content.py
script demonstrates the initial setup and content generation using the Gemini API.
Task 2: Build the MCP Server with EduChain
- Description: Creation of a Flask-based MCP server exposing AI-powered tools (MCQ generation) and resources (lesson plan generation, predefined MCQ retrieval).
- Completion: The
educhain_mcp_server.py
file implements the Flask server with endpoints for/generate_lesson_plan
,/generate_mcqs
, and/get_predefined_mcqs
. Thepredefined_mcqs.json
file holds the static MCQ data.
Task 3: Test the MCP Server with Claude Desktop
- Description: Configuration of Claude Desktop to connect to the MCP server and verification of content retrieval via commands.
- Completion: The
claude_desktop_config.json
(hypothetical, as actual configuration depends on Claude Desktop's internal structure) outlines how the server's endpoints would be registered as external tools/resources. Themcp_server_test_results.txt
file contains sample commands and expected responses, simulating the interaction with an MCP host.
Repository Contents
educhain_mcp_server.py
: The main Flask application that serves as the MCP server.generate_content.py
: Initial script to demonstrate basic AI content generation.generate_python_mcqs.py
: A client script to programmatically request MCQs from theeduchain_mcp_server.py
.predefined_mcqs.json
: A JSON file containing a sample set of 20 pre-written MCQs across various subjects..env.example
: An example file for environment variables (rename to.env
and fill in your API key).claude_desktop_config.json
: A hypothetical configuration file demonstrating how Claude Desktop would be configured to use this server. Note: The actual location and exact structure might vary based on your Claude Desktop installation.mcp_server_test_results.txt
: A document detailing the test commands and their corresponding server responses for verification.
Setup and Running
Prerequisites
- Python 3.8+
pip
(Python package installer)- A Google Gemini API Key (get one from Google AI Studio)
- Claude Desktop (for Task 3 testing)
Installation
- Clone the repository:
git clone <YOUR_REPOSITORY_URL> cd educhain
- Create a Python Virtual Environment (recommended):
python -m venv venv
- Activate the Virtual Environment:
- Windows:
.\venv\Scripts\activate
- macOS/Linux:
source venv/bin/activate
- Windows:
- Install Dependencies:
pip install Flask python-dotenv langchain-google-genai langchain pydantic requests
- Configure API Key:
- Rename
.env.example
to.env
. - Open
.env
and replaceYOUR_GEMINI_API_KEY
with your actual Google Gemini API Key:GEMINI_API_KEY="YOUR_GEMINI_API_KEY"
- Rename
Running the EduChain MCP Server
- Ensure your virtual environment is activated.
- Run the server:
Leave this terminal window open and running. The server will be accessible at
python educhain_mcp_server.py
http://127.0.0.1:5000/
.
Testing the Server (without Claude Desktop)
Open a NEW terminal window, activate your virtual environment, and use curl
or the provided Python scripts:
- View Home Page: Open
http://127.0.0.1:5000/
in your web browser. - Generate Lesson Plan:
curl -X POST -H "Content-Type: application/json" -d "{\"topic\": \"Introduction to Quantum Physics\"}" [http://127.0.0.1:5000/generate_lesson_plan](http://127.0.0.1:5000/generate_lesson_plan)
- Generate MCQs:
curl -X POST -H "Content-Type: application/json" -d "{\"topic\": \"Data Structures in Python\", \"num_questions\": 5}" [http://127.0.0.1:5000/generate_mcqs](http://127.0.0.1:5000/generate_mcqs)
- Get Predefined MCQs (all):
curl [http://127.0.0.1:5000/get_predefined_mcqs](http://127.0.0.1:5000/get_predefined_mcqs)
- Get Predefined MCQs (filtered by subject):
curl [http://127.0.0.1:5000/get_predefined_mcqs?subject=Biology](http://127.0.0.1:5000/get_predefined_mcqs?subject=Biology)
- Run
generate_python_mcqs.py
:This will generatepython generate_python_mcqs.py
python_programming_basics_mcqs.json
.
Integrating with Claude Desktop
- Locate Claude Desktop Config:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Create the file if it doesn't exist.
- Windows:
- Add Server Configuration: Copy the content from the
claude_desktop_config.json
file in this repository and paste it into your Claude Desktop's configuration file. - Restart Claude Desktop: Ensure Claude Desktop is completely quit and then relaunched to load the new configuration.
- Issue Commands in Claude Desktop:
Generate 5 multiple-choice questions on Python loops.
Provide a lesson plan for teaching algebra.
Get predefined MCQs for Geography.
- Observe Claude's responses and check your server's terminal for logs.