moodle_math_mcp
moodle_math_mcp
MCP server for moodle.math.tusur.ru — automates Moodle interactions via Playwright browser automation.
Features
list_courses — get available courses
list_course_modules — list materials and assignments in a course
find_course_module — search modules by title
get_assignment_details — fetch assignment page text
download_module_files — download files from a resource or assignment
Prerequisites
Node.js >= 18
Playwright browsers:
npx playwright install chromium
Setup
Clone the repo:
git clone https://github.com/<you>/moodle_math_mcp.git cd moodle_math_mcpInstall dependencies:
npm installCreate
.envfrom the example:cp .env.example .envFill in
MATH_USERNAMEandMATH_PASSWORDwith your Moodle credentials.(Optional) Save browser session for cookie-based auth:
npm run loginA browser window will open — log in manually. The session is saved to
storage/auth.json.
Usage
As an MCP server
Add to your MCP client config (e.g. Claude Desktop):
{
"mcpServers": {
"moodle-math": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "/path/to/moodle_math_mcp"
}
}
}Development
npm run devBuild
npm run build
npm startEnvironment Variables
Variable | Required | Default | Description |
| Yes | — | Moodle login |
| Yes | — | Moodle password |
| No |
| Moodle base URL |
| No |
| Run browser without UI |
License
ISC