Moodle MCP Server
Provides tools for interacting with Moodle LMS, including listing courses, retrieving course contents and documents, and searching resources across enrolled courses.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Moodle MCP Serverlist my enrolled courses"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🎓 Moodle MCP Server
Model Context Protocol integration for Moodle LMS
Features • Installation • Usage • Documentation • Contributing
📖 Overview
A powerful Model Context Protocol (MCP) server that seamlessly integrates AI assistants with Moodle Learning Management System. Enable your AI assistant to access courses, retrieve educational content, download resources, and search through your learning materials.
🔌 Compatible with: Claude Desktop, and any MCP-compatible AI assistant
Related MCP server: Moodle MCP Server
✨ Features
🔐 Secure Authentication - Token-based auth using Moodle Web Services
📚 Course Management - List and access all enrolled courses
📄 Content Retrieval - Get sections, modules, and resources from courses
💾 Document Access - Download files and documents with proper authentication
🔍 Smart Search - Find resources by name across all enrolled courses
🛡️ Error Handling - Comprehensive error handling with automatic token refresh
🚀 TypeScript - Fully typed for better developer experience
🎯 Use Cases
Study Assistant: Let AI help you navigate course materials
Content Organization: Search and organize learning resources
Course Overview: Get quick summaries of course structures
Resource Discovery: Find specific documents across multiple courses
Learning Analytics: Analyze course content and structure
📋 Prerequisites
Node.js 18 or higher
Moodle Instance with Web Services enabled
Valid Credentials with API access to your Moodle instance
🚀 Installation
Quick Start
# Clone the repository
git clone <repository-url>
cd moodle-mcp
# Install dependencies
npm install
# Build the project
npm run buildConfiguration
Create environment file
cp .env.example .envConfigure your credentials
MOODLE_URL=https://your-moodle-instance.com
MOODLE_USERNAME=your_username
MOODLE_PASSWORD=your_password
MOODLE_SERVICE=moodle_mobile_app # OptionalMoodle Web Services Setup
Your Moodle instance must have Web Services enabled. If you're a Moodle administrator:
Navigate to Site administration → Server → Web services → Overview
Follow the setup wizard to enable web services
Create or use the built-in
moodle_mobile_appserviceEnsure these functions are enabled:
core_webservice_get_site_infocore_enrol_get_users_coursescore_course_get_coursescore_course_get_contents
🎮 Usage
Running the Server
# Production
node dist/index.js
# Development with auto-reload
npm run devIntegration with Claude Desktop
Add to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"moodle": {
"command": "node",
"args": ["/absolute/path/to/moodle-mcp/dist/index.js"],
"env": {
"MOODLE_URL": "https://your-moodle-instance.com",
"MOODLE_USERNAME": "your_username",
"MOODLE_PASSWORD": "your_password"
}
}
}
}Available Tools
Tool | Description |
| List all enrolled courses with details |
| Retrieve complete course structure with sections and modules |
| Get all downloadable files from a course with direct URLs |
| Search for resources by name across all courses |
📚 Detailed documentation: See USAGE.md for comprehensive tool documentation
🧪 Testing
Quick Test
# Run the complete test suite
npm testTesting Options
Method | Description |
Automated Tests |
|
MCP Inspector | Interactive web-based tool testing |
Standalone Script | Direct API testing without MCP |
Manual cURL | Test Moodle API endpoints directly |
📘 Full testing guide: See TESTING.md
🏗️ Development
Project Structure
moodle-mcp/
├── src/
│ ├── index.ts # MCP server implementation
│ ├── moodle-client.ts # Moodle API client
│ ├── types.ts # TypeScript type definitions
│ └── test.ts # Standalone test script
├── dist/ # Compiled JavaScript
├── .env.example # Environment template
├── README.md # This file
├── USAGE.md # Tool usage guide
└── TESTING.md # Testing guideCommands
# Build the project
npm run build
# Watch mode (auto-rebuild)
npm run watch
# Run tests
npm test
# Development mode
npm run dev🔧 API Architecture
Authentication Flow
1. Token Generation → POST /login/token.php
2. API Calls → GET/POST /webservice/rest/server.php?wstoken={token}
3. File Downloads → GET /pluginfile.php/...?token={token}Moodle Web Services
core_webservice_get_site_info- User and site informationcore_enrol_get_users_courses- Enrolled courses listcore_course_get_courses- All available coursescore_course_get_contents- Course structure and resources
📚 Documentation
USAGE.md - Comprehensive guide to all available tools
TESTING.md - Testing instructions and methods
MCP Documentation - Learn more about MCP
🐛 Troubleshooting
✅ Verify credentials are correct in
.env✅ Ensure Web Services are enabled in Moodle
✅ Check service name matches your Moodle configuration
✅ Verify user has appropriate API access permissions
✅ Verify user has appropriate role permissions in Moodle
✅ Some resources may be restricted based on enrollment
✅ Check course visibility settings
✅ Verify Moodle URL is correct and accessible
✅ Check network connection and firewall settings
✅ Ensure Moodle instance accepts API requests
✅ Try accessing Moodle URL directly in browser
🔒 Security
🔐 Store credentials securely using environment variables
🌐 Use HTTPS for Moodle connections in production
🔄 Regularly rotate passwords and tokens
📋 Follow your organization's security policies
⚠️ Never commit
.envfile to version control
🤝 Contributing
Contributions are welcome! Here's how you can help:
🍴 Fork the repository
🔨 Create a feature branch (
git checkout -b feature/amazing-feature)💾 Commit your changes (
git commit -m 'Add amazing feature')📤 Push to the branch (
git push origin feature/amazing-feature)🎉 Open a Pull Request
Please ensure your PR:
✅ Includes tests for new features
✅ Updates documentation as needed
✅ Follows existing code style
✅ Passes all tests
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
Built with Model Context Protocol SDK
Powered by Moodle LMS
TypeScript & Node.js ecosystem
📞 Support
Made with ❤️ for the Moodle and AI community
⭐ Star this repo if you find it helpful!
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that enables LLMs to interact with Moodle platforms to manage courses, students, assignments, and quizzes through natural language commands.Last updated72040MIT
- AlicenseBqualityDmaintenanceAn MCP server that enables LLMs to interact with the Moodle platform to manage courses, students, assignments, and quizzes.Last updated720MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server that provides seamless access to Moodle developer documentation from moodledev.io. It enables AI assistants and other MCP clients to search, browse, and retrieve Moodle development documentation with version-specific support.Last updated4MIT
- Alicense-qualityCmaintenanceMCP server that turns UPB Virtual (Moodle) into a structured knowledge source, enabling AI assistants to query courses, assignments, deadlines, announcements, and sync materials via REST API.Last updatedMIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for AI dialogue using various LLM models via AceDataCloud
An MCP server that gives your AI access to the source code and docs of all public github repos
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/linomck/moodle-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server