Token导航 LogoToken导航TokenDH.com
Educhain MCP Server Assignment logo
AI代理stdio官方级别未说明来源级核验

Educhain MCP Server Assignment

MCP Server

一个基于FastAPI的MCP服务器,用于生成多项选择题、课程计划和闪卡等教育内容。

工具数

2

提示词数

0

GitHub Stars

1

资源数

0
教育技术内容生成PythonClaudeClaude DesktopClaudeVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Sairohit022001

提供方

Sairohit022001

最后核验

2026/5/17 20:21

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m venv venv

详细介绍

EduChain MCP服务器

该存储库包含MCP(多模式命令协议)服务器的实现,该服务器与模拟的 educhain 图书馆生成教育内容。该项目解决了“使用AI快速构建”的一项任务,并演示了如何将AI功能作为工具和资源公开给像Claude Desktop这样的MCP主机。

项目概述

服务器提供端点用于生成:

  1. 多项选择题(MCQ):针对指定主题创建MCQ的工具。
  2. 课程计划:检索给定主题的详细课程计划的资源。
  3. 抽认卡(奖金):一种生成包含主题术语和定义的抽认卡的工具。

技术栈

  • python:核心编程语言。
  • 快速 API:用于构建MCP服务器API的Web框架。
  • educhain_utils.py:一个模拟模块,代表 educhain 图书馆的内容生成能力。在真实场景中,这将被实际的 educhain 图书馆。
  • LangChain:开发由语言模型驱动的应用程序的框架(在 educhain_utils.py 用于LLM提示(如果已配置)。
  • 乌维科恩:ASGI服务器运行FastAPI应用程序。
  • requests:用于通过与服务器进行编程交互来生成示例响应。

项目结构

是的,我确切地知道我们做了什么。我们用FastAPI和模拟的EduChain构建了一个MCP服务器,配置了Claude Desktop,并彻底排除了安装故障。

这是一个代码单元格中的完整README.md,已准备好供您提交。

降价

EduChain MCP服务器

该存储库包含MCP(多模式命令协议)服务器的实现,该服务器与模拟的 educhain 图书馆生成教育内容。该项目解决了“使用AI快速构建”的一项任务,并演示了如何将AI功能作为工具和资源公开给像Claude Desktop这样的MCP主机。

项目概述

服务器提供端点用于生成:

  1. 多项选择题(MCQ):针对指定主题创建MCQ的工具。
  2. 课程计划:检索给定主题的详细课程计划的资源。
  3. 抽认卡(奖金):一种生成包含主题术语和定义的抽认卡的工具。

技术栈

  • python:核心编程语言。
  • 快速 API:用于构建MCP服务器API的Web框架。
  • educhain_utils.py:一个模拟模块,代表 educhain 图书馆的内容生成能力。在真实场景中,这将被实际的 educhain 图书馆。
  • LangChain:开发由语言模型驱动的应用程序的框架(在 educhain_utils.py 用于LLM提示(如果已配置)。
  • 乌维科恩:ASGI服务器运行FastAPI应用程序。
  • requests:用于通过与服务器进行编程交互来生成示例响应。

项目结构

教育mcp服务器/ ├── educhain_mcp_server/#主要应用程序源代码 │ ├── main.py#FastAPI服务器应用程序 │ ├── eduhain_utils.py#用于生成educhain内容的辅助函数 │ ├── claude_desktop_config.json#克劳德桌面配置的项目副本 │ └── requirements.txt#Python依赖项 ├── venv/#Python虚拟环境(Git忽略) ├── .gitignore#指定Git中要忽略的文件/文件夹 ├── generate_sample_responses.py#生成sample_Respons.txt的脚本 ├── Sample_Respons.txt#生成的输出:示例命令和服务器响应 └── README.md#此文档文件

安装说明

1.克隆存储库

git clone [https://github.com/Sairohit022001/educhain-mcp-server-assignment]
cd educhain_mcp_server

# Create a virtual environment
python -m venv venv

# Activate the virtual environment
# On Windows PowerShell:
.\venv\Scripts\Activate.ps1
# On macOS/Linux:
# source venv/bin/activate

# Install dependencies from requirements.txt
pip install -r educhain_mcp_server/requirements.txt

# Ensure your virtual environment is active: (venv) should be in your prompt
# Navigate into the application subfolder where main.py is located
cd educhain_mcp_server

# Start the Uvicorn server
uvicorn main:app --reload --port 8000

# Open a NEW terminal window in VS Code
# Activate the virtual environment in this new terminal
.\venv\Scripts\Activate.ps1

# Navigate back to the project's ROOT folder
cd .. 

# Run the script to generate sample responses
python generate_sample_responses.py

You are correct!

Since the task of configuring Claude Desktop's config.json is a step you, the user, perform on your local machine to get the integration working, it's not something the assessors need to do themselves when they clone your GitHub repository.

The README.md is meant to guide them on how to set up and run your submitted code.

So, we can remove Section 5: Configure Claude Desktop from the README.md as a step they need to perform to run your code.

However, the explanation of the Claude Desktop integration and observations is still crucial, as it explains your setup and your findings during the assignment. This information is currently part of the "Note on Claude Desktop Integration Observation" and also implicitly explained by the presence of claude_desktop_config.json in your repository.

Let's remove that section from the README.md's instructions.

Here is the revised README.md content:

Markdown

# EduChain MCP Server

This repository contains the implementation of an MCP (Multi-Modal Command Protocol) server that integrates with a simulated `educhain` library to generate educational content. This project addresses an assignment from "Build Fast with AI" and demonstrates how to expose AI capabilities as tools and resources for an MCP host like Claude Desktop.

## Project Overview

The server provides endpoints for generating:
1.  **Multiple-Choice Questions (MCQs)**: A tool to create MCQs on a specified topic.
2.  **Lesson Plans**: A Resource to retrieve a detailed lesson plan for a given subject.
3.  **Flashcards (Bonus)**: A tool to generate flashcards with terms and definitions for a topic.

## Technical Stack

* **Python**: Core programming language.
* **FastAPI**: Web framework for building the MCP server API.
* **`educhain_utils.py`**: A simulated module representing the `educhain` library's content generation capabilities. In a real scenario, this would be replaced by the actual `educhain` functions.
* **LangChain**: A framework for developing applications powered by language models (used within `educhain_utils.py` for LLM prompting, if configured).
* **Uvicorn**: ASGI server to run the FastAPI application.
* **`requests`**: For generating sample responses by programmatically interacting with the server.

## Project Structure

educhain_mcp_server/
├── educhain_mcp_server/         # Main application source code
│   ├── main.py                  # FastAPI server application
│   ├── educhain_utils.py        # Helper functions for EduChain content generation
│   ├── claude_desktop_config.json # Project's copy of the Claude Desktop config
│   └── requirements.txt         # Python dependencies
├── venv/                        # Python virtual environment (ignored by Git)
├── .gitignore                   # Specifies files/folders to ignore in Git
├── generate_sample_responses.py # Script to generate Sample_Responses.txt
├── Sample_Responses.txt         # Generated output: sample commands and server responses
└── README.md                    # This documentation file

## Setup Instructions

### 1. Clone the Repository

git clone [YOUR_GITHUB_REPO_URL_HERE] cd educhain_mcp_server (Important: Remember to replace [YOUR_GITHUB_REPO_URL_HERE] with the actual URL of your public GitHub repository after you create it and push your code.)

  1. Install Dependencies

It's highly recommended to use a virtual environment for dependency management.

Bash

Create a virtual environment

python -m venv venv

Activate the virtual environment

On Windows PowerShell:

.\venv\Scripts\Activate.ps1

On macOS/Linux:

source venv/bin/activate

Install dependencies from requirements.txt

pip install -r educhain_mcp_server/requirements.txt Note on LLM Integration in educhain_utils.py: The educhain_utils.py file includes commented-out sections for integrating with Large Language Models (LLMs) like Ollama (for local models) or OpenAI.

By default, without uncommenting these lines, the EduChainContentGenerator will use mock data generation for all educational content (MCQs, lesson plans, flashcards). This is sufficient for the assignment's demonstration. If you wish to use a real LLM, uncomment the relevant imports and initialization lines in educhain_utils.py and ensure the corresponding libraries are installed via pip (e.g., pip install ollama or pip install openai langchain-openai).

  1. Run the EduChain MCP Server

You will need to run the FastAPI application using Uvicorn. Keep this terminal window open as it will host your server.

Bash

Ensure your virtual environment is active: (venv) should be in your prompt

Navigate into the application subfolder where main.py is located

cd educhain_mcp_server

Start the Uvicorn server

uvicorn main:app --reload --port 8000 The server will be accessible at http://127.0.0.1:8000. You should see INFO: Application startup complete. in your terminal.

  1. Generate Sample Commands and Responses

While the MCP server is running (from Step 3), you can generate the Sample_Responses.txt file by running the provided script. This script programmatically makes requests to your server and captures the outputs.

Bash

Open a NEW terminal window in VS Code

Activate the virtual environment in this new terminal

.\venv\Scripts\Activate.ps1

Navigate back to the project's ROOT folder

cd ..

Run the script to generate sample responses

python generate_sample_responses.py This script will make HTTP requests to your running server (from Step 3) and save the commands and their corresponding JSON responses into Sample_Responses.txt in your project's root directory. You will see logs of these requests appear in your server's terminal (from Step 3).

Usage and Observation with Claude Desktop This project demonstrates an MCP server designed for integration with clients like Claude Desktop. While direct setup of Claude Desktop is specific to the user's environment, this section describes how the integration was tested and observed during development.

Configuration for Claude Desktop Integration: The file educhain_mcp_server/claude_desktop_config.json provides the necessary configuration snippet for connecting a Claude Desktop instance to this local MCP server. During development, this snippet was merged into the local Claude Desktop's config.json file (typically located at C:\Users\YOUR_USERNAME\AppData\Roaming\Claude\config.json).

Observed Behavior during Testing: Once configured and with the server running, manual queries from the Claude Desktop chat interface demonstrated successful integration. Specific prompts aligned with the server's tools and resources (e.g., "Generate 5 multiple-choice questions on Python loops.") resulted in:

Corresponding specific tool invocation logs (e.g., POST /tools/generate_mcqs) appearing in the local server's terminal, confirming Claude Desktop routed the request to the local server. Claude Desktop displaying the generated educational content (MCQs, lesson plans, flashcards) directly in its chat interface.````

目录标签

目录标签

教育技术内容生成PythonClaude本地部署AI工具MCP协议学习资源

支持客户端

Claude DesktopClaudeVS Code

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

2

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP