4 · Run the MCP server
Install from PyPI (easiest) or run from a repository checkout.
Install from PyPI
pip install moodle-mcp-bridge
# run (or set the variables in your MCP client config instead)
MOODLE_URL=https://moodle.example.edu MOODLE_TOKEN=your_token moodle-mcp-bridge
Or run from a checkout
# clone
git clone https://github.com/NmaaAlhawary/MCP-Moodle
cd MCP-Moodle/moodle-mcp
# isolated environment
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# configure
cp .env.example .env # then edit .env
python server.py
Configuration
| Variable | Meaning |
|---|---|
MOODLE_URL | Base URL of your Moodle, no trailing slash. |
MOODLE_TOKEN | The token from step 3. Read from the environment, never logged. |
MOODLE_ALLOW_WRITE | true enables write tools. Anything else = read-only. |
Read-only by default: unless
MOODLE_ALLOW_WRITE is exactly true, only read tools are registered, so writes can never be exposed by accident.