micaherne/moodle-plugin-db-mcp
If you are the rightful owner of moodle-plugin-db-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This repository contains a TypeScript-based MCP server for querying the Moodle plugin database API.
Moodle Plugin DB MCP Server
This repository contains a TypeScript-based MCP (Model Context Protocol) server for querying the Moodle plugin database API at:
https://download.moodle.org/api/1.3/pluglist.php
What this provides
- Proper MCP Server: Built with
@modelcontextprotocol/sdk - Browser Testing: MCP Inspector integration for interactive testing
- stdio Transport: Compatible with Claude Desktop and other MCP clients
Available Tools
| Tool | Description | Parameters |
|---|---|---|
get_raw_pluglist | Fetch raw JSON data from Moodle plugin database API (with caching) | None |
find_latest_plugin_version | Find the latest version of a plugin compatible with a Moodle version or release | plugin_name (string): Name of the plugin component (e.g., mod_attendance)moodle_identifier (string): Moodle identifier as 10-digit version number (e.g., "2022111500") or major release (e.g., "4.1") |
get_cache_status | Get information about the current cache status | None |
Quick Start
Local Development
Install dependencies:
npm install
GitHub Codespaces (Recommended)
The easiest way to get started is using GitHub Codespaces:
- Create a GitHub repository from this code
- Open in Codespaces: Click the "Code" button → "Codespaces" → "Create codespace on main"
- Automatic setup: The devcontainer will automatically:
- Install Node.js 20
- Run
npm install - Configure VS Code with recommended extensions
- Forward the necessary ports (3000, 6274, 6277)
Testing with MCP Inspector (Browser)
The easiest way to test and develop your MCP server is using the MCP Inspector, which provides a web interface:
npm run inspector:dev
This will:
- Build the TypeScript code
- Launch the MCP Inspector
- Open your browser to an interactive testing interface (auto-forwarded in Codespaces)
- Show you all available tools and let you test them
You can also run the inspector against an already-built version:
npm run build
npm run inspector
Using with Claude Desktop
Add this to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"moodle-plugin-db": {
"command": "node",
"args": ["/absolute/path/to/moodle-plugin-db-mcp/dist/index.js"],
"env": {
"CACHE_DIR": "/path/to/your/cache/directory"
}
}
}
}
Configuration Options
The server supports the following configuration options:
CACHE_DIR(environment variable): Directory to store cached plugin data (defaults to system temp directory)- Example:
CACHE_DIR=/Users/username/.cache/moodle-plugins npm start - The cache uses a 1-hour TTL with automatic fallback to fresh data if needed
- Example:
Then restart Claude Desktop and you'll see the tools available in the interface.
Development
# Build TypeScript
npm run build
# Run the built server (stdio mode)
npm start
Codespaces Features
This repository is configured for GitHub Codespaces with:
- Pre-configured environment: Node.js 20, TypeScript, and all dependencies
- VS Code extensions: TypeScript, Prettier, Copilot, and JSON support
- Port forwarding: MCP Inspector UI automatically opens in browser
- Instant setup: Ready to code in seconds
Codespaces Port Configuration
- Port 3000: MCP Server (for direct connections)
- Port 6274: MCP Inspector UI (auto-opens in browser)
- Port 6277: MCP Inspector Proxy (background service)
Completed Features
- ✅ Parse the pluglist JSON response into typed structures
- ✅ Implement real logic for
find_plugin_latest_versiontool with Moodle version/release filtering - ✅ Add filesystem caching layer for the pluglist data (1-hour TTL with fallback)
- ✅ Basic error handling and input validation
- ✅ MCP settings support for configurable cache directory
Contributing
- Fork this repository
- Open in GitHub Codespaces for instant development environment
- Make your changes and test with
npm run inspector:dev - Submit a pull request