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 Server」)
「タイプ」の
commandオプションを選択しますコマンド入力に以下を追加します:
python /path/to/eclass-mcp-server/run_server.py
このコマンドは、MCP クライアントをserver.pyのメイン サーバー エントリ ポイントに接続するrun_server.pyスクリプトを実行します。
クロードデスクトップ
Claude Desktop で使用するには:
クロードデスクトップを開く
設定 > サーバーに移動
次の詳細で新しいサーバーを追加します。
名前: eClass MCP
コマンド: run_server.py スクリプトへのパス
サーバーの追加をクリック
クロードとチャットするときにドロップダウンからサーバーを選択してください
ツール
サーバーは、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サーバーは、モデルコンテキストプロトコルをサポートするAIエージェントと連携して使用するように設計されています。これにより、AIシステムはeClassと直接やり取りできるようになり、以下のような機能を実現できます。
コース情報の取得
コースのお知らせを確認する
コース教材へのアクセス
課題の提出(将来の機能)
セキュリティに関する考慮事項
サーバーは機密性の高い認証資格情報を処理します
認証情報は認証にのみ使用され、永続的に保存されることはありません
セッションクッキーはサーバーのライフサイクル中にメモリ内に保持されます
サーバーは操作を実行する前にセッション状態を検証します
資格情報を含む
.envファイルはバージョン管理にコミットしないでください (.gitignore に含まれています)
ライセンス
MITライセンス
貢献
貢献を歓迎します!お気軽にプルリクエストを送信してください。
Available Tools
4 toolsauthstatusB
Check authentication status with eClass
Inputs: random_string (required).
get_coursesB
Get list of enrolled courses from eClass
Inputs: random_string (required).
loginB
Log in to eClass using username/password from your .env file through UoA's SSO. Configure ECLASS_USERNAME and ECLASS_PASSWORD in your .env file.
Inputs: random_string (required).
logoutB
Log out from eClass
Inputs: random_string (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct purpose with no overlap: authstatus checks authentication state, get_courses retrieves course data, login handles authentication, and logout terminates sessions. The descriptions clearly differentiate these functions, making tool selection straightforward for an agent.
Three tools follow a consistent verb_noun pattern (get_courses, login, logout), while authstatus uses a compound noun. This minor deviation slightly reduces consistency, but the naming remains readable and intuitive overall.
Four tools are reasonable for an eClass server focused on authentication and basic course access. It covers core authentication workflows and data retrieval, though it could be slightly expanded for a more comprehensive eClass integration.
The tools cover authentication and course listing well, but there are notable gaps for typical eClass functionality such as accessing course content, assignments, grades, or announcements. This limits the server's ability to support full eClass workflows.
Maintenance
Related MCP Connectors
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
MCP Server for an Agent Task Marketplace
MCP server enabling AI agents to manage Bitrix24 features via standardized protocol
Connect any AI agent to 1,000+ apps and 27,000+ actions through one remote MCP server (OAuth).
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that enables LLMs to interact with the Moodle platform to manage courses, students, assignments, and quizzes.7MIT
- AlicenseNot gradedqualityDmaintenanceMCP 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 gradedqualityNot gradedmaintenanceAn MCP server that connects AI assistants to university D2L Brightspace and Piazza, enabling query of courses, grades, assignments, deadlines, files, and Piazza posts.7MIT
- AlicenseAqualityDmaintenanceMCP server for Moodle that lets AI agents publish and manage pedagogical content — courses, lessons, quizzes, forums — via Moodle Web Services with idempotency.45MIT