eClass (UoA) MCP server

Integrates with Open eClass platform to enable course access and management through UoA's SSO authentication system, providing tools for login, course listing, and session handling
Back to servers
Setup instructions
Provider
CobuterMan
Release date
Mar 20, 2025
Language
Python
Stats
5 stars

The eClass MCP Server enables AI agents to interact with Open eClass platform instances through the Model Context Protocol, supporting UoA's SSO authentication system. It provides a standardized way for AI tools to authenticate with eClass, retrieve course information, and perform basic platform operations.

Installation

To install the eClass MCP Server:

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

# Install dependencies using UV (recommended)
uv sync --dev --all-extras

# Or alternatively with pip
pip install -e .

Configuration

Create a .env file in the root directory with your eClass credentials:

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

You can also copy and rename the provided example.env file. Note that all credentials must be provided in this file - the server does not accept credentials as parameters.

Running the Server

From Terminal

Start the server using the entry point script:

python run_server.py

Or run it as a module:

python -m src.eclass_mcp_server.server

With Cursor

In Cursor (v0.48+), go to Settings → MCP and click on "Add new global MCP server". This will open the global mcp.json file. Configure it as follows:

{
    "mcpServers": {
      "server-name": {
        "command": "python",
        "args": ["absolute\\path\\to\\eclass-mcp-server\\run_server.py"]
      }
    }
}

You can also try this path format on the args field:

absolute/path/to/eclass-mcp-server/run_server.py

With Claude Desktop

  1. Open Claude Desktop
  2. Go to Settings > Server
  3. Add a new server with the following details:
    • Name: eClass MCP
    • Command: Path to your run_server.py script
  4. Click Add Server
  5. Select the server from the dropdown when chatting with Claude

Available Tools

The server provides the following MCP tools:

login

Log in to eClass using SSO authentication.

{
  "random_string": "any_value"
}

get_courses

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

{
  "random_string": "any_value"
}

logout

Log out from eClass.

{
  "random_string": "any_value"
}

authstatus

Check the current authentication status.

{
  "random_string": "any_value"
}

Using with MCP Clients

Here's an example of how to use the server with an MCP client:

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())

Security Considerations

The eClass MCP Server is designed with security as a priority:

  • Local-Only Execution: The server runs entirely on your local machine
  • No Remote Storage: Credentials and session data never leave your local environment
  • Environment Variables Only: Credentials are stored exclusively in the local .env file
  • Never Passed as Parameters: All tools use dummy parameters to avoid credential exposure
  • In-Memory Sessions: Session cookies and state are maintained only in memory

Standalone eClass Client

The repository includes eclass_client.py, a standalone client for interacting with eClass without MCP integration. Run it directly:

python eclass_client.py

Testing

Verify the server's functionality with included test scripts:

# 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_courses

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "eclass-mcp-server" '{"command":"python","args":["run_server.py"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "eclass-mcp-server": {
            "command": "python",
            "args": [
                "run_server.py"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "eclass-mcp-server": {
            "command": "python",
            "args": [
                "run_server.py"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later