eClass MCP Server
eClass MCP 服务器
特征
身份验证:通过 UoA 的 CAS SSO 身份验证系统登录 eClass
课程管理:检索已注册课程列表
会话管理:在工具调用之间维护经过身份验证的会话
状态检查:验证身份验证状态
Related MCP server: mcpUPB
项目结构
该项目采用模块化架构,以提高可维护性:
eclass-mcp-server/
├── run_server.py # Entry point script for running the server
├── pyproject.toml # Project configuration and dependencies
├── .env # Environment variables (create from example.env)
├── src/
└── eclass_mcp_server/ # Main package
├── __init__.py # Package initialization
├── server.py # Core server implementation and tool handlers
├── authentication.py # Authentication functionality
├── course_management.py # Course-related functionality
├── html_parsing.py # HTML parsing utilities
└── test/ # Test scripts for functionality verification
├── __init__.py
├── test_login.py
├── test_courses.py
└── run_all_tests.py安装
使用 UV 安装服务器(推荐):
# Clone the repository
git clone https://github.com/yourusername/eClass-MCP-server.git
cd eClass-MCP-server
# Install dependencies
uv sync --dev --all-extras或者,使用 pip 安装:
pip install -e .配置
在根目录中创建一个具有以下配置的.env文件(或复制并重命名提供的example.env文件):
ECLASS_URL=https://eclass.uoa.gr
ECLASS_USERNAME=your_username
ECLASS_PASSWORD=your_password所有凭证都必须在 .env 文件中提供。服务器不接受凭证作为参数。
用法
终端
使用入口点脚本运行服务器:
python run_server.py或者作为模块:
python -m src.eclass_mcp_server.server光标
前往“设置”->“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。
{
"random_string": "any_value"
}获取课程
检索已注册课程的列表(需要先登录)。
{
"random_string": "any_value"
}登出
从 eClass 注销。
{
"random_string": "any_value"
}授权状态
检查当前身份验证状态。
{
"random_string": "any_value"
}测试
该项目包括用于验证功能的测试脚本:
# Run all tests
python -m src.eclass_mcp_server.test.run_all_tests
# Run specific tests
python -m src.eclass_mcp_server.test.test_login
python -m src.eclass_mcp_server.test.test_coursesMCP 客户端使用示例
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
import asyncio
async def run_agent():
server_params = StdioServerParameters(
command="python /path/to/eclass-mcp-server/run_server.py",
)
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
# Initialize the session
await session.initialize()
# Login to eClass
login_result = await session.call_tool("login", {
"random_string": "dummy"
})
print(login_result)
# Get courses
courses_result = await session.call_tool("get_courses", {
"random_string": "dummy"
})
print(courses_result)
# Logout
logout_result = await session.call_tool("logout", {
"random_string": "dummy"
})
print(logout_result)
if __name__ == "__main__":
asyncio.run(run_agent())与AI代理集成
此 MCP 服务器旨在与支持模型上下文协议 (MCP) 的 AI 代理配合使用。这使得 AI 系统能够直接与 eClass 交互,从而实现以下功能:
检索课程信息
查看课程公告
获取课程材料
提交作业(未来功能)
安全注意事项
服务器处理敏感的身份验证凭据
凭证仅用于身份验证,不会持久存储
会话 cookie 在服务器的生命周期内保存在内存中
服务器在执行操作之前验证会话状态
带有凭证的
.env文件永远不应提交到版本控制(它包含在 .gitignore 中)
执照
MIT 许可证
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that enables LLMs to interact with the Moodle platform to manage courses, students, assignments, and quizzes.711MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that turns UPB Virtual (Moodle) into a structured knowledge source, enabling AI assistants to query courses, assignments, deadlines, announcements, and sync materials via REST API.MIT
- AlicenseNot gradedqualityDmaintenanceA powerful Model Context Protocol (MCP) server that seamlessly integrates AI assistants with Moodle Learning Management System. Enable your AI assistant to access courses, retrieve educational content, download resources, and search through your learning materials.14MIT
- AlicenseNot gradedqualityDmaintenanceUnified MCP server for Google Classroom, Drive, and Docs, enabling AI assistants to manage courses, assignments, files, and documents.MIT
Related MCP Connectors
MCP server teaching AI agents to implement TideCloak: auth, E2EE, IGA, security analysis
MCP server for Argo RPG Platform — connects AI assistants to campaign data via OAuth2
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/sdi2200262/eclass-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server