使用说明
EduChain MCP服务器
MCP(模型上下文协议)服务器,将EduChain库与Google Gemini API集成,以提供AI驱动的教育内容生成。
特性
-
🎓 教育内容生成
- 任何学术主题的多项选择题(MCQ)
- 包含目标和活动的综合课程计划
- 学习抽认卡(额外功能)
-
🤖 AI驱动
- 由Google Gemini的高级语言模型提供支持
- 可定制的难度级别和学习目标
- 上下文感知内容生成
-
🔌 MCP集成
- 与Claude Desktop无缝集成
- 教育工具的标准化API端点
- 附加功能的可扩展架构
先决条件
在开始之前,请确保您已满足以下要求:
- Python 3.8或更高版本
- Google Gemini API密钥
- 已安装Claude Desktop(用于测试)
- Node.js(用于Claude Desktop中的MCP支持)
安装
要安装EduChain MCP服务器,请执行以下步骤:
-
克隆存储库:
git clone https://github.com/yourusername/educhain-mcp-server.git cd educhain-mcp-server -
创建并激活虚拟环境:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
安装依赖项:
pip install -r requirements.txt -
创建一个
.env文件:cp .env.example .env然后编辑
.env并添加您的Google Gemini API密钥。
用法
启动服务器
python educhain_mcp_server.py
使用Claude Desktop进行测试
- 通过编辑配置Claude Desktop
claude_desktop_config.json - 更新
cwd项目目录的路径 - 在环境变量中添加您的Google API密钥
- 重新启动克劳德桌面
示例命令
- 生成MCQ:“创建5个关于Python循环的选择题”
- 获取教案:“为高中代数提供45分钟的教案”
- 创建抽认卡:“制作10张关于数据结构的定义抽认卡”
项目结构
educhain-mcp-server/
├── educhain_mcp_server.py # Main server implementation
├── test_educhain.py # Setup verification
├── requirements.txt # Python dependencies
├── .env # Environment config (ignored)
├── .env.example # Environment template
├── claude_desktop_config.json # Claude config
├── README.md # This file
└── .gitignore # Git ignore rules
API文档
服务器提供以下MCP端点:
工具
generate_mcq(topic, num_questions, difficulty_level, custom_instructions)generate_lesson_plan(topic, duration, grade_level, learning_objectives)generate_flashcards(topic, num_cards, difficulty_level, card_type)
资源
educhain://topic/{topic}-获取主题概述educhain://questions/{topic}-获取示例问题
故障排除
如果您遇到问题:
-
服务器未启动:
- 验证Python是否在您的PATH中
- 检查是否安装了所有依赖项(
pip list) - 确保Google API密钥有效
-
工具未出现在Claude中:
- 完全重新启动克劳德桌面
- 检查服务器日志是否有错误
- 验证JSON配置语法
许可证
该项目根据麻省理工学院许可证获得许可