eClass MCP Server

eClass MCP Server

By sdi2200262 GitHub

an MCP server for GUnet's Open eClass

Overview

what is eClass MCP Server?

The eClass MCP Server is a client designed to interact with the University of Athens' eClass platform, facilitating a connection between a Large Language Model (LLM) and the eClass instance through a Model Context Protocol (MCP).

how to use eClass MCP Server?

To use the eClass MCP Server, clone the repository, set up a virtual environment, install dependencies, and configure your credentials in the .env file. You can then run a test script to verify authentication or use the client in your own Python code.

key features of eClass MCP Server?

  • Authentication with UoA's Single Sign-On (SSO) system (CAS)
  • Fetching the list of enrolled courses
  • Session management (login/logout)
  • Robust error handling and logging

use cases of eClass MCP Server?

  1. Accessing course information directly from an LLM chatbox.
  2. Integrating eClass data into AI-assisted IDEs.
  3. Automating course management tasks for students and educators.

FAQ from eClass MCP Server?

  • Is the eClass MCP Server free to use?

Yes! The eClass MCP Server is open-source and free to use.

  • How do I secure my credentials?

Credentials are stored in a local .env file, which should be kept secure and never committed to version control.

  • What programming language is used?

The eClass MCP Server is implemented in Python.

Content

eClass MCP Server

An MCP server for interacting with Open eClass platform instances, with specific support for UoA's SSO authentication system.

This server enables AI agents to authenticate with eClass, retrieve course information, and perform basic operations on the platform.

Features

  • Authentication: Log in to eClass through UoA's CAS SSO authentication system
  • Course Management: Retrieve lists of enrolled courses
  • Session Management: Maintain authenticated sessions between tool calls
  • Status Checking: Verify authentication status

Installation

Install the server using UV (recommended):

# Clone the repository
git clone https://github.com/yourusername/eClass-MCP-server.git
cd eClass-MCP-server

# Install dependencies
uv sync --dev --all-extras

Alternatively, install with pip:

pip install -e .

Configuration

Create a .env file in the root directory with the following configuration:

ECLASS_URL=https://eclass.uoa.gr
ECLASS_USERNAME=your_username
ECLASS_PASSWORD=your_password

All credentials must be provided in the .env file. The server does not accept credentials as parameters.

Usage

Run the server:

eclass-mcp-server

The server provides the following tools for use with MCP clients:

login

Log in to eClass using SSO authentication.

{
  "random_string": "dummy"
}

get_courses

Retrieve a list of enrolled courses (requires login first).

{}

logout

Log out from eClass.

{}

authstatus

Check the current authentication status.

{}

Example MCP Client Usage

from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
import asyncio

async def run_agent():
    server_params = StdioServerParameters(
        command="eclass-mcp-server",
    )
    
    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())

Integration with AI Agents

This MCP server is designed to be used with AI agents that support the Model Context Protocol. This enables AI systems to interact with eClass directly, allowing for capabilities like:

  • Retrieving course information
  • Checking course announcements
  • Accessing course materials
  • Submitting assignments (future feature)

Security Considerations

  • The server handles sensitive authentication credentials
  • Credentials are only used for authentication and are not stored persistently
  • Session cookies are maintained in memory during the server's lifecycle
  • The server validates session state before performing operations

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

No tools information available.
No content found.