Skip to main content
Glama
markrz-0

ekursy-mcp-py

by markrz-0

eKursy Python MCP Server (ekursy-mcp-py)

A Model Context Protocol (MCP) server written in Python using FastMCP, which integrates with the ekursy-zero Rust scraper to expose student profile information, course lists, course grades, page contents, and course materials (PDF/images) from the eKursy platform to AI tools.


Prerequisites

Before running the server, ensure you have:

  1. Git installed on your system.

  2. Docker installed on your system

  3. Python installed on your system


Related MCP server: Canvas LMS MCP

Installation & Setup

If you dont use antigravity this won't work for you. See manual methods below or ask your AI agent

This repository includes a cross-platform setup script that automatically initializes git submodules, prompts you for credentials to create the .env file, and configures the Gemini / Antigravity integration file for you.

  • Windows: Run scripts\setup.bat (Double-click or run in terminal: .\scripts\setup.bat)

  • macOS / Linux: Run ./scripts/setup.sh (or bash scripts/setup.sh)

The script will configure MCP in Antigravity and start the server in docker. You only need to restart Antigravity and this MCP server should work


Alternative/Manual Methods

1. Initialize Submodule & Credentials Manually

If you prefer not to use the setup script:

git submodule update --init --recursive

And manually create a .env file in the root directory:

MOODLE_USERNAME="your.email@student.put.poznan.pl"
MOODLE_PASSWORD="your_moodle_password"
MCP_TRANSPORT="streamable-http" # optional: defaults to streamable-http when running using docker compose, set to stdio to run locally

How to Run

Option A: Run via Docker Compose

This runs both the ekursy-zero scraper backend and ekursy-mcp-py server together. The scraper remains private and isolated inside the container network (ports are not exposed to the host).

By default, Docker Compose runs the MCP server in streamable-http mode. If you need to configure the transport type, you can set MCP_TRANSPORT in your .env file (e.g., MCP_TRANSPORT=stdio or MCP_TRANSPORT=streamable-http).

File Downloads & Shared Volumes

When running via Docker Compose, the host's ./downloads directory is mounted to /app/downloads in the container.

  • The environment variable HOST_DOWNLOADS_DIR is set in docker-compose.yml as ${PWD}/downloads.

  • When an MCP tool calls save_resource (e.g. download PDF or images), the file is saved inside this volume. The server uses HOST_DOWNLOADS_DIR to report the exact absolute host path back to the MCP caller so you know exactly where to locate the file on your machine.

Run the following command:

docker compose up --build

The MCP server will start on HTTP port 6969 (if using streamable-http mode). You can verify it by reaching the MCP endpoint: http://localhost:6969/mcp

Option B: Run Locally

To run the server locally using the standard stdio transport:

uv run src/main.py

Note: By default, running the script directly uses stdio transport. You can force it to run as a local HTTP server by setting the MCP_TRANSPORT environment variable: MCP_TRANSPORT=streamable-http uv run src/main.py (which runs on port 6969 or the port specified in PORT).


Manual Integration with Antigravity / Gemini MCP

To manually connect this Python MCP server to your Antigravity environment:

  1. Locate the configuration file on your system (e.g., C:\Users\Marcin\.gemini\config\mcp_config.json or config.json).

  2. Add a new server entry inside the mcpServers object.

Add the following snippet to your configuration block:

{
  "mcpServers": {
    "ekursy-mcp-py": {
      "serverUrl": "http://localhost:6969/mcp"
    }
  }
}

Note: Ensure the MOODLE_API_BASE env variable points to the scraper service instance (e.g. http://localhost:8080 if running ekursy-zero locally/standalone).

Alternative Config (Local stdio Server)

If you prefer to run the server locally using the standard input/output (stdio) transport:

Add the following snippet to your configuration block (make sure to replace C:\\path\\to\\ekursy-mcp-py with the absolute path to your cloned repository, and update the environment variables):

{
  "mcpServers": {
    "ekursy-mcp-py-stdio": {
      "command": "uv",
      "args": [
        "run",
        "src/main.py"
      ],
      "cwd": "C:\\path\\to\\ekursy-mcp-py",
      "env": {
        "MOODLE_USERNAME": "your.email@student.put.poznan.pl",
        "MOODLE_PASSWORD": "your_moodle_password",
        "MOODLE_API_BASE": "http://localhost:8080",
        "MCP_TRANSPORT": "stdio"
      }
    }
  }
}

Note: Ensure the MOODLE_API_BASE env variable points to the scraper service instance (e.g., http://localhost:8080 if running ekursy-zero locally/standalone). The MCP_TRANSPORT is optional and defaults to stdio when running locally.

Available Tools

6 tools
get_course_contentB

Get the detailed page fragments and sections for a specific course (including presentations, lecturer names, assignments, and other files).

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe internal unique course identifier string.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe internal unique course identifier string.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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_proxyC

Download and parse internal university proxies (PDFs, Images, URLs etc).

ParametersJSON Schema
NameRequiredDescriptionDefault
proxyPathYesPath of the proxy page fragment

TDQS

C2.8/5.0
Behavior2/5

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.

Conciseness3/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

  1. 6 tool updatesv0.1.0
    • First observedget_course_content
    • First observedget_course_grades
    • First observedget_user_profile
    • First observedlist_courses
    • First observedresolve_material_link
    • First observedresolve_proxy

TDQS

A3.5/5.0

Scored across 6 tools

Disambiguation4/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers