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.
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 .
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.
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
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
The server provides the following MCP tools:
Log in to eClass using SSO authentication.
{
"random_string": "any_value"
}
Retrieve a list of enrolled courses (requires login first).
{
"random_string": "any_value"
}
Log out from eClass.
{
"random_string": "any_value"
}
Check the current authentication status.
{
"random_string": "any_value"
}
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())
The eClass MCP Server is designed with security as a priority:
.env
fileThe repository includes eclass_client.py
, a standalone client for interacting with eClass without MCP integration. Run it directly:
python eclass_client.py
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
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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