Setup4 · Run the MCP server

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

VariableMeaning
MOODLE_URLBase URL of your Moodle, no trailing slash.
MOODLE_TOKENThe token from step 3. Read from the environment, never logged.
MOODLE_ALLOW_WRITEtrue 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.