OM

onbirdev/moodle-webservice_mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

18 stars 9 forks 质量 47 趋势 26

Moodle 网络服务插件, 执行 MCP 与 AI 助手的无缝集成

概览

一个Moodle网络服务插件,用于与AI助手和外部系统实现无缝集成. 这个插件将Moodle的外部功能暴露为使用JSON-RPC 2.0的MCP工具,使其可以被MCP兼容客户端发现并调用. - : 全面支持使用 JSON- RPC 2.0 的模型上下文协议 - : 自动将Moodle外部功能暴露为 MCP 工具 - : 将Moodle参数描述转换为 JSON Schema ,以获得更好的工具文档 - : 使用Moodle外部服务符号的安全访问 - : 仅披露认证服务可用的功能 - : 全面 PHPUnit 测试覆盖 - : 构建客户端类,以快速与其他系统整合 这是一种开放的协议,它规范了应用程序如何向AI助手和大语言模型(LLM)提供上下文.

概述(AI 翻译)

一个Moodle网络服务插件,用于执行Model Context Protocol(MCP),与AI助手和外部系统进行无缝整合. 这个插件将Moodle的外部功能暴露为使用JSON-RPC 2.0的MCP工具,使其可以被MCP兼容客户端发现并调用.

□ 特性

  • ** MCP议定书的执行**: 使用 JSON- RPC 2. 0 支持模式背景协议
  • Dynamic工具发现:自动将Moodle外部功能曝光为MCP工具
  • JSON Schema Generation:将Moodle参数描述转换为JSON Schema,以便更好的工具文档
  • 基于托肯的认证: 使用Moodle的外部服务标志安全访问
  • ** 服务意识**: 只曝光认证服务可用的功能
  • 经过良好测试:PHPU综合测试覆盖率
  • ** 简化一体化**: 与其他系统快速整合的内建客户类

□ 什么是MCP吗?

**“模式上下文协议”(MCP)**是一个开放的协议,它规范了应用程序如何为AI助手和大语言模型(LLMs)提供上下文. 它允许AI助手:

  • 发现现有工具及其能力

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Moodle MCP Web Service Plugin

A Moodle web service plugin that implements the Model Context Protocol (MCP) for seamless integration with AI assistants and external systems. This plugin exposes Moodle’s external functions as MCP tools using JSON-RPC 2.0, making them discoverable and callable by MCP-compatible clients.

Features

  • MCP Protocol Implementation: Full support for Model Context Protocol using JSON-RPC 2.0
  • Dynamic Tool Discovery: Automatically exposes Moodle external functions as MCP tools
  • JSON Schema Generation: Converts Moodle parameter descriptions to JSON Schema for better tool documentation
  • Token-based Authentication: Secure access using Moodle’s external service tokens
  • Service-aware: Only exposes functions available to the authenticated service
  • Well-tested: Comprehensive PHPUnit test coverage
  • Easy Integration: Built-in client class for quick integration with other systems

What is MCP?

The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to AI assistants and Large Language Models (LLMs). It allows AI assistants to:

  • Discover available tools and their capabilities
  • Invoke tools with proper parameters
  • Receive structured responses

This plugin bridges Moodle’s web services with the MCP protocol, enabling AI assistants to interact with your Moodle instance in a standardized way.

Requirements

  • Moodle: 4.5 or higher
  • PHP: 8.1 or higher
  • Moodle Web Services: Must be enabled

Installation

  1. Visit Site administration → Plugins → Install plugins
  2. Search for “MCP Web Service”
  3. Click Install and follow the on-screen instructions

Method 2: Manual Installation

  1. Download the plugin or clone from repository:

    cd /path/to/moodle/webservice
    git clone https://github.com/onbirdev/moodle-webservice_mcp.git mcp
    
  2. Visit Site administration → Notifications to complete the installation

  3. The plugin will be installed as webservice_mcp

Configuration

1. Enable Web Services

  1. Go to Site administration → Advanced features
  2. Enable Enable web services
  3. Save changes

2. Enable MCP Protocol

  1. Go to Site administration → Plugins → Web services → Manage protocols
  2. Enable Model Context Protocol (MCP)

3. Create an External Service

  1. Go to Site administration → Server → Web services → External services
  2. Click Add to create a new service
  3. Configure the service:
    • Name: e.g., “MCP Service”
    • Short name: e.g., “mcp_service”
    • Enabled: Yes
    • Authorized users only: Yes (recommended)
  4. Add the external functions your service should expose

4. Create a Token

  1. Go to Site administration → Server → Web services → Manage tokens
  2. Click Add to create a new token
  3. Select:
    • User: The user this token will authenticate as
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →