Integrations
Uses .env files to store sensitive authentication credentials for eClass, maintaining them securely outside of version control
Hosts the project repository for version control and distribution of the eClass MCP server code
Built with Python, providing a foundation for the MCP server implementation that handles authentication and interactions with eClass
eClass MCP 服务器
特征
- 身份验证:通过 UoA 的 CAS SSO 身份验证系统登录 eClass
- 课程管理:检索已注册课程列表
- 会话管理:在工具调用之间维护经过身份验证的会话
- 状态检查:验证身份验证状态
项目结构
该项目采用模块化架构,以提高可维护性:
安装
使用 UV 安装服务器(推荐):
或者,使用 pip 安装:
配置
在根目录中创建一个具有以下配置的.env
文件(或复制并重命名提供的example.env
文件):
所有凭证都必须在 .env 文件中提供。服务器不接受凭证作为参数。
用法
终端
使用入口点脚本运行服务器:
或者作为模块:
光标
前往“设置”->“MCP”。点击Add new MCP server
:
- 选择一个唯一但合适的名称,以便代理知道服务器的用途(例如“eClass 服务器”)
- 选择“类型”上的
command
选项 - 在命令输入中添加:
python /path/to/eclass-mcp-server/run_server.py
此命令运行run_server.py
脚本,该脚本将 MCP 客户端与server.py
中的主服务器入口点连接起来。
克劳德桌面
与 Claude Desktop 一起使用:
- 打开 Claude 桌面
- 转至“设置”>“服务器”
- 添加具有以下详细信息的新服务器:
- 名称:eClass MCP
- 命令:run_server.py 脚本的路径
- 单击“添加服务器”
- 与 Claude 聊天时从下拉菜单中选择服务器
工具
该服务器提供以下工具供 MCP 客户端使用:
登录
使用 SSO 身份验证登录 eClass。
获取课程
检索已注册课程的列表(需要先登录)。
登出
从 eClass 注销。
授权状态
检查当前身份验证状态。
测试
该项目包括用于验证功能的测试脚本:
MCP 客户端使用示例
与AI代理集成
此 MCP 服务器旨在与支持模型上下文协议 (MCP) 的 AI 代理配合使用。这使得 AI 系统能够直接与 eClass 交互,从而实现以下功能:
- 检索课程信息
- 查看课程公告
- 获取课程材料
- 提交作业(未来功能)
安全注意事项
- 服务器处理敏感的身份验证凭据
- 凭证仅用于身份验证,不会持久存储
- 会话 cookie 在服务器的生命周期内保存在内存中
- 服务器在执行操作之前验证会话状态
- 带有凭证的
.env
文件永远不应提交到版本控制(它包含在 .gitignore 中)
执照
MIT 许可证
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
You must be authenticated.
MCP 服务器使 AI 代理能够与 Open eClass 平台实例进行身份验证和交互,支持 UoA 的 SSO 身份验证系统检索课程信息和执行基本的平台操作。
- Features
- Project Structure
- Installation
- Configuration
- Usage
- Tools
- Testing
- Example MCP Client Usage
- Integration with AI Agents
- Security Considerations
- License
- Contributing