# shanikn/moodle_mcp architecture

> Architecture diagram of the GitHub repository shanikn/moodle_mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shanikn/moodle_mcp
- Repository: https://github.com/shanikn/moodle_mcp

## Overview

Moodle MCP exposes Moodle and Reichman Yedion student information to AI clients through MCP tools and a brief HTTP interface. The principal workflow is an AI request entering the server, dispatching to a domain capability, retrieving Moodle or Yedion data, and returning structured or formatted results. The graph preserves the documented capabilities and the distinct Moodle and Yedion paths. Some server dispatches and unsampled module internals are inferred only as unverified links; source excerpts and the SOURCE INDEX provide the remaining relationship evidence.

Main entry points: [`src/moodle_mcp/server.py`](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/server.py) (MCP server), [`src/moodle_mcp/runi.py`](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/runi.py) (Yedion session), [`src/moodle_mcp/client.py`](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/client.py) (Moodle API client), [`src/moodle_mcp/brief.py`](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/brief.py) (Brief summaries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["MCP interface"]
  node_server["MCP server<br/>[server.py]"]
  node_brief["Brief summaries<br/>[brief.py]"]
end

subgraph group_moodle["Moodle capabilities"]
  node_assignments["Assignments<br/>[assignments.py]"]
  node_calendar["Calendar<br/>[calendar.py]"]
  node_courses["Courses<br/>[courses.py]"]
  node_deadlines["Deadlines<br/>[deadlines.py]"]
  node_grades["Grades<br/>[grades.py]"]
  node_messages["Messages<br/>[messages.py]"]
  node_reading["Course reading<br/>[reading.py]"]
  node_search["Search<br/>[search.py]"]
end

subgraph group_yedion["Yedion capabilities"]
  node_exams["Exam schedule<br/>[exams.py]"]
  node_exam_bank["Past exam bank<br/>[exam_bank.py]"]
  node_notebooks["Lecture notebooks<br/>[notebooks.py]"]
  node_schedule["Class schedule<br/>[schedule.py]"]
end

subgraph group_shared["Access and shaping"]
  node_runi["Yedion session<br/>[runi.py]"]
  node_yedion_forms["Form parsing<br/>[yedion_forms.py]"]
  node_yedion_files["PDF handling<br/>[yedion_files.py]"]
  node_client["Moodle API client<br/>[client.py]"]
  node_config["Site configuration<br/>[config.py]"]
  node_formatting["Data formatting<br/>[formatting.py]"]
  node_redact["Credential redaction<br/>[redact.py]"]
end

node_ai(("AI client"))
node_moodle_api{{"Moodle service"}}
node_university{{"Yedion / My RUNI"}}

node_ai -->|"requests tools"| node_server
node_server -->|"calls"| node_assignments
node_server -->|"routes summaries"| node_brief
node_server -.->|"dispatches"| node_calendar
node_server -.->|"dispatches"| node_courses
node_server -.->|"dispatches"| node_deadlines
node_server -.->|"dispatches"| node_grades
node_server -.->|"dispatches"| node_messages
node_server -.->|"dispatches"| node_reading
node_server -.->|"dispatches"| node_search
node_server -.->|"dispatches"| node_exams
node_server -.->|"dispatches"| node_exam_bank
node_server -.->|"dispatches"| node_notebooks
node_server -.->|"dispatches"| node_schedule
node_brief -->|"gets due items"| node_deadlines
node_brief -->|"reads classes"| node_schedule
node_brief -->|"reads exams"| node_exams
node_assignments -->|"requests data"| node_client
node_courses -->|"requests data"| node_client
node_deadlines -->|"requests data"| node_client
node_client -->|"gets site credentials"| node_config
node_client -->|"posts requests"| node_moodle_api
node_exams -->|"fetches pages"| node_runi
node_schedule -->|"queries forms"| node_yedion_forms
node_yedion_forms -->|"fetches forms"| node_runi
node_exam_bank -->|"searches bank"| node_runi
node_exam_bank -->|"extracts file fields"| node_yedion_files
node_notebooks -.->|"fetches pages"| node_runi
node_notebooks -.->|"uses PDF tools"| node_yedion_files
node_runi -->|"authenticates and fetches"| node_university
node_runi -.->|"masks errors"| node_redact

click node_server "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/server.py"
click node_brief "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/brief.py"
click node_assignments "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/assignments.py"
click node_calendar "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/calendar.py"
click node_courses "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/courses.py"
click node_deadlines "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/deadlines.py"
click node_grades "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/grades.py"
click node_messages "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/messages.py"
click node_reading "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/reading.py"
click node_search "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/search.py"
click node_exams "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/exams.py"
click node_exam_bank "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/exam_bank.py"
click node_notebooks "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/notebooks.py"
click node_schedule "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/schedule.py"
click node_runi "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/runi.py"
click node_yedion_forms "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/yedion_forms.py"
click node_yedion_files "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/yedion_files.py"
click node_client "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/client.py"
click node_config "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/config.py"
click node_formatting "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/formatting.py"
click node_redact "https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/redact.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_brief,node_ai toneBlue
class node_assignments,node_calendar,node_courses,node_deadlines,node_grades,node_messages,node_reading,node_search toneAmber
class node_exams,node_exam_bank,node_notebooks,node_schedule toneMint
class node_runi,node_yedion_forms,node_yedion_files,node_client,node_config,node_formatting,node_redact toneRose
class node_moodle_api,node_university toneIndigo
```

## Components

### MCP interface

- [MCP server](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/server.py): `src/moodle_mcp/server.py`
- [Brief summaries](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/brief.py): `src/moodle_mcp/brief.py`

### Moodle capabilities

- [Assignments](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/assignments.py): `src/moodle_mcp/assignments.py`
- [Calendar](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/calendar.py): `src/moodle_mcp/calendar.py`
- [Courses](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/courses.py): `src/moodle_mcp/courses.py`
- [Deadlines](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/deadlines.py): `src/moodle_mcp/deadlines.py`
- [Grades](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/grades.py): `src/moodle_mcp/grades.py`
- [Messages](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/messages.py): `src/moodle_mcp/messages.py`
- [Course reading](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/reading.py): `src/moodle_mcp/reading.py`
- [Search](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/search.py): `src/moodle_mcp/search.py`

### Yedion capabilities

- [Exam schedule](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/exams.py): `src/moodle_mcp/exams.py`
- [Past exam bank](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/exam_bank.py): `src/moodle_mcp/exam_bank.py`
- [Lecture notebooks](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/notebooks.py): `src/moodle_mcp/notebooks.py`
- [Class schedule](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/schedule.py): `src/moodle_mcp/schedule.py`

### Access and shaping

- [Yedion session](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/runi.py): `src/moodle_mcp/runi.py`
- [Form parsing](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/yedion_forms.py): `src/moodle_mcp/yedion_forms.py`
- [PDF handling](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/yedion_files.py): `src/moodle_mcp/yedion_files.py`
- [Moodle API client](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/client.py): `src/moodle_mcp/client.py`
- [Site configuration](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/config.py): `src/moodle_mcp/config.py`
- [Data formatting](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/formatting.py): `src/moodle_mcp/formatting.py`
- [Credential redaction](https://github.com/shanikn/moodle_mcp/blob/main/src/moodle_mcp/redact.py): `src/moodle_mcp/redact.py`

### Other components

- **AI client**
- **Moodle service**
- **Yedion / My RUNI**

## Connections

- AI client → MCP server: requests tools (evidence: `README.md`)
- MCP server → Assignments: calls (evidence: `src/moodle_mcp/server.py`)
- MCP server → Brief summaries: routes summaries (evidence: `src/moodle_mcp/server.py`)
- MCP server → Calendar: dispatches (evidence: `src/moodle_mcp/server.py`)
- MCP server → Courses: dispatches (evidence: `src/moodle_mcp/server.py`)
- MCP server → Deadlines: dispatches (evidence: `src/moodle_mcp/server.py`)
- MCP server → Grades: dispatches (evidence: `src/moodle_mcp/server.py`)
- MCP server → Messages: dispatches (evidence: `src/moodle_mcp/server.py`)
- MCP server → Course reading: dispatches (evidence: `src/moodle_mcp/server.py`)
- MCP server → Search: dispatches (evidence: `src/moodle_mcp/server.py`)
- MCP server → Exam schedule: dispatches (evidence: `src/moodle_mcp/server.py`)
- MCP server → Past exam bank: dispatches (evidence: `src/moodle_mcp/server.py`)
- MCP server → Lecture notebooks: dispatches (evidence: `src/moodle_mcp/server.py`)
- MCP server → Class schedule: dispatches (evidence: `src/moodle_mcp/server.py`)
- Brief summaries → Deadlines: gets due items (evidence: `src/moodle_mcp/brief.py`)
- Brief summaries → Class schedule: reads classes (evidence: `src/moodle_mcp/brief.py`)
- Brief summaries → Exam schedule: reads exams (evidence: `src/moodle_mcp/brief.py`)
- Assignments → Moodle API client: requests data (evidence: `src/moodle_mcp/assignments.py`)
- Courses → Moodle API client: requests data (evidence: `src/moodle_mcp/courses.py`)
- Deadlines → Moodle API client: requests data (evidence: `src/moodle_mcp/deadlines.py`)
- Moodle API client → Site configuration: gets site credentials (evidence: `src/moodle_mcp/client.py`)
- Moodle API client → Moodle service: posts requests (evidence: `src/moodle_mcp/client.py`)
- Exam schedule → Yedion session: fetches pages (evidence: `src/moodle_mcp/exams.py`)
- Class schedule → Form parsing: queries forms (evidence: `src/moodle_mcp/schedule.py`)
- Form parsing → Yedion session: fetches forms (evidence: `src/moodle_mcp/yedion_forms.py`)
- Past exam bank → Yedion session: searches bank (evidence: `src/moodle_mcp/exam_bank.py`)
- Past exam bank → PDF handling: extracts file fields (evidence: `src/moodle_mcp/exam_bank.py`)
- Lecture notebooks → Yedion session: fetches pages (evidence: `src/moodle_mcp/notebooks.py`)
- Lecture notebooks → PDF handling: uses PDF tools (evidence: `src/moodle_mcp/notebooks.py`)
- Yedion session → Yedion / My RUNI: authenticates and fetches (evidence: `src/moodle_mcp/runi.py`)
- Yedion session → Credential redaction: masks errors (evidence: `src/moodle_mcp/runi.py`)
