ekursy-mcp-py
An invite-only, GitHub-OAuth MCP server for accessing a student's eKursy/Moodle data via scoped tools.
Fetch the authenticated student's profile and USOS number.
List all enrolled courses.
Retrieve course sections, presentations, lecturer names, assignments, and files.
Fetch a course's hierarchical gradebook.
Download and parse internal university files such as PDFs and images.
Resolve/download internal university proxy links and page fragments, including PDFs, images, and URLs.
Map each GitHub identity to separately encrypted Moodle credentials without exposing the university password in OAuth tokens or tool calls.
Provides tools for accessing student profile information, course lists, course grades, page contents, and course materials (PDF/images) from the eKursy (Moodle-based) platform.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ekursy-mcp-pyshow my grades for this semester"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
eKursy MCP Server
A remote Model Context Protocol server that exposes a student's eKursy profile,
courses, grades, deadlines, forums, and course materials. It uses FastMCP over
Streamable HTTP, the bundled ekursy-zero Rust service, and invite-only GitHub
OAuth.
Each GitHub identity maps to its own Moodle credentials in SQLite. Credential fields are encrypted with Fernet authenticated encryption before being written to disk. OAuth tokens and MCP tool calls never contain the university password.
Production endpoint
The production MCP URL is:
https://mk.uni.markrz0.dev/mcpOAuth discovery and callback routes are served on the same origin. The Docker
port is bound only to 127.0.0.1; nginx is the public TLS endpoint.
Related MCP server: geo-explorer-mcp
Production prerequisites
Create a GitHub OAuth app at https://github.com/settings/developers.
Set its homepage URL to
https://mk.uni.markrz0.dev.Set its authorization callback URL to
https://mk.uni.markrz0.dev/auth/callback.Copy
.env.exampleto.env, fill the GitHub client ID/secret, and independently generate bothOAUTH_JWT_SIGNING_KEYandCREDENTIAL_ENCRYPTION_KEYwithopenssl rand -hex 32.Keep
.envmode600on the server.
OAUTH_ALLOWED_GITHUB_USERS is only a bootstrap list. On that user's next
authenticated request, the server records their immutable numeric GitHub ID
with no Moodle credentials. New users must be invited with the admin command
below.
Never rotate CREDENTIAL_ENCRYPTION_KEY while the SQLite database contains
credentials. Losing it makes those credential records unrecoverable.
Deploy
git submodule update --init --recursive
docker compose up --build -d
docker compose ps
docker compose logs --tail=100 ekursy-mcpThe SQLite account database and OAuth state use a named Docker volume, so they survive container recreation and are not stored in the Git checkout.
To install nginx and obtain the certificate on Ubuntu, copy
deploy/install-nginx.sh to the VPS and run:
sudo bash ~/install-ekursy-nginx.sh you@example.comThe script validates nginx before every reload and lets Certbot add the TLS and HTTP-to-HTTPS configuration.
On the prepared VPS deployment, enter the GitHub OAuth credentials without putting the secret in shell history, start the containers, and then install TLS:
bash ~/finish-ekursy-deploy.sh
sudo bash ~/install-ekursy-nginx.sh you@example.comConnect from ChatGPT
Add a custom MCP server/plugin with the server URL
https://mk.uni.markrz0.dev/mcp and OAuth authentication. Complete the GitHub
authorization as an invited account. Then install the resulting plugin and use
it from the conversation in which you create the scheduled task.
The first account listed in OAUTH_ALLOWED_GITHUB_USERS is bootstrapped on its
next request. Ask the connector to run create_account_setup_link, open the
returned browser link, and enter your Moodle credentials there.
Add a friend
Invite their GitHub account from the VPS. The command resolves the login to GitHub's immutable numeric user ID before storing it:
cd /home/saell/ekursy-mcp
docker compose exec ekursy-mcp /app/.venv/bin/python src/admin.py invite THEIR_GITHUB_LOGIN
docker compose exec ekursy-mcp /app/.venv/bin/python src/admin.py listYour friend then adds https://mk.uni.markrz0.dev/mcp in ChatGPT and completes
GitHub OAuth. In ChatGPT they ask the connector to run
create_account_setup_link, open the returned short-lived one-time link in a
browser, and enter their own Moodle credentials. The server validates and
encrypts them directly; they do not pass through ChatGPT.
Disable or re-enable access without deleting the encrypted record:
docker compose exec ekursy-mcp /app/.venv/bin/python src/admin.py disable THEIR_GITHUB_LOGIN
docker compose exec ekursy-mcp /app/.venv/bin/python src/admin.py enable THEIR_GITHUB_LOGINEach Moodle login has an isolated server-side session. Tool calls resolve the authenticated GitHub ID to exactly one database record before accessing Moodle.
The exact availability of custom MCP servers and scheduled tasks depends on your ChatGPT plan and workspace policy.
Local development
Initialize the scraper submodule, copy .env.example to .env, configure the
OAuth settings, and install dependencies with uv:
git submodule update --init --recursive
uv sync --frozen
docker compose up --buildRun tests with:
python -m unittest discover -s tests -vAvailable Tools
6 toolsget_course_contentB
Get the detailed page fragments and sections for a specific course (including presentations, lecturer names, assignments, and other files).
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The internal unique course identifier string. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must bear the full burden. It only states the basic function but does not disclose behavioral traits such as authentication requirements, read-only nature, or pagination behavior. The description is insufficient for a tool with no annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no unnecessary words, achieving high conciseness. It is front-loaded with the core purpose. Slightly more structured formatting could improve readability for an AI agent.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity (1 parameter, output schema exists), the description adequately covers what the tool does. It does not need to explain return values due to output schema. However, it omits mention of any filtering or pagination, which might be relevant for large courses.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already documents the single required id parameter, and schema coverage is 100%. The description adds examples of output content but does not add extra meaning for the parameter beyond what the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Get' and the resource 'detailed page fragments and sections for a specific course', with explicit examples like presentations, lecturer names, assignments, and other files. It distinguishes from siblings such as list_courses and get_course_grades.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is used for a specific course via the id parameter, but it provides no guidance on when to use alternatives like list_courses or get_course_grades, and no explicit when-not-to-use criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_course_gradesB
Fetch the hierarchical gradebook for a specific course.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The internal unique course identifier string. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description lacks disclosure of behaviors such as rate limits, authentication needs, or what 'hierarchical' means in terms of data structure. The one-sentence description is insufficient for transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with no extraneous information. It is appropriately concise and front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple fetch tool with one parameter and an output schema, the description is minimally adequate but lacks context about what 'hierarchical' entails and does not explain the return format.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for the single parameter 'id', and the description adds no new meaning beyond what the schema already provides. Baseline is 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Fetch' and the resource 'hierarchical gradebook for a specific course'. It distinguishes from siblings like get_course_content (content) and list_courses (list).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool vs alternatives, no prerequisites or context provided. The description only implies that a course ID is needed.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_user_profileA
Fetch the authenticated student's profile information and USOS number.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description does not disclose behavioral traits such as authentication requirements, permissions, rate limits, or side effects. It only states the action, leaving key behavioral context implicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise, with only two sentences that efficiently convey the purpose. Every word earns its place with no redundancy or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity, presence of an output schema, and zero parameters, the description is minimally adequate. However, it lacks usage guidelines and behavioral transparency, which would improve completeness for an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the description does not need to add parameter semantics. Baseline 4 is appropriate as the schema coverage is 100% and no parameter explanation is required.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Fetch' and the specific resource 'authenticated student's profile information and USOS number'. It distinctly differentiates from sibling tools like get_course_content or list_courses, which are about course-related data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for retrieving the current user's profile but provides no explicit guidance on when to use or not use this tool versus alternatives. No exclusions or alternative tool names are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_coursesA
Get a list of all courses the student is enrolled in.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description bears full responsibility for behavioral disclosure. It only states a basic list retrieval without detailing ordering, pagination, filtering, or any side effects. This lacks transparency, especially since the tool returns all enrolled courses with no parameters to limit results.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no extraneous words. It efficiently communicates the core functionality, earning full points for conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has no parameters and a provided output schema, the description is mostly complete. However, it could mention that it returns only courses the user is enrolled in (already implied) and lacks any note on what the output structure is (though schema covers it). For a simple tool, this is adequate but not exemplary.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has zero parameters, so the description does not need to explain parameter semantics. Baseline is 4 for no parameters, and the description adds no confusion.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'get' and resource 'list of all courses the student is enrolled in.' It distinguishes from sibling tools like get_course_content and get_course_grades by specifying the scope (enrolled courses), making it easy to understand its purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. While the purpose is clear, the description does not mention any conditions, prerequisites, or scenarios where this tool is preferred over get_course_content or other siblings, leaving the agent to infer usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
resolve_material_linkC
Download and parse internal university files (PDFs, Images) - resource.
| Name | Required | Description | Default |
|---|---|---|---|
| resourceId | Yes | Unique id of the resource | |
| kind | Yes | Resource type selections (e.g., 'resource', 'assign') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose behaviors. It mentions download and parse actions but omits key traits: whether it's read-only, authentication needs, error handling, or if parsing alters state. This leaves significant gaps for a mutation-capable tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that front-loads the core action ('Download and parse'). It is efficient, though the trailing '- resource' adds minor clutter without improving clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, no annotations, and two required parameters, the description is insufficient. It lacks details on return format, failure modes, and setup prerequisites, leaving the agent with incomplete context for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Both parameters have schema descriptions (100% coverage), so the baseline is 3. The description adds context about file types (PDFs, Images), which loosely relates to resourceId, but offers no additional clarity on ‘kind’ beyond the schema’s examples.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool downloads and parses internal university files (PDFs, Images), which distinguishes it from sibling tools like get_course_content (listing) and list_courses. However, the purpose is slightly vague due to the appended '- resource' suffix.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like get_course_content or resolve_proxy. The description lacks any when-to-use or when-not-to-use context, leaving the agent to infer usage from the name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
resolve_proxyC
Download and parse internal university proxies (PDFs, Images, URLs etc).
| Name | Required | Description | Default |
|---|---|---|---|
| proxyPath | Yes | Path of the proxy page fragment |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description must fully disclose behavioral traits. It mentions 'download and parse' but omits critical details such as whether the tool is read-only, side effects, authentication requirements, or rate limits. The description is insufficient for an agent to understand full implications.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence and front-loads the action, but it is overly terse. It could be expanded to include necessary details without becoming verbose, balancing brevity with clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of output schema and annotations, the description should explain return values and parsing behavior. It does not specify what 'parse' entails or the format of the result, leaving the agent without enough context to use the tool effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with a single parameter described. The tool description adds general context that the path refers to a proxy page fragment, but does not elaborate on format constraints or usage beyond the schema. Baseline value of 3 is appropriate as the schema already documents the parameter.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description states the tool downloads and parses internal university proxies and lists file types, clearly indicating the resource and action. While it distinguishes from siblings like 'resolve_material_link', the term 'proxies' could be ambiguous without further context.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives such as 'resolve_material_link' or 'get_course_content'. The description does not provide context for appropriate invocation or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v0.1.0- First observed
get_course_content - First observed
get_course_grades - First observed
get_user_profile - First observed
list_courses - First observed
resolve_material_link - First observed
resolve_proxy
TDQS
Scored across 6 tools
Most tools are clearly distinct, but resolve_material_link and resolve_proxy have overlapping purposes (both download and parse internal files), which could cause minor confusion. Descriptions help distinguish them as one is for general materials and the other for proxies.
All tools follow a consistent verb_noun pattern with snake_case (e.g., get_course_content, list_courses, resolve_proxy). Verbs are appropriate and nouns are descriptive, making the naming predictable.
Six tools is a well-scoped number for a university course management MCP server. Each tool serves a distinct purpose without unnecessary duplication, covering essential student operations.
The tool set covers core functionalities: course listing, content retrieval, grades, profile, and file downloads. Minor gaps exist (e.g., no assignment submission or mailbox tool), but the provided tools form a coherent and practical surface for accessing course information.
Maintenance
Related MCP Connectors
Open-source AI courses taught by your AI tutor in conversation, with progress saved by MCP tools.
Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.
Read-only access to Epivo's live course catalogue for AI agents.
Connect AI assistants to Edusign attendance, courses, learners, documents, and API docs via OAuth.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceConnects Moodle LMS with AI assistants through the Model Context Protocol, enabling users to interact with Moodle data via a conversational chatbot interface.4 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to list learning tracks, retrieve study plans, generate coding challenges, and issue fictional completion certificates through the Model Context Protocol.MIT
- AlicenseAqualityBmaintenanceGives Claude, Codex, Cursor and any other MCP client read access to your courses, content, files, grades, deadlines, announcements and discussions, using your own browser session.3136 npm2MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to access and manage academic course information, assignments, submissions, grades, calendars, materials, recordings, and announcements through authenticated LMS sessions.MIT